QT QWidgetAttribute
说明
Constant | Value | Description |
---|---|---|
Qt::WA_AcceptDrops | 78 | Allows data from drag and drop operations to be dropped onto the widget (see QWidget::setAcceptDrops()). |
Qt::WA_Hover | 74 | Forces Qt to generate paint events when the mouse enters or leaves the widget. This feature is typically used when implementing custom styles; see the Styles example for details. 当鼠标进入或离开小部件时,强制Qt生成绘制事件。 在实现自定义样式时通常使用此功能。 有关详细信息,请参见样式示例。 需要捕捉悬停时,需设置成true |
Qt::WA_AlwaysShowToolTips 84 Enables tooltips for inactive windows.
Qt::WA_ContentsPropagated 3 This flag is superfluous and obsolete; it no longer has any effect. Since Qt 4.1, all widgets that do not set WA_PaintOnScreen propagate their contents.
Qt::WA_CustomWhatsThis 47 Indicates that the widget wants to continue operating normally in “What’s This?” mode. This is set by the widget’s author.
Qt::WA_DeleteOnClose 55 Makes Qt delete this widget when the widget has accepted the close event (see QWidget::closeEvent()).
Qt::WA_Disabled 0 Indicates that the widget is disabled, i.e. it does not receive any mouse or keyboard events. There is also a getter functions QWidget::isEnabled(). This is set/cleared by the Qt kernel.
Qt::WA_DontShowOnScreen 103 Indicates that the widget is hidden or is not a part of the viewable Desktop.
Qt::WA_ForceDisabled 32 Indicates that the widget is explicitly disabled, i.e. it will remain disabled even when all its ancestors are set to the enabled state. This implies WA_Disabled. This is set/cleared by QWidget::setEnabled() and QWidget::setDisabled().
Qt::WA_ForceUpdatesDisabled 59 Indicates that updates are explicitly disabled for the widget; i.e. it will remain disabled even when all its ancestors are set to the updates-enabled state. This implies WA_UpdatesDisabled. This is set/cleared by QWidget::setUpdatesEnabled().
Qt::WA_GroupLeader 72 This attribute has been deprecated. Use QWidget::windowModality instead.
Qt::WA_InputMethodEnabled 14 Enables input methods for Asian languages. Must be set when creating custom text editing widgets.
Qt::WA_KeyboardFocusChange 77 Set on a toplevel window when the users changes focus with the keyboard (tab, backtab, or shortcut).
Qt::WA_KeyCompression 33 Enables key event compression if set, and disables it if not set. By default key compression is off, so widgets receive one key press event for each key press (or more, since autorepeat is usually on). If you turn it on and your program doesn’t keep up with key input, Qt may try to compress key events so that more than one character can be processed in each event. For example, a word processor widget might receive 2, 3 or more characters in each QKeyEvent::text(), if the layout recalculation takes too long for the CPU. If a widget supports multiple character unicode input, it is always safe to turn the compression on. Qt performs key event compression only for printable characters. Qt::Modifier keys, cursor movement keys, function keys and miscellaneous action keys (e.g. Escape, Enter, Backspace, PrintScreen) will stop key event compression, even if there are more compressible key events available. Platforms other than Mac and X11 do not support this compression, in which case turning it on will have no effect. This is set/cleared by the widget’s author.
Qt::WA_LayoutOnEntireRect 48 Indicates that the widget wants QLayout to operate on the entire QWidget::rect(), not only on QWidget::contentsRect(). This is set by the widget’s author.
Qt::WA_LayoutUsesWidgetRect 92 Ignore the layout item rect from the