Class: RubyQt6::QtGui::QAction

Inherits:
RubyQt6::QtCore::QObject
  • Object
show all
Defined in:
lib/qt6/qtgui/qaction.rb

Overview

Defined Under Namespace

Classes: ActionEvent, MenuRole, Priority

Constant Summary collapse

INITIALIZE_ARG_ERROR_MESSAGE =
"Could not resolve method call for #{name}#initialize\n" \
"  3 overload(s) were evaluated based on the types of Ruby parameters provided:\n" \
"    initialize(QObject)\n" \
"    initialize(QString, QObject)\n" \
"    initialize(QIcon, QString, QObject)\n"

Instance Method Summary collapse

Constructor Details

#initialize(parent = nil) ⇒ QAction #initialize(text, parent = nil) ⇒ QAction #initialize(icon, text, parent = nil) ⇒ QAction

Overloads:

  • #initialize(parent = nil) ⇒ QAction

    Parameters:

    • parent (QObject) (defaults to: nil)
  • #initialize(text, parent = nil) ⇒ QAction

    Parameters:

    • text (String, QString)
    • parent (QObject) (defaults to: nil)
  • #initialize(icon, text, parent = nil) ⇒ QAction

    Parameters:

    • icon (QIcon)
    • text (String, QString)
    • parent (QObject) (defaults to: nil)


57
58
59
60
61
62
63
64
65
66
# File 'lib/qt6/qtgui/qaction.rb', line 57

def initialize(*args)
  parent = T.args_nth_delete_qobject(args, -1)
  case args.size
  when 0 then _initialize(QtGui::QIcon.new, T.to_qstr(""), parent)
  when 1 then _initialize(QtGui::QIcon.new, T.to_qstr(args[-1]), parent)
  when 2 then _initialize(args[-2], T.to_qstr(args[-1]), parent)
  else raise ArgumentError, INITIALIZE_ARG_ERROR_MESSAGE
  end
  _take_ownership_from_ruby(self)
end