QT QWidgetAttribute

QT QWidgetAttribute包括多个枚举值,如WA_AlwaysShowToolTips、WA_ContentsPropagated等,用于控制Qt窗口部件的不同行为。这些属性涉及窗口部件的显示、更新、输入方法、键盘焦点、鼠标追踪等方面,对Qt应用程序的界面和交互有重要影响。
摘要由CSDN通过智能技术生成

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值