QT5 Buttons

1. PushButton control
 1) Control location: Button->PushButton
 2) Control introduction: This control inherits from the QButton class and is usually used to execute commands or trigger events.
 3) Control property setting options:
  (1) name: The control corresponds to the name in the source code.
  (2) text: This control corresponds to the name displayed in the graphical interface.
  (3) font: Set the font of the text.
  (4) enabled: Whether the control is available.
 4) Common member functions:
  (1) QPushButton::QPushButton(const QString &text, QWidget *parent, const char *name = 0);
 Construct a push button named name, parent object and text text.
  (2) void QButton::pressed()[signal] Emits a signal
 when the button is pressed.
  (3) void QButton::clicked()[signal] Emits a signal
 when the button is clicked.
  (4) void QButton::released()[signal]
 When the button is released, the signal is emitted.
  (5) void QButton::setText(const QString &)
 Sets the text displayed on the button.
  (6) QString QButton::text() const
 returns the text displayed on the button.

2. RadioButton control
 1) Control location: Buttons->RadioButton
 2) Control introduction: radio button, inherited from the QButton class, usually in groups, used to provide two or more mutually exclusive options.
 3) Control property setting options:
  (1) name: The control corresponds to the name displayed in the source code.
  (2) text: This control corresponds to the name displayed in the graphical interface.
  (3) font: Set the text font.
  (4) enabled: Whether the control is available, it is true if it is available, and false if it is not available.
  (5) checked: used to set or return whether the radio button is selected, the selected is true, and the unselected is false.
 4) Commonly used member functions:
  (1) QRadioButton::QRadioButton(const QString &text, QWidget *parent, const char *name = 0)
 constructs a radio button named name, parent object and text text.
  (2) bool QRadioButton::isChecked() const
 Returns whether the radio button is checked, returns true when checked, and returns false when not checked.
  (3) void QButton::setText(const QString &)
 Sets the text displayed on the button.
  (4) QString QButton::text()const
 Returns the text displayed on this button.
  (5) void QButton::stateChanged(int state)[signal]
 Signal will be emitted when the checked property value is changed.
  (6) void QRadioButton::setChecked(bool check)[virtual slot]
 Sets whether the radio button is selected as check.

3. CheckBox control
 1) Control location: Buttons->CheckBox
 2) Control introduction: Check box, inherited from QButton, the difference from RadioButton is the selection mode, the radio button provides multiple selections, and the checkbox provides multiple selections. .
 3) Control property setting options:
  (1) name: The control corresponds to the name displayed in the source code.
  (2) text: This control corresponds to the name displayed in the graphical interface.
  (3) font: Set the text font.
  (4) enabled: Whether the control is available, it is true if it is available, and false if it is not available.
  (5) checked: used to set or return whether the radio button is selected, the selected is true, and the unselected is false.
 4) Common member functions:
  (1) QCheckBox::QCheckBox(const QString &text, QWidget *parent, const char *name = 0)
 constructs a checkbox named name, parent object parent and text text.
  (2) QCheckBox::isChecked() const
 selects the checkbox and returns true, otherwise returns false.
  (3) void QButton::setText(const QString &)
 Sets the text displayed on the button.
  (4) QString QButton::text() const
 returns the text displayed on the button.
  (5) void QButton::stateChange(int state)[signal]
 This signal will be emitted when the checked property is changed.
  (6) void QCheckBox::setChecked(bool check)[slot]
 Set whether the checkbox is checked, the status is the value of check.

Fourth, ToolButton control
 1) Control location: Buttons->ToolButton
 2) Control introduction: Tool button, inherited from the QButton class, is a button that can be quickly accessed for commands or options, usually in ToolBar. Tool buttons usually display icons instead of text labels. ToolButton supports auto-floating. In auto-float mode, the button only draws a three-dimensional frame when the mouse is pointed at it.
 3) Control setting options:
  (1) name: The control corresponds to the name in the source code.
  (2) text: Tool button label text.
  (3) font: Set the font of the tool button label.
  (4) autoRaise: Whether the automatic floating takes effect.
  (5) iconSet: Provides an icon set of icons displayed on the button.
  (6) on: Whether the tool button is on.
  (7) textLabel: The tool button automatically prompts the text.
  (8) usesTextLabel: Automatically prompt whether textLabel works, the default is false.
 4) Commonly used member functions:
  (1) QToolButton::QToolButton(QWidget *parent, const char *name = 0)
 constructs a ToolButton whose name is name and whose parent is parent.
  (2) QToolButton::QToolButton(const QIconset &iconSet, const QString &textLabel, const QString &grouptext, QObject *receiver, const char *slot, QToolBar *parent, const char *name = 0)
 construct a name with name and parent object as parent (Must be a QToolBar) tool button. The tool button will display iconSet, the tool tip will be textLabel, the status bar information will be grouptext, and the tool button will be linked to the slot function of the receiver object.
  (3) QToolBButton::QToolButton(ArrowType type, QWidget *parent, const char *name = 0)
 This constructor is to construct the tool button into an arrow button, the type defines the direction of the arrow, and the available values ​​are LeftArrow, RightArrow, UpArrow , DownArrow.
  (4) void QToolButton::setAutoRaise(bool enable)
 Set whether the button can be automatically floated according to the parameter enable value.
  (5) void QToolButton::setIcon(const QIconSet &)
 Sets the icon displayed on the tool button.
  (6) void QToolButton::setOn(bool enable)[virtual slot]
 Set whether the button is on, if enable is equal to true, set it to on, otherwise set it to off.
  (7) void QToolButton::setTextLabel(const QString &) [slot]
 Sets the button's tooltip label.
  (8) QString QToolButton::textLabel() const
 returns the button's prompt label.

Five, CommandLinkButton control
 1) Control location: Buttons->CommandLinkButton
 2) Control introduction: command link button, inherited from QPushButton, used to select an item in mutually exclusive options, CommandLinkButton has the normal button text description text , by default it will also carry an arrow icon to indicate that pressing the button will open another window or page.
 3) Control property setting options:
  (1) name: The control corresponds to the name in the source code.
  (2) text: This control corresponds to the label displayed in the graphical interface.
  (3) font: Set the font of the text.
  (4) enabled: Whether the control is available.
  (5) description: A descriptive label to match the text on the button.
 4) Common member functions:
  (1) QCommandLinkButton::QCommandLinkButton(QWidget *parent = 0)
 Constructs a command link button whose parent object is parent.
  (2) QCommandLinkButton::QCommandLinkButton(const QString &text, QWidget *parent = 0)
 Constructs a command link button whose parent object is parent and text is text.
  (3) QCommandLinkButton::QCommandLinkButton(const QString &text, const QString &description, QWidget *parent = 0)
 Constructs a command link button whose parent object is parent, text is text and description text is description.
  (4) void QButton::clicked()[signal]
 When the button is clicked, emit a signal.
  (5) void QButton::pressed()[signal]
 This signal is emitted when the button is pressed.
  (6) void QButton::released()[signal]
 This signal is emitted when the button is released.
  (7) void QButton::setText(const QString &)
 Set the text displayed on the button.
  (8) QString QButton::text()const
Returns the text displayed on the button.

6. ButtonBox control
 1) Control location: Buttons->ButtonBox
 2) Control introduction: Button keys, which are packaged by the QDialogButtonBox class.
 3) Control property setting options:
  (1) name: The control corresponds to the name in the source code.
  (2) font: Set the font of the text.
  (3) enabled: Whether the control is available.
  (4) centerButtons: Whether the buttons in the ButtonBox are centered or not, the default value is false.
  (5) orientation: The button layout direction, Qt provides QT::Horizontal and QT::Vertical.
  (6) standardButtons: A collection of standard buttons.
 4) Commonly used member functions:
  (1) QDialogButtonBox::QDialogButtonBox (QWidget *parent = 0)
 constructs a button box, the parent object is parent.
  (2) QDialogButtonBox::QDialogButtonBox(QT::Orientation orientation, QWidget *parent = 0)
 Constructs a button box, the parent object is parent, the arrangement direction is orientation, and contains buttons.
  (3) QDialogButtonBox::QDialogButtonBox(StandardButton buttons, QT::Orientation orientation=QT::Horizontal, QWidget *parent=0)
 Constructs a button box, the parent object is parent, and the arrangement direction is orientation.
  (4) void QDialogButtonBox::accepted()[signal]
 When the button defined as AcceptRole and YesRole in the button box is clicked, a signal is emitted.
  (5) void QDialogButtonBox::addButton(QAbstractButton *button, ButtonRole role)
 adds a button to the button box, and defines the role of the button as role. If the role is invalid, the button will not be added. If the button has been added, remove it and added as a new character.
  (6) QPushButton *QDialogButtonBox::addButton(StandarButton button)
 adds a standard button button to the button box and returns the standard button. If the button is invalid, do not add it, return 0.
  (7) QPushButton *QDialogButtonBox::addButton(const QString &text, ButtonRole role)
 Create a button with text as text, add the specified role to the button box, and return the corresponding button, if If role is invalid, it will not be created and return 0.
  (8) void QDialogButtonBox::clear()
 clears all buttons in the button box.
  (9) void QDialogButtonBox::clicked(QAbstractButton*button)[signal]
 This signal is emitted when the button button in the button box is clicked.
  (10) void QDialogButtonBox::helpRequested()[signal]
 This signal is emitted when the button defined as HelpRole in the button box is clicked.
  (11) void QDialogButtonBox::rejected() [signal]
 This signal is emitted when the button defined as RejectRole and NoRole in the button box is clicked.
  (12) void QDialogButtonBox::removeButton(QAbstractButton *button)
 removes the button Button in the button box, but does not delete it, and sets its parent to 0.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324647455&siteId=291194637