QPushButton Class Reference |
A push button shown in the Macintosh widget style. Note that when a button's width becomes smaller than 50 or its height becomes smaller than 30, the button's corners are changed from round to square. Use the setMinimumSize() function to prevent this behavior. | |
A push button shown in the Windows XP widget style. | |
A push button shown in the Plastique widget style. |
In Qt, the QAbstractButton base class provides most of the modes and other API, and QPushButton provides GUI logic. See QAbstractButton for more information about the API.
See also QToolButton, QRadioButton, QCheckBox, and GUI Design Handbook: Push Button.
This property holds whether the push button is the auto default button.
If this property is set to true then the push button is the auto default button in a dialog.
In some GUI styles a default button is drawn with an extra frame around it, up to 3 pixels or more. Qt automatically keeps this space free around auto-default buttons, i.e. auto-default buttons may have a slightly larger size hint.
This property's default is true for buttons that have a QDialog parent; otherwise it defaults to false.
See the default property for details of how default and auto-default interact.
Access functions:
This property holds whether the push button is the default button.
If this property is set to true then the push button will be pressed if the user presses the Enter (or Return) key in a dialog.
Regardless of focus, if the user presses Enter: If there is a default button the default button is pressed; otherwise, if there are one or more autoDefault buttons the first autoDefault button that is next in the tab order is pressed. If there are no default or autoDefault buttons only pressing Space on a button with focus, mouse clicking, or using a shortcut will press a button.
In a dialog, only one push button at a time can be the default button. This button is then displayed with an additional frame (depending on the GUI style).
The default button behavior is provided only in dialogs. Buttons can always be clicked from the keyboard by pressing Spacebar when the button has focus.
This property's default is false.
Access functions:
This property holds whether the border is disabled.
This property's default is false.
Access functions:
Constructs a push button with no text and a parent.
Constructs a push button with the parent parent and the text text.
Constructs a push button with an icon and a text, and a parent.
Note that you can also pass a QPixmap object as an icon (thanks to the implicit type conversion provided by C++).
Destroys the push button.
Returns the button's associated popup menu or 0 if no popup menu has been set.
See also setMenu().
Associates the popup menu menu with this push button. This turns the button into a menu button, which in some styles will produce a small triangle to the right of the button's text.
Ownership of the menu is not transferred to the push button.
Push buttons with popup menus shown in the Plastique widget style (left) and Cleanlooks widget style (right). |
See also menu().
Shows (pops up) the associated popup menu. If there is no such menu, this function does nothing. This function does not return until the popup menu has been closed by the user.
Use one of the constructors that doesn't take the name argument and then use setObjectName() instead.
Use one of the constructors that doesn't take the name argument and then use setObjectName() instead.
Use one of the constructors that doesn't take the name argument and then use setObjectName() instead.
Use menu() != 0 instead.
Use showMenu() instead.
Use menu() instead.
See also setPopup().
Use setMenu() instead.
See also popup().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.2 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com