对于 QEvent.Shortcut 事件发生,快捷方式的键序列必须由用户在快捷方式处于活动状态的上下文中键入。可能的上下文是这些:
| 常量 | 描述 |
|---|---|
| Qt.WidgetShortcut | 快捷方式是活动的当其父级 Widget 拥有聚焦时。 |
| Qt.WidgetWithChildrenShortcut | 快捷方式活动,当其父级 Widget 或其任何子级拥有聚焦时。顶层 Widget 的子级不受此快捷上下文的影响,除了弹出窗口。 |
| Qt.WindowShortcut | 快捷方式活动,当其父级 Widget 是活动顶层窗口的逻辑子 Widget 时。 |
| Qt.ApplicationShortcut | 快捷方式活动,当应用程序的某一窗口活动时。 |
此枚举描述可复选项、控件及 Widget 的状态。
| 常量 | 描述 |
|---|---|
| Qt.Unchecked | 项被取消复选。 |
| Qt.PartiallyChecked | The item is partially checked. Items in hierarchical models may be partially checked if some, but not all, of their children are checked. |
| Qt.Checked | 项被复选。 |
另请参阅
PySide.QtGui.QCheckBox Qt.ItemFlags Qt.ItemDataRole
此枚举类型定义 Widget 在获得键盘聚焦方面可以拥有的各种策略。
| 常量 | 描述 |
|---|---|
| Qt.TabFocus | Widget 通过 Tab 键接受聚焦。 |
| Qt.ClickFocus | Widget 通过点击接受聚焦。 |
| Qt.StrongFocus | the widget accepts focus by both tabbing and clicking. On Mac OS X this will also be indicate that the widget accepts tab focus when in ‘Text/List focus mode'. |
| Qt.WheelFocus | like Qt.StrongFocus plus the widget accepts focus by using the mouse wheel. |
| Qt.NoFocus | Widget 不接受聚焦。 |
此枚举类型描述标准手势。
| 常量 | 描述 |
|---|---|
| Qt.TapGesture | 点击手势。 |
| Qt.TapAndHoldGesture | 点击并保持 (长点击) 手势。 |
| Qt.PanGesture | 平移手势。 |
| Qt.PinchGesture | 捏合手势。 |
| Qt.SwipeGesture | 轻扫手势。 |
| Qt.CustomGesture | 可以用于测试的标志,若手势是用户定义手势 ID。 |
注册用户定义手势采用 QGestureRecognizer.registerRecognizer() function which generates a custom gesture ID with the Qt.CustomGesture flag set.
另请参阅
PySide.QtGui.QGesture QWidget.grabGesture() QGraphicsObject.grabGesture()
注意
该枚举在 Qt 4.6 引入或被修改
| 常量 | 描述 |
|---|---|
| Qt.CopyAction | Copy the data to the target. |
| Qt.MoveAction | Move the data from the source to the target. |
| Qt.LinkAction | Create a link from the source to the target. |
| Qt.ActionMask | |
| Qt.IgnoreAction | Ignore the action (do nothing with the data). |
| Qt.TargetMoveAction | On Windows, this value is used when the ownership of the D&D data should be taken over by the target application, i.e., the source application should not delete the data. .. raw:: html <br /> On X11 this value is used to do a move. .. raw:: html <br /> TargetMoveAction is not used on the Mac. |
此枚举类型用于为 Widget 指定各种窗口系统特性。它们相当不寻常,但在某些情况下是必要的。其中一些标志从属底层窗口管理器是否支持它们。
主要类型是
| 常量 | 描述 |
|---|---|
| Qt.Widget | 这是默认类型对于 PySide.QtGui.QWidget . Widgets of this type are child widgets if they have a parent, and independent windows if they have no parent. See also Qt.Window and Qt.SubWindow . |
| Qt.Window | Indicates that the widget is a window, usually with a window system frame and a title bar, irrespective of whether the widget has a parent or not. Note that it is not possible to unset this flag if the widget does not have a parent. |
| Qt.Dialog | Indicates that the widget is a window that should be decorated as a dialog (i.e., typically no maximize or minimize buttons in the title bar). This is the default type for PySide.QtGui.QDialog . If you want to use it as a modal dialog, it should be launched from another window, or have a parent and used with the QWidget.windowModality property. If you make it modal, the dialog will prevent other top-level windows in the application from getting any input. We refer to a top-level window that has a parent as a secondary 窗口。 |
| Qt.Sheet | Indicates that the window is a Macintosh sheet. Since using a sheet implies window modality, the recommended way is to use QWidget.setWindowModality() ,或 QDialog.open() , instead. |
| Qt.Drawer | Indicates that the widget is a Macintosh drawer. |
| Qt.Popup | Indicates that the widget is a pop-up top-level window, i.e. that it is modal, but has a window system frame appropriate for pop-up menus. |
| Qt.Tool | Indicates that the widget is a tool window. A tool window is often a small window with a smaller than usual title bar and decoration, typically used for collections of tool buttons. If there is a parent, the tool window will always be kept on top of it. If there isn't a parent, you may consider using Qt.WindowStaysOnTopHint as well. If the window system supports it, a tool window can be decorated with a somewhat lighter frame. It can also be combined with Qt.FramelessWindowHint . .. raw:: html <br /> .. raw:: html <br /> On Mac OS X, tool windows correspond to the Floating class of windows. This means that the window lives on a level above normal windows; it impossible to put a normal window on top of it. By default, tool windows will disappear when the application is inactive. This can be controlled by the Qt.WA_MacAlwaysShowToolWindow 属性。 |
| Qt.ToolTip | 指示 Widget 是工具提示。这在内部使用以实现 tooltips . |
| Qt.SplashScreen | 指示窗口是闪屏。这是默认类型对于 PySide.QtGui.QSplashScreen . |
| Qt.Desktop | Indicates that this widget is the desktop. This is the type for PySide.QtGui.QDesktopWidget . |
| Qt.SubWindow | 指示此 Widget 是子窗口,譬如 PySide.QtGui.QMdiSubWindow 小部件。 |
There are also a number of flags which you can use to customize the appearance of top-level windows. These have no effect on other windows:
| 常量 | 描述 |
|---|---|
| Qt.MSWindowsFixedSizeDialogHint | Gives the window a thin dialog border on Windows. This style is traditionally used for fixed-size dialogs. |
| Qt.MSWindowsOwnDC | Gives the window its own display context on Windows. |
| Qt.X11BypassWindowManagerHint | Bypass the window manager completely. This results in a borderless window that is not managed at all (i.e., no keyboard input unless you call QWidget.activateWindow() manually). |
| Qt.FramelessWindowHint | Produces a borderless window. The user cannot move or resize a borderless window via the window system. On X11, the result of the flag is dependent on the window manager and its ability to understand Motif and/or NETWM hints. Most existing modern window managers can handle this. |
CustomizeWindowHint flag is used to enable customization of the window controls. This flag must be set to allow the WindowTitleHint , WindowSystemMenuHint , WindowMinimizeButtonHint , WindowMaximizeButtonHint and WindowCloseButtonHint flags to be changed.
| 常量 | 描述 |
|---|---|
| Qt.CustomizeWindowHint | 关闭默认窗口标题提示。 |
| Qt.WindowTitleHint | 赋予窗口标题栏。 |
| Qt.WindowSystemMenuHint | Adds a window system menu, and possibly a close button (for example on Mac). If you need to hide or show a close button, it is more portable to use WindowCloseButtonHint . |
| Qt.WindowMinimizeButtonHint | Adds a minimize button. On some platforms this implies Qt.WindowSystemMenuHint for it to work. |
| Qt.WindowMaximizeButtonHint | Adds a maximize button. On some platforms this implies Qt.WindowSystemMenuHint for it to work. |
| Qt.WindowMinMaxButtonsHint | Adds a minimize and a maximize button. On some platforms this implies Qt.WindowSystemMenuHint for it to work. |
| Qt.WindowCloseButtonHint | Adds a close button. On some platforms this implies Qt.WindowSystemMenuHint for it to work. |
| Qt.WindowContextHelpButtonHint | Adds a context help button to dialogs. On some platforms this implies Qt.WindowSystemMenuHint for it to work. |
| Qt.MacWindowToolBarButtonHint | On Mac OS X adds a tool bar button (i.e., the oblong button that is on the top right of windows that have toolbars). |
| Qt.BypassGraphicsProxyWidget | Prevents the window and its children from automatically embedding themselves into a PySide.QtGui.QGraphicsProxyWidget if the parent widget is already embedded. You can set this flag if you want your widget to always be a toplevel widget on the desktop, regardless of whether the parent widget is embedded in a scene or not. |
| Qt.WindowShadeButtonHint | |
| Qt.WindowStaysOnTopHint | Informs the window system that the window should stay on top of all other windows. Note that on some window managers on X11 you also have to pass Qt.X11BypassWindowManagerHint for this flag to work correctly. |
| Qt.WindowStaysOnBottomHint | Informs the window system that the window should stay on bottom of all other windows. Note that on X11 this hint will work only in window managers that support _NET_WM_STATE_BELOW atom. If a window always on the bottom has a parent, the parent will also be left on the bottom. This window hint is currently not implemented for Mac OS X. |
| Qt.WindowOkButtonHint | Adds an OK button to the window decoration of a dialog. Only supported for Windows CE. |
| Qt.WindowCancelButtonHint | Adds a Cancel button to the window decoration of a dialog. Only supported for Windows CE. |
| Qt.WindowSoftkeysVisibleHint | Makes softkeys visible when widget is fullscreen. Only supported for Symbian. |
| Qt.WindowSoftkeysRespondHint | Makes softkeys to receive key events even when invisible. With this hint the softkey actions are triggered even the softkeys are invisible i.e. the window is displayed with showFullscreen() . Only supported for Symbian. |
| Qt.WindowType_Mask | A mask for extracting the window type part of the window flags. |
Obsolete flags:
| 常量 | 描述 |
|---|---|
| Qt.WMouseNoMask | 使用 Qt.WA_MouseNoMask 代替。 |
| Qt.WDestructiveClose | 使用 Qt.WA_DeleteOnClose 代替。 |
| Qt.WStaticContents | 使用 Qt.WA_StaticContents 代替。 |
| Qt.WGroupLeader | No longer needed. |
| Qt.WShowModal | 使用 QWidget.windowModality 代替。 |
| Qt.WNoMousePropagation | 使用 Qt.WA_NoMousePropagation 代替。 |
| Qt.WType_TopLevel | 使用 Qt.Window 代替。 |
| Qt.WType_Dialog | 使用 Qt.Dialog 代替。 |
| Qt.WType_Popup | 使用 Qt.Popup 代替。 |
| Qt.WType_Desktop | 使用 Qt.Desktop 代替。 |
| Qt.WType_Mask | 使用 Qt.WindowType_Mask 代替。 |
| Qt.WStyle_Customize | No longer needed. |
| Qt.WStyle_NormalBorder | No longer needed. |
| Qt.WStyle_DialogBorder | 使用 Qt.MSWindowsFixedSizeDialogHint 代替。 |
| Qt.WStyle_NoBorder | 使用 Qt.FramelessWindowHint 代替。 |
| Qt.WStyle_Title | 使用 Qt.WindowTitleHint 代替。 |
| Qt.WStyle_SysMenu | 使用 Qt.WindowSystemMenuHint 代替。 |
| Qt.WStyle_Minimize | 使用 Qt.WindowMinimizeButtonHint 代替。 |
| Qt.WStyle_Maximize | 使用 Qt.WindowMaximizeButtonHint 代替。 |
| Qt.WStyle_MinMax | 使用 Qt.WindowMinMaxButtonsHint 代替。 |
| Qt.WStyle_Tool | 使用 Qt.Tool 代替。 |
| Qt.WStyle_StaysOnTop | 使用 Qt.WindowStaysOnTopHint 代替。 |
| Qt.WStyle_ContextHelp | 使用 Qt.WindowContextHelpButtonHint 代替。 |
| Qt.WPaintDesktop | No longer needed. |
| Qt.WPaintClever | No longer needed. |
| Qt.WX11BypassWM | 使用 Qt.X11BypassWindowManagerHint 代替。 |
| Qt.WWinOwnDC | 使用 Qt.MSWindowsOwnDC 代替。 |
| Qt.WMacSheet | 使用 Qt.Sheet 代替。 |
| Qt.WMacDrawer | 使用 Qt.Drawer 代替。 |
| Qt.WStyle_Splash | 使用 Qt.SplashScreen 代替。 |
| Qt.WNoAutoErase | No longer needed. |
| Qt.WRepaintNoErase | No longer needed. |
| Qt.WNorthWestGravity | 使用 Qt.WA_StaticContents 代替。 |
| Qt.WType_Modal | 使用 Qt.Dialog and QWidget.windowModality 代替。 |
| Qt.WStyle_Dialog | 使用 Qt.Dialog 代替。 |
| Qt.WStyle_NoBorderEx | 使用 Qt.FramelessWindowHint 代替。 |
| Qt.WResizeNoErase | No longer needed. |
| Qt.WMacNoSheet | No longer needed. |
另请参阅
QWidget.windowFlags 窗口标志范例
| 常量 | 描述 |
|---|---|
| Qt.TextDate | The default Qt format, which includes the day and month name, the day number in the month, and the year in full. The day and month names will be short, localized names. This is basically equivalent to using the date format string, “ddd MMM d yyyy”. See QDate.toString() 了解更多信息。 |
| Qt.ISODate | ISO 8601 extended format: either YYYY-MM-DD for dates or YYYY-MM-DDTHH:mm:ss , YYYY-MM-DDTHH:mm:ssTZD (e.g., 1997-07-16T19:20:30+01:00) for combined dates and times. |
| Qt.SystemLocaleShortDate | short format used by the operating system . |
| Qt.SystemLocaleLongDate | long format used by the operating system . |
| Qt.DefaultLocaleShortDate | short format specified by the application's locale . |
| Qt.DefaultLocaleLongDate | long format used by the application's locale . |
| Qt.SystemLocaleDate | This enum value is deprecated. 使用 Qt.SystemLocaleShortDate instead (or Qt.SystemLocaleLongDate if you want long dates). |
| Qt.LocaleDate | This enum value is deprecated. 使用 Qt.DefaultLocaleShortDate instead (or Qt.DefaultLocaleLongDate if you want long dates). |
| Qt.LocalDate | This enum value is deprecated. 使用 Qt.SystemLocaleShortDate instead (or Qt.SystemLocaleLongDate if you want long dates). |
注意
For ISODate formats, each Y , M and D represents a single digit of the year, month and day used to specify the date. Each H , M and S represents a single digit of the hour, minute and second used to specify the time. The presence of a literal T character is used to separate the date and time when both are specified.
This enum is used in widgets that can display both plain text and rich text, e.g. PySide.QtGui.QLabel . It is used for deciding whether a text string should be interpreted as one or the other. This is normally done by passing one of the enum values to a setTextFormat() function.
| 常量 | 描述 |
|---|---|
| Qt.PlainText | 文本字符串被解释成纯文本字符串。 |
| Qt.RichText | The text string is interpreted as a rich text string. |
| Qt.AutoText | The text string is interpreted as for Qt.RichText if Qt.mightBeRichText() returns true, otherwise as Qt.PlainText . |
| Qt.LogText | A special, limited text format which is only used by Q3TextEdit in an optimized mode. |
This enum type defines the pen join styles supported by Qt, i.e. which joins between two connected lines can be drawn using PySide.QtGui.QPainter .
|
|
|
| Qt.BevelJoin | Qt.MiterJoin | Qt.RoundJoin |
| 常量 | 描述 |
|---|---|
| Qt.MiterJoin | The outer edges of the lines are extended to meet at an angle, and this area is filled. |
| Qt.BevelJoin | The triangular notch between the two lines is filled. |
| Qt.RoundJoin | A circular arc between the two lines is filled. |
| Qt.SvgMiterJoin | A miter join corresponding to the definition of a miter join in the SVG 1.2 Tiny specification. |
另请参阅
此枚举类型描述可以使用的额外标志,当订阅手势时。
| 常量 | 描述 |
|---|---|
| Qt.DontStartGestureOnChildren | 默认情况下,手势可以从 Widget 或其任何子级开始。使用此标志可禁用此并仅允许从 Widget 开始手势。 |
| Qt.ReceivePartialGestures | 允许将任何忽略手势事件传播给有指定此提示的父级 Widget。默认情况下,手势处于 Qt.GestureStarted 状态才被传播且 Widget 始终获取完整手势序列开始采用手势处于 Qt.GestureStarted 状态和结束采用手势处于 Qt.GestureFinished or Qt.GestureCanceled 状态。 |
| Qt.IgnoredGesturesPropagateToParent | 从 Qt 4.7 起,此标志允许微调手势事件传播。通过设置标志当 grabbing 手势全部忽略部分手势将传播给其父级项。 |
另请参阅
QWidget.grabGesture() QGraphicsObject.grabGesture()
注意
该枚举在 Qt 4.6 引入或被修改
| 常量 | 描述 |
|---|---|
| Qt.CaseInsensitive | |
| Qt.CaseSensitive |
此枚举可用于指定事件优先级。
| 常量 | 描述 |
|---|---|
| Qt.HighEventPriority | Events with this priority are sent before events with NormalEventPriority or LowEventPriority . |
| Qt.NormalEventPriority | Events with this priority are sent after events with HighEventPriority , but before events with LowEventPriority . |
| Qt.LowEventPriority | Events with this priority are sent after events with HighEventPriority or NormalEventPriority . |
Note that these values are provided purely for convenience, since event priorities can be any value between INT_MAX and INT_MIN , inclusive. For example, you can define custom priorities as being relative to each other:
<Code snippet "doc/src/snippets/code/doc_src_qnamespace.cpp:1" not found>
The options marked “(default)” are set if no other values from the list are included (since the defaults are zero):
彩色/单色首选 (被忽略对于 PySide.QtGui.QBitmap ):
| 常量 | 描述 |
|---|---|
| Qt.AutoColor | (默认) - 若图像有 PySide.QtGui.QImage.depth() 1 且只包含黑色和白色像素,像素图变为单色。 |
| Qt.ColorOnly | 像素图抖动/转换为 native display depth . |
| Qt.MonoOnly | 像素图变成单色。若有必要,使用所选抖动算法进行抖动。 |
Dithering mode preference for RGB channels:
| 常量 | 描述 |
|---|---|
| Qt.DiffuseDither | (default) - A high-quality dither. |
| Qt.OrderedDither | A faster, more ordered dither. |
| Qt.ThresholdDither | 没有抖动;使用最接近的颜色。 |
Dithering mode preference for alpha channel:
| 常量 | 描述 |
|---|---|
| Qt.ThresholdAlphaDither | (默认) - 没有抖动。 |
| Qt.OrderedAlphaDither | A faster, more ordered dither. |
| Qt.DiffuseAlphaDither | A high-quality dither. |
颜色匹配 vs 抖动偏好:
| 常量 | 描述 |
|---|---|
| Qt.PreferDither | (default when converting to a pixmap) - Always dither 32-bit images when the image is converted to 8 bits. |
| Qt.AvoidDither | (default when converting for the purpose of saving to file) - Dither 32-bit images only if the image has more than 256 colors and it is being converted to 8 bits. |
| Qt.NoOpaqueDetection | Do not check whether the image contains non-opaque pixels. Use this if you know that the image is semi-transparent and you want to avoid the overhead of checking the pixels in the image until a non-opaque pixel is found, or if you want the pixmap to retain an alpha channel for some other reason. If the image has no alpha channel this flag has no effect. |
Don't do any format conversions on the image. Can be useful when converting a PySide.QtGui.QImage 到 PySide.QtGui.QPixmap for a one-time rendering operation for example.
此枚举描述文本光标的可用移动样式。选项:
| 常量 | 描述 |
|---|---|
| Qt.LogicalMoveStyle | Within a left-to-right text block, decrease cursor position when pressing left arrow key, increase cursor position when pressing the right arrow key. If the text block is right-to-left, the opposite behavior applies. |
| Qt.VisualMoveStyle | Pressing the left arrow key will always cause the cursor to move left, regardless of the text's writing direction. Pressing the right arrow key will always cause the cursor to move right. |
注意
This enum was introduced or modified in Qt 4.8
此枚举类型描述手势的状态。
| 常量 | 描述 |
|---|---|
| Qt.GestureStarted | 连续手势已开始。 |
| Qt.GestureUpdated | 手势继续。 |
| Qt.GestureFinished | 手势已完成。 |
| Qt.GestureCanceled | 手势被取消。 |
注意
该枚举在 Qt 4.6 引入或被修改
背景模式:
| 常量 | 描述 |
|---|---|
| Qt.TransparentMode | |
| Qt.OpaqueMode |
此枚举描述可以用于信号和槽之间的连接类型。尤其,它确定是把特定信号立即交付给槽,还是在以后队列交付。
| 常量 | 描述 |
|---|---|
| Qt.AutoConnection | (default) If the signal is emitted from a different thread than the receiving object, the signal is queued, behaving as Qt.QueuedConnection . Otherwise, the slot is invoked directly, behaving as Qt.DirectConnection . The type of connection is determined when the signal is emitted. |
| Qt.DirectConnection | The slot is invoked immediately, when the signal is emitted. |
| Qt.QueuedConnection | 槽被援引当控制返回给接收者线程的事件循环时。槽在接收者线程中执行。 |
| Qt.BlockingQueuedConnection | 如同 QueuedConnection , except the current thread blocks until the slot returns. This connection type should only be used where the emitter and receiver are in different threads. 注意: Violating this rule can cause your application to deadlock. |
| Qt.UniqueConnection | 如同 AutoConnection , but the connection is made only if it does not duplicate an existing connection. i.e., if the same signal is already connected to the same slot for the same pair of objects, then the connection will fail. This connection type was introduced in Qt 4.6. |
| Qt.AutoCompatConnection | The default type when Qt 3 support is enabled. Same as AutoConnection but will also cause warnings to be output in certain situations. See Compatibility Signals and Slots for further information. |
采用队列连接,参数类型必须是 Qt 元对象系统知道的,因为 Qt 需要拷贝自变量以存储它们在幕后事件中。若试着队列排队连接并获得错误消息:
QObject::connect: Cannot queue arguments of type 'MyType'
调用 qRegisterMetaType() to register the data type before you establish the connection.
当使用信号和槽采用多个线程时,见 信号和槽跨线程 .
另请参阅
Qt 中的线程支持 QObject.connect() qRegisterMetaType() Q_DECLARE_METATYPE()
| 常量 | 描述 |
|---|---|
| Qt.LeftToolBarArea | |
| Qt.RightToolBarArea | |
| Qt.TopToolBarArea | |
| Qt.BottomToolBarArea | |
| Qt.AllToolBarAreas | |
| Qt.NoToolBarArea |
此枚举指定坐标系统。
| 常量 | 描述 |
|---|---|
| Qt.DeviceCoordinates | Coordinates are relative to the upper-left corner of the object's paint device. |
| Qt.LogicalCoordinates | Coordinates are relative to the upper-left corner of the object. |
注意
该枚举在 Qt 4.6 引入或被修改
此枚举用于 QPainter.drawRoundedRect() and QPainterPath.addRoundedRect() functions to specify the radii of rectangle corners with respect to the dimensions of the bounding rectangles specified.
| 常量 | 描述 |
|---|---|
| Qt.AbsoluteSize | 使用绝对度量指定尺寸。 |
| Qt.RelativeSize | 指定相对于边界矩形的尺寸,通常使用百分比度量。 |
This enum specifies why the focus changed. It will be passed through QWidget::setFocus and can be retrieved in the PySide.QtGui.QFocusEvent 被发送给 Widget 当聚焦改变时。
| 常量 | 描述 |
|---|---|
| Qt.MouseFocusReason | 发生鼠标动作。 |
| Qt.TabFocusReason | 按下 Tab 键。 |
| Qt.BacktabFocusReason | 发生 Backtab。输入可能包括 Shift 或 Control 键;如 Shift+Tab。 |
| Qt.ActiveWindowFocusReason | 窗口系统使此窗口活动或不活动。 |
| Qt.PopupFocusReason | 应用程序打开/关闭弹出窗口,抓取/释放键盘焦点。 |
| Qt.ShortcutFocusReason | 用户键入标签的好友快捷方式 |
| Qt.MenuBarFocusReason | 菜单栏获得聚焦。 |
| Qt.OtherFocusReason | 另一原因,通常特定于应用程序。 |
另请参阅
Keyboard Focus
This enum provides shorter names for the keyboard modifier keys supported by Qt.
注意
On Mac OS X, the CTRL value corresponds to the Command keys on the Macintosh keyboard, and the META value corresponds to the Control keys.
| 常量 | 描述 |
|---|---|
| Qt.SHIFT | The Shift keys provided on all standard keyboards. |
| Qt.META | Meta 键。 |
| Qt.CTRL | Ctrl 键。 |
| Qt.ALT | 正常 Alt 键,但不像 AltGr 键。 |
| Qt.UNICODE_ACCEL | The shortcut is specified as a Unicode code point, not as a Qt Key. |
另请参阅
Qt.KeyboardModifier Qt.MouseButton
此枚举描述在绘制时如何重复或拉伸图像部分。
| 常量 | 描述 |
|---|---|
| Qt.StretchTile | 比例缩放图像以拟合可用区域。 |
| Qt.RepeatTile | Repeat the image until there is no more space. May crop the last image. |
| Qt.RoundTile | Similar to Repeat, but scales the image down to ensure that the last tile is not cropped. |
注意
该枚举在 Qt 4.6 引入或被修改
This enum describes the types of whitespace mode that are used by the PySide.QtGui.QTextDocument class to meet the requirements of different kinds of textual information.
| 常量 | 描述 |
|---|---|
| Qt.WhiteSpaceNormal | The whitespace mode used to display normal word wrapped text in paragraphs. |
| Qt.WhiteSpacePre | A preformatted text mode in which whitespace is reproduced exactly. |
| Qt.WhiteSpaceNoWrap |
This enum is defined in the <QTextDocument> header file.
This enum type defines what happens to the aspect ratio when scaling an rectangle.
| 常量 | 描述 |
|---|---|
| Qt.IgnoreAspectRatio | The size is scaled freely. The aspect ratio is not preserved. |
| Qt.KeepAspectRatio | The size is scaled to a rectangle as large as possible inside a given rectangle, preserving the aspect ratio. |
| Qt.KeepAspectRatioByExpanding | The size is scaled to a rectangle as small as possible outside a given rectangle, preserving the aspect ratio. |
另请参阅
QSize.scale() QImage.scaled()
此枚举用于 QGraphicsLayoutItem.sizeHint()
| 常量 | 描述 |
|---|---|
| Qt.MinimumSize | 用于指定图形布局项的最小尺寸。 |
| Qt.PreferredSize | 用于指定图形布局项的首选尺寸。 |
| Qt.MaximumSize | 用于指定图形布局项的最大尺寸。 |
| Qt.MinimumDescent | 用于指定图形布局项中文本字符串的最小下降。 |
另请参阅
QGraphicsLayoutItem.sizeHint()
This enum type is used to describe alignment. It contains horizontal and vertical flags that can be combined to produce the required effect.
Qt.TextElideMode enum can also be used in many situations to fine-tune the appearance of aligned text.
水平标志:
| 常量 | 描述 |
|---|---|
| Qt.AlignLeft | 与左边缘对齐。 |
| Qt.AlignRight | 与右边缘对齐。 |
| Qt.AlignHCenter | 在可用空间水平居中。 |
| Qt.AlignJustify | 在可用空间两端对齐文本。 |
垂直标志:
| 常量 | 描述 |
|---|---|
| Qt.AlignTop | 与顶部对齐。 |
| Qt.AlignBottom | 与底部对齐。 |
| Qt.AlignVCenter | 在可用空间垂直居中。 |
每次只可使用一水平标志。有一个二维标志:
| 常量 | 描述 |
|---|---|
| Qt.AlignCenter | 在两个维度上居中。 |
You can use at most one horizontal and one vertical flag at a time. Qt.AlignCenter counts as both horizontal and vertical.
Three enum values are useful in applications that can be run in right-to-left mode:
| 常量 | 描述 |
|---|---|
| Qt.AlignAbsolute | If the widget's layout direction is Qt.RightToLeft (instead of Qt.LeftToRight , the default), Qt.AlignLeft refers to the right edge and Qt.AlignRight 到 left edge. This is normally the desired behavior. If you want Qt.AlignLeft to always mean “left” and Qt.AlignRight to always mean “right”, combine the flag with Qt.AlignAbsolute . |
| Qt.AlignLeading | 同义词为 Qt.AlignLeft . |
| Qt.AlignTrailing | 同义词为 Qt.AlignRight . |
掩码:
| 常量 | 描述 |
|---|---|
| Qt.AlignHorizontal_Mask | |
| Qt.AlignVertical_Mask |
Conflicting combinations of flags have undefined meanings.
此枚举类型定义 Widget 在展示上下文菜单方面可以采用的各种策略。
| 常量 | 描述 |
|---|---|
| Qt.NoContextMenu | Widget 不提供上下文菜单,上下文菜单的处理被延期到 Widget 的父级。 |
| Qt.PreventContextMenu | Widget 不提供上下文菜单,且相比 NoContextMenu ,处理 not deferred to the widget's parent. This means that all right mouse button events are guaranteed to be delivered to the widget itself through mousePressEvent(), and mouseReleaseEvent(). |
| Qt.DefaultContextMenu | Widget 的 QWidget.contextMenuEvent() handler is called. |
| Qt.ActionsContextMenu | Widget 显示其 QWidget.actions() as context menu. |
| Qt.CustomContextMenu | Widget 发射 QWidget.customContextMenuRequested() 信号。 |
| 常量 | 描述 |
|---|---|
| Qt.LeftDockWidgetArea | |
| Qt.RightDockWidgetArea | |
| Qt.TopDockWidgetArea | |
| Qt.BottomDockWidgetArea | |
| Qt.AllDockWidgetAreas | |
| Qt.NoDockWidgetArea |
此枚举描述可用 UI 效果。
By default, Qt will try to use the platform specific desktop settings for each effect. Use the QApplication.setDesktopSettingsAware() function (passing false as argument) to prevent this, and the QApplication.setEffectEnabled() to enable or disable a particular effect.
Note that all effects are disabled on screens running at less than 16-bit color depth.
| 常量 | 描述 |
|---|---|
| Qt.UI_AnimateMenu | 展示动画菜单。 |
| Qt.UI_FadeMenu | 展示褪色菜单。 |
| Qt.UI_AnimateCombo | Show animated comboboxes. |
| Qt.UI_AnimateTooltip | Show tooltip animations. |
| Qt.UI_FadeTooltip | Show tooltip fading effects. |
| Qt.UI_AnimateToolBox | Reserved |
另请参阅
QApplication.setEffectEnabled() QApplication.setDesktopSettingsAware()
Specifies a side of a layout item that can be anchored. This is used by PySide.QtGui.QGraphicsAnchorLayout .
| 常量 | 描述 |
|---|---|
| Qt.AnchorLeft | The left side of a layout item. |
| Qt.AnchorHorizontalCenter | A “virtual” side that is centered between the left and the right side of a layout item. |
| Qt.AnchorRight | The right side of a layout item. |
| Qt.AnchorTop | The top side of a layout item. |
| Qt.AnchorVerticalCenter | A “virtual” side that is centered between the top and the bottom side of a layout item. |
| Qt.AnchorBottom | The bottom side of a layout item. |
注意
该枚举在 Qt 4.6 引入或被修改
Qt 的预定义 PySide.QtGui.QColor 对象:
| 常量 | 描述 |
|---|---|
| Qt.white | UnknownCommand{id=”color-white”} {White (#ffffff) } |
| Qt.black | UnknownCommand{id=”color-black”} {Black (#000000) } |
| Qt.red | UnknownCommand{id=”color-red”} {Red (#ff0000) } |
| Qt.darkRed | UnknownCommand{id=”color- darkRed “} {Dark red (#800000) } |
| Qt.green | UnknownCommand{id=”color-green”} {Green (#00ff00) } |
| Qt.darkGreen | UnknownCommand{id=”color- darkGreen “} {Dark green (#008000) } |
| Qt.blue | UnknownCommand{id=”color-blue”} {Blue (#0000ff) } |
| Qt.darkBlue | UnknownCommand{id=”color- darkBlue “} {Dark blue (#000080) } |
| Qt.cyan | UnknownCommand{id=”color-cyan”} {Cyan (#00ffff) } |
| Qt.darkCyan | UnknownCommand{id=”color- darkCyan “} {Dark cyan (#008080) } |
| Qt.magenta | UnknownCommand{id=”color-magenta”} {Magenta (#ff00ff) } |
| Qt.darkMagenta | UnknownCommand{id=”color- darkMagenta “} {Dark magenta (#800080) } |
| Qt.yellow | UnknownCommand{id=”color-yellow”} {Yellow (#ffff00) } |
| Qt.darkYellow | UnknownCommand{id=”color- darkYellow “} {Dark yellow (#808000) } |
| Qt.gray | UnknownCommand{id=”color-gray”} {Gray (#a0a0a4) } |
| Qt.darkGray | UnknownCommand{id=”color- darkGray “} {Dark gray (#808080) } |
| Qt.lightGray | UnknownCommand{id=”color- lightGray “} {Light gray (#c0c0c0) } |
| Qt.transparent | 透明黑色值 (即, PySide.QtGui.QColor (0, 0, 0, 0)) |
| Qt.color0 | 0 像素值 (用于位图) |
| Qt.color1 | 1 像素值 (用于位图) |
另请参阅
此枚举描述修饰符键。
| 常量 | 描述 |
|---|---|
| Qt.NoModifier | 未按下修饰符键。 |
| Qt.ShiftModifier | 按下键盘 Shift 键。 |
| Qt.ControlModifier | 按下键盘 Ctrl 键。 |
| Qt.AltModifier | 按下键盘 Alt 键。 |
| Qt.MetaModifier | 按下键盘 Meta 键。 |
| Qt.KeypadModifier | 按下 Keypad (小键盘) 按钮。 |
| Qt.GroupSwitchModifier | X11 only. A Mode_switch key on the keyboard is pressed. |
注意
On Mac OS X, the ControlModifier value corresponds to the Command keys on the Macintosh keyboard, and the MetaModifier 值相当于 Control 键。 KeypadModifier 值也将在按下方向键时设置,因为方向键被认为是 Keypad (小键盘) 的一部分。
注意
On Windows Keyboards, Qt.MetaModifier and Qt.Key_Meta 被映射到 Windows 键。
另请参阅
Qt.MouseButton Qt.Modifier
此枚举类型描述移动聚焦的模式。
| 常量 | 描述 |
|---|---|
| Qt.NavigationModeNone | 仅用于触摸屏。 |
| Qt.NavigationModeKeypadTabOrder | Qt.Key_Up and Qt.Key_Down are used to change focus. |
| Qt.NavigationModeKeypadDirectional | Qt.Key_Up , Qt.Key_Down , Qt.Key_Left and Qt.Key_Right are used to change focus. |
| Qt.NavigationModeCursorAuto | The mouse cursor is used to change focus, it is displayed only on non touchscreen devices. The keypad is used to implement a virtual cursor, unless the device has an analog mouse type of input device (e.g. touchpad). This is the recommended setting for an application such as a web browser that needs pointer control on both touch and non-touch devices. |
| Qt.NavigationModeCursorForceVisible | The mouse cursor is used to change focus, it is displayed regardless of device type. The keypad is used to implement a virtual cursor, unless the device has an analog mouse type of input device (e.g. touchpad) |
注意
: in 4.6, cursor navigation is only implemented for Symbian OS. On other platforms, it behaves as NavigationModeNone .
另请参阅
QApplication.setNavigationMode() QApplication.navigationMode()
注意
该枚举在 Qt 4.6 引入或被修改
模型中每项拥有一组与之关联的数据元素,每数据元素带有其自己的角色。视图使用角色来指示模型,其需要哪种数据类型。自定义模型应该返回这些类型的数据。
一般用途的角色 (和关联的类型):
| 常量 | 描述 |
|---|---|
| Qt.DisplayRole | 要以文本形式渲染的关键数据。( PySide.QtCore.QString ) |
| Qt.DecorationRole | 以图标形式被渲染作为装饰的数据。( PySide.QtGui.QColor , PySide.QtGui.QIcon or PySide.QtGui.QPixmap ) |
| Qt.EditRole | 采用适合于在编辑器中编辑的形式的数据。( PySide.QtCore.QString ) |
| Qt.ToolTipRole | 被显示在项工具提示中的数据。( PySide.QtCore.QString ) |
| Qt.StatusTipRole | 被显示在状态栏中的数据。( PySide.QtCore.QString ) |
| Qt.WhatsThisRole | The data displayed for the item in “What's This?” mode. ( PySide.QtCore.QString ) |
| Qt.SizeHintRole | 会被提供给视图的项尺寸提示。( PySide.QtCore.QSize ) |
描述外观和元数据的角色 (与关联类型):
| 常量 | 描述 |
|---|---|
| Qt.FontRole | 用于采用默认委托渲染项的字体。( PySide.QtGui.QFont ) |
| Qt.TextAlignmentRole | 采用默认委托渲染项的文本对齐方式。( Qt.AlignmentFlag ) |
| Qt.BackgroundRole | 用于采用默认委托渲染项的背景笔刷。( PySide.QtGui.QBrush ) |
| Qt.BackgroundColorRole | This role is obsolete. Use BackgroundRole 代替。 |
| Qt.ForegroundRole | 用于采用默认委托渲染项的前景笔刷 (文本颜色,通常)。( PySide.QtGui.QBrush ) |
| Qt.TextColorRole | This role is obsolete. Use ForegroundRole 代替。 |
| Qt.CheckStateRole | 此角色被用于获取项的被复选状态。( Qt.CheckState ) |
| Qt.InitialSortOrderRole | 此角色被用于获取 Header 头视图区间的初始排序次序。( Qt.SortOrder )。此角色在 Qt 4.8 引入。 |
可访问性角色 (与关联类型):
| 常量 | 描述 |
|---|---|
| Qt.AccessibleTextRole | 要被用于可访问性扩展和插件 (如:屏幕阅读器) 的文本。( PySide.QtCore.QString ) |
| Qt.AccessibleDescriptionRole | 用于可访问性目的的项描述。( PySide.QtCore.QString ) |
用户角色:
| 常量 | 描述 |
|---|---|
| Qt.UserRole | 可以被用于特定应用程序目的的第一角色。 |
对于用户角色,由开发者决定要使用哪种类型,并确保组件使用正确类型,当访问和设置数据时。
This enum type describes the various modes of PySide.QtGui.QAbstractScrollArea ‘s scroll bars.
| 常量 | 描述 |
|---|---|
| Qt.ScrollBarAsNeeded | PySide.QtGui.QAbstractScrollArea shows a scroll bar when the content is too large to fit and not otherwise. This is the default. |
| Qt.ScrollBarAlwaysOff | PySide.QtGui.QAbstractScrollArea never shows a scroll bar. |
| Qt.ScrollBarAlwaysOn | PySide.QtGui.QAbstractScrollArea always shows a scroll bar. |
(The modes for the horizontal and vertical scroll bars are independent.)
| 常量 | 描述 |
|---|---|
| Qt.ImhNone | 没有提示。 |
更改行为的标志:
| 常量 | 描述 |
|---|---|
| Qt.ImhHiddenText | Characters should be hidden, as is typically used when entering passwords. This is automatically set when setting QLineEdit.echoMode to Password . |
| Qt.ImhNoAutoUppercase | 输入法不应该试着自动切换到大写当句子结束时。 |
| Qt.ImhPreferNumbers | 数字是首选的 (但不是必需的)。 |
| Qt.ImhPreferUppercase | 大写字母是首选的 (但不是必需的)。 |
| Qt.ImhPreferLowercase | 小写字母是首选的 (但不是必需的)。 |
| Qt.ImhNoPredictiveText | 键入时不使用预测文本 (即:查找字典)。 |
限定输入的标志 (排斥标志):
| 常量 | 描述 |
|---|---|
| Qt.ImhDigitsOnly | 只允许数字。 |
| Qt.ImhFormattedNumbersOnly | 只允许输入数字。这包括小数点和负号。 |
| Qt.ImhUppercaseOnly | 只允许输入大写字母。 |
| Qt.ImhLowercaseOnly | 只允许输入小写字母。 |
| Qt.ImhDialableCharactersOnly | Only characters suitable for phone dialling are allowed. |
| Qt.ImhEmailCharactersOnly | 只允许适合 Email 地址的字符。 |
| Qt.ImhUrlCharactersOnly | 只允许适合 URL 的字符。 |
掩码:
| 常量 | 描述 |
|---|---|
| Qt.ImhExclusiveInputMask | 此掩码产生非 0 若使用任何排斥标志。 |
注意
If several exclusive flags are ORed together, the resulting character set will consist of the union of the specified sets. For instance specifying ImhNumbersOnly and ImhUppercaseOnly would yield a set consisting of numbers and uppercase letters.
另请参阅
QGraphicsItem.inputMethodHints()
注意
该枚举在 Qt 4.6 引入或被修改
An anchor has one or more of the following attributes:
| 常量 | 描述 |
|---|---|
| Qt.AnchorName | the name attribute of the anchor. This attribute is used when scrolling to an anchor in the document. |
| Qt.AnchorHref | the href attribute of the anchor. This attribute is used when a link is clicked to determine what content to load. |
This enum specifies the behavior of a modal window. A modal window is one that blocks input to other windows. Note that windows that are children of a modal window are not blocked.
The values are:
| 常量 | 描述 |
|---|---|
| Qt.NonModal | The window is not modal and does not block input to other windows. |
| Qt.WindowModal | The window is modal to a single window hierarchy and blocks input to its parent window, all grandparent windows, and all siblings of its parent and grandparent windows. |
| Qt.ApplicationModal | The window is modal to the application and blocks input to all windows. |
另请参阅
QWidget.windowModality PySide.QtGui.QDialog
此枚举描述如何排序 Widget 中的项是的。
| 常量 | 描述 |
|---|---|
| Qt.AscendingOrder | The items are sorted ascending e.g. starts with ‘AAA' ends with ‘ZZZ' in Latin-1 locales |
| Qt.DescendingOrder | The items are sorted descending e.g. starts with ‘ZZZ' ends with ‘AAA' in Latin-1 locales |
This enum type defines the pen styles that can be drawn using PySide.QtGui.QPainter . The styles are:
|
|
|
| Qt.SolidLine | Qt.DashLine | Qt.DotLine |
|
|
|
| Qt.DashDotLine | Qt.DashDotDotLine | Qt.CustomDashLine |
| 常量 | 描述 |
|---|---|
| Qt.NoPen | no line at all. For example, QPainter.drawRect() fills but does not draw any boundary line. |
| Qt.SolidLine | A plain line. |
| Qt.DashLine | Dashes separated by a few pixels. |
| Qt.DotLine | Dots separated by a few pixels. |
| Qt.DashDotLine | Alternate dots and dashes. |
| Qt.DashDotDotLine | One dash, two dots, one dash, two dots. |
| Qt.CustomDashLine | A custom pattern defined using QPainterPathStroker.setDashPattern() . |
另请参阅
此枚举描述项的特性:
| 常量 | 描述 |
|---|---|
| Qt.NoItemFlags | 它没有设置任何特性。 |
| Qt.ItemIsSelectable | 它可以被选中。 |
| Qt.ItemIsEditable | 它可以被编辑。 |
| Qt.ItemIsDragEnabled | 可以拖曳它。 |
| Qt.ItemIsDropEnabled | 可以将它用作掉落目标。 |
| Qt.ItemIsUserCheckable | 它可以被用户复选 (或取消复选)。 |
| Qt.ItemIsEnabled | 用户可以与项交互。 |
| Qt.ItemIsTristate | The item is checkable with three separate states. |
Note that checkable items need to be given both a suitable set of flags and an initial state, indicating whether the item is checked or not. This is handled automatically for model/view components, but needs to be explicitly set for instances of PySide.QtGui.QListWidgetItem , PySide.QtGui.QTableWidgetItem ,和 PySide.QtGui.QTreeWidgetItem .
This enum type defines three values to represent the three axes in the cartesian coordinate system.
| 常量 | 描述 |
|---|---|
| Qt.XAxis | The X axis. |
| Qt.YAxis | The Y axis. |
| Qt.ZAxis | The Z axis. |
另请参阅
QTransform.rotate() QTransform.rotateRadians()
此枚举类型定义图像变换 (如比例缩放) 是否应该平滑。
| 常量 | 描述 |
|---|---|
| Qt.FastTransformation | 变换被快速履行,不进行平滑处理。 |
| Qt.SmoothTransformation | 使用双线性过滤,变换结果图像。 |
另请参阅
QImage.scaled()
This enum is used to describe parts of a window frame. It is returned by QGraphicsWidget.windowFrameSectionAt() to describe what section of the window frame is under the mouse.
| 常量 | 描述 |
|---|---|
| Qt.NoSection | |
| Qt.LeftSection | |
| Qt.TopLeftSection | |
| Qt.TopSection | |
| Qt.TopRightSection | |
| Qt.RightSection | |
| Qt.BottomRightSection | |
| Qt.BottomSection | |
| Qt.BottomLeftSection | |
| Qt.TitleBarArea |
另请参阅
QGraphicsWidget.windowFrameEvent() QGraphicsWidget.paintWindowFrame() QGraphicsWidget.windowFrameSectionAt()
This enum contains the types of accuracy that can be used by the PySide.QtGui.QTextDocument class when testing for mouse clicks on text documents.
| 常量 | 描述 |
|---|---|
| Qt.ExactHit | The point at which input occurred must coincide exactly with input-sensitive parts of the document. |
| Qt.FuzzyHit | The point at which input occurred can lie close to input-sensitive parts of the document. |
This enum is defined in the <QTextDocument> header file.
此枚举类型定义可以使用的各种光标。
标准箭头光标是处于正常状态的 Widget 的默认值。
| 常量 | 描述 |
|---|---|
| Qt.ArrowCursor |
|
| Qt.UpArrowCursor |
|
| Qt.CrossCursor |
|
| Qt.WaitCursor |
|
| Qt.IBeamCursor |
|
| Qt.SizeVerCursor |
|
| Qt.SizeHorCursor |
|
| Qt.SizeBDiagCursor |
|
| Qt.SizeFDiagCursor |
|
| Qt.SizeAllCursor |
|
| Qt.BlankCursor | A blank/invisible cursor, typically used when the cursor shape needs to be hidden. |
| Qt.SplitVCursor |
|
| Qt.SplitHCursor |
|
| Qt.PointingHandCursor |
|
| Qt.ForbiddenCursor |
|
| Qt.OpenHandCursor |
|
| Qt.ClosedHandCursor |
|
| Qt.WhatsThisCursor |
|
| Qt.BusyCursor |
|
| Qt.DragMoveCursor | 通常使用的光标当拖曳项时。 |
| Qt.DragCopyCursor | A cursor that is usually used when dragging an item to copy it. |
| Qt.DragLinkCursor | A cursor that is usually used when dragging an item to make a link to it. |
| Qt.BitmapCursor |
This enum is used in PySide.QtGui.QGraphicsItem , PySide.QtGui.QGraphicsScene and PySide.QtGui.QGraphicsView to specify how items are selected, or how to determine if a shapes and items collide.
| 常量 | 描述 |
|---|---|
| Qt.ContainsItemShape | The output list contains only items whose PySide.QtGui.QGraphicsItem.shape() is fully contained inside the selection area. Items that intersect with the area's outline are not included. |
| Qt.IntersectsItemShape | The output list contains both items whose PySide.QtGui.QGraphicsItem.shape() is fully contained inside the selection area, and items that intersect with the area's outline. This is a common mode for rubber band selection. |
| Qt.ContainsItemBoundingRect | The output list contains only items whose bounding rectangle is fully contained inside the selection area. Items that intersect with the area's outline are not included. |
| Qt.IntersectsItemBoundingRect | The output list contains both items whose bounding rectangle is fully contained inside the selection area, and items that intersect with the area's outline. This method is commonly used for determining areas that need redrawing. |
另请参阅
QGraphicsScene.items() QGraphicsScene.collidingItems() QGraphicsView.items() QGraphicsItem.collidesWithItem() QGraphicsItem.collidesWithPath()
此类型用于表示对象的取向。
| 常量 | 描述 |
|---|---|
| Qt.Horizontal | |
| Qt.Vertical |
取向被用于 PySide.QtGui.QScrollBar 例如。
| 常量 | 描述 |
|---|---|
| Qt.ImMicroFocus | 在 Widget 坐标中覆盖输入光标区域的矩形。 |
| Qt.ImFont | 目前文本输入使用的字体。 |
| Qt.ImCursorPosition | 在环绕输入区域文本中的光标逻辑位置 (见 ImSurroundingText ). |
| Qt.ImSurroundingText | 输入区域周围的纯文本,例如:当前段落。 |
| Qt.ImCurrentSelection | 目前选中的文本。 |
| Qt.ImMaximumTextLength | The maximum number of characters that the widget can hold. If there is no limit, QVariant() 被返回。 |
| Qt.ImAnchorPosition | The position of the selection anchor. This may be less or greater than ImCursorPosition , depending on which side of selection the cursor is. If there is no selection, it returns the same as ImCursorPosition . |
| 常量 | 描述 |
|---|---|
| Qt.LocalTime | Locale dependent time (Timezones and Daylight Savings Time). |
| Qt.UTC | Coordinated Universal Time, replaces Greenwich Mean Time. |
| Qt.OffsetFromUTC | An offset in seconds from Coordinated Universal Time. |
| 常量 | 描述 |
|---|---|
| Qt.NoArrow | |
| Qt.UpArrow | |
| Qt.DownArrow | |
| Qt.LeftArrow | |
| Qt.RightArrow |
指定应该使用哪种方法来填充路径和多边形。
| 常量 | 描述 |
|---|---|
| Qt.OddEvenFill | Specifies that the region is filled using the odd even fill rule. With this rule, we determine whether a point is inside the shape by using the following method. Draw a horizontal line from the point to a location outside the shape, and count the number of intersections. If the number of intersections is an odd number, the point is inside the shape. This mode is the default. |
| Qt.WindingFill | Specifies that the region is filled using the non zero winding rule. With this rule, we determine whether a point is inside the shape by using the following method. Draw a horizontal line from the point to a location outside the shape. Determine whether the direction of the line at each intersection point is up or down. The winding number is determined by summing the direction of each intersection. If the number is non zero, the point is inside the shape. This fill mode can also in most cases be considered as the intersection of closed shapes. |
This enum specifies the behavior of the QPixmap.createMaskFromColor() and QImage.createMaskFromColor() 函数。
| 常量 | 描述 |
|---|---|
| Qt.MaskInColor | Creates a mask where all pixels matching the given color are opaque. |
| Qt.MaskOutColor | Creates a mask where all pixels matching the given color are transparent. |
此枚举类型用于指定顶层窗口的当前状态。
状态是
| 常量 | 描述 |
|---|---|
| Qt.WindowNoState | 窗口未设置状态 (在正常状态)。 |
| Qt.WindowMinimized | 窗口被最小化 (即:图标化)。 |
| Qt.WindowMaximized | 窗户被最大化,采用框架围绕它。 |
| Qt.WindowFullScreen | 窗口填充整个屏幕,没有任何框架围绕它。 |
| Qt.WindowActive | 窗口是活动窗口,即:它拥有键盘聚焦。 |
此枚举类型指定矩形角落:
| 常量 | 描述 |
|---|---|
| Qt.TopLeftCorner | 矩形的左上角。 |
| Qt.TopRightCorner | 矩形的右上角。 |
| Qt.BottomLeftCorner | 矩形的左下角。 |
| Qt.BottomRightCorner | 矩形的右下角。 |
| 常量 | 描述 |
|---|---|
| Qt.Monday | |
| Qt.Tuesday | |
| Qt.Wednesday | |
| Qt.Thursday | |
| Qt.Friday | |
| Qt.Saturday | |
| Qt.Sunday |
| 常量 | 描述 |
|---|---|
| Qt.NoClip | 此操作关闭剪辑。 |
| Qt.ReplaceClip | Replaces the current clip path/rect/region with the one supplied in the function call. |
| Qt.IntersectClip | Intersects the current clip path/rect/region with the one supplied in the function call. |
| Qt.UniteClip | Unites the current clip path/rect/region with the one supplied in the function call. |
指定 Qt 布局和文本处理的方向。
| 常量 | 描述 |
|---|---|
| Qt.LeftToRight | 从左到右布局。 |
| Qt.RightToLeft | 从右到左布局。 |
| Qt.LayoutDirectionAuto | 自动布局。 |
Right-to-left layouts are necessary for certain languages, notably Arabic and Hebrew.
LayoutDirectionAuto serves two purposes. When used in conjunction with widgets and layouts, it will imply to use the layout direction set on the parent widget or PySide.QtGui.QApplication . This has the same effect as QWidget.unsetLayoutDirection() .
当 LayoutDirectionAuto is used in conjunction with text layouting, it will imply that the text directionality is determined from the content of the string to be layouted.
另请参阅
QApplication.setLayoutDirection() QWidget.setLayoutDirection() QTextOption.setTextDirection() QString.isRightToLeft()
The style of the tool button, describing how the button's text and icon should be displayed.
| 常量 | 描述 |
|---|---|
| Qt.ToolButtonIconOnly | 只显示图标。 |
| Qt.ToolButtonTextOnly | 只显示文本。 |
| Qt.ToolButtonTextBesideIcon | The text appears beside the icon. |
| Qt.ToolButtonTextUnderIcon | The text appears under the icon. |
| Qt.ToolButtonFollowStyle | Follow the style . |
Qt 使用的键名。
| 常量 | 描述 |
|---|---|
| Qt.Key_Escape | |
| Qt.Key_Tab | |
| Qt.Key_Backtab | |
| Qt.Key_Backspace | |
| Qt.Key_Return | |
| Qt.Key_Enter | 通常位于 Keypad (小键盘) 上。 |
| Qt.Key_Insert | |
| Qt.Key_Delete | |
| Qt.Key_Pause | Pause/Break 键 ( 注意: Not anything to do with pausing media) |
| Qt.Key_Print | |
| Qt.Key_SysReq | |
| Qt.Key_Clear | |
| Qt.Key_Home | |
| Qt.Key_End | |
| Qt.Key_Left | |
| Qt.Key_Up | |
| Qt.Key_Right | |
| Qt.Key_Down | |
| Qt.Key_PageUp | |
| Qt.Key_PageDown | |
| Qt.Key_Shift | |
| Qt.Key_Control | On Mac OS X, this corresponds to the Command keys. |
| Qt.Key_Meta | On Mac OS X, this corresponds to the Control keys. On Windows keyboards, this key is mapped to the Windows key. |
| Qt.Key_Alt | |
| Qt.Key_AltGr | 在 Windows 发送此键的 KeyDown 事件时,还会设置 Ctrl+Alt 修饰符。 |
| Qt.Key_CapsLock | |
| Qt.Key_NumLock | |
| Qt.Key_ScrollLock | |
| Qt.Key_F1 | |
| Qt.Key_F2 | |
| Qt.Key_F3 | |
| Qt.Key_F4 | |
| Qt.Key_F5 | |
| Qt.Key_F6 | |
| Qt.Key_F7 | |
| Qt.Key_F8 | |
| Qt.Key_F9 | |
| Qt.Key_F10 | |
| Qt.Key_F11 | |
| Qt.Key_F12 | |
| Qt.Key_F13 | |
| Qt.Key_F14 | |
| Qt.Key_F15 | |
| Qt.Key_F16 | |
| Qt.Key_F17 | |
| Qt.Key_F18 | |
| Qt.Key_F19 | |
| Qt.Key_F20 | |
| Qt.Key_F21 | |
| Qt.Key_F22 | |
| Qt.Key_F23 | |
| Qt.Key_F24 | |
| Qt.Key_F25 | |
| Qt.Key_F26 | |
| Qt.Key_F27 | |
| Qt.Key_F28 | |
| Qt.Key_F29 | |
| Qt.Key_F30 | |
| Qt.Key_F31 | |
| Qt.Key_F32 | |
| Qt.Key_F33 | |
| Qt.Key_F34 | |
| Qt.Key_F35 | |
| Qt.Key_Super_L | |
| Qt.Key_Super_R | |
| Qt.Key_Menu | |
| Qt.Key_Hyper_L | |
| Qt.Key_Hyper_R | |
| Qt.Key_Help | |
| Qt.Key_Direction_L | |
| Qt.Key_Direction_R | |
| Qt.Key_Space | |
| Qt.Key_Any | |
| Qt.Key_Exclam | |
| Qt.Key_QuoteDbl | |
| Qt.Key_NumberSign | |
| Qt.Key_Dollar | |
| Qt.Key_Percent | |
| Qt.Key_Ampersand | |
| Qt.Key_Apostrophe | |
| Qt.Key_ParenLeft | |
| Qt.Key_ParenRight | |
| Qt.Key_Asterisk | |
| Qt.Key_Plus | |
| Qt.Key_Comma | |
| Qt.Key_Minus | |
| Qt.Key_Period | |
| Qt.Key_Slash | |
| Qt.Key_0 | |
| Qt.Key_1 | |
| Qt.Key_2 | |
| Qt.Key_3 | |
| Qt.Key_4 | |
| Qt.Key_5 | |
| Qt.Key_6 | |
| Qt.Key_7 | |
| Qt.Key_8 | |
| Qt.Key_9 | |
| Qt.Key_Colon | |
| Qt.Key_Semicolon | |
| Qt.Key_Less | |
| Qt.Key_Equal | |
| Qt.Key_Greater | |
| Qt.Key_Question | |
| Qt.Key_At | |
| Qt.Key_A | |
| Qt.Key_B | |
| Qt.Key_C | |
| Qt.Key_D | |
| Qt.Key_E | |
| Qt.Key_F | |
| Qt.Key_G | |
| Qt.Key_H | |
| Qt.Key_I | |
| Qt.Key_J | |
| Qt.Key_K | |
| Qt.Key_L | |
| Qt.Key_M | |
| Qt.Key_N | |
| Qt.Key_O | |
| Qt.Key_P | |
| Qt.Key_Q | |
| Qt.Key_R | |
| Qt.Key_S | |
| Qt.Key_T | |
| Qt.Key_U | |
| Qt.Key_V | |
| Qt.Key_W | |
| Qt.Key_X | |
| Qt.Key_Y | |
| Qt.Key_Z | |
| Qt.Key_BracketLeft | |
| Qt.Key_Backslash | |
| Qt.Key_BracketRight | |
| Qt.Key_AsciiCircum | |
| Qt.Key_Underscore | |
| Qt.Key_QuoteLeft | |
| Qt.Key_BraceLeft | |
| Qt.Key_Bar | |
| Qt.Key_BraceRight | |
| Qt.Key_AsciiTilde | |
| Qt.Key_nobreakspace | |
| Qt.Key_exclamdown | |
| Qt.Key_cent | |
| Qt.Key_sterling | |
| Qt.Key_currency | |
| Qt.Key_yen | |
| Qt.Key_brokenbar | |
| Qt.Key_section | |
| Qt.Key_diaeresis | |
| Qt.Key_copyright | |
| Qt.Key_ordfeminine | |
| Qt.Key_guillemotleft | |
| Qt.Key_notsign | |
| Qt.Key_hyphen | |
| Qt.Key_registered | |
| Qt.Key_macron | |
| Qt.Key_degree | |
| Qt.Key_plusminus | |
| Qt.Key_twosuperior | |
| Qt.Key_threesuperior | |
| Qt.Key_acute | |
| Qt.Key_mu | |
| Qt.Key_paragraph | |
| Qt.Key_periodcentered | |
| Qt.Key_cedilla | |
| Qt.Key_onesuperior | |
| Qt.Key_masculine | |
| Qt.Key_guillemotright | |
| Qt.Key_onequarter | |
| Qt.Key_onehalf | |
| Qt.Key_threequarters | |
| Qt.Key_questiondown | |
| Qt.Key_Agrave | |
| Qt.Key_Aacute | |
| Qt.Key_Acircumflex | |
| Qt.Key_Atilde | |
| Qt.Key_Adiaeresis | |
| Qt.Key_Aring | |
| Qt.Key_AE | |
| Qt.Key_Ccedilla | |
| Qt.Key_Egrave | |
| Qt.Key_Eacute | |
| Qt.Key_Ecircumflex | |
| Qt.Key_Ediaeresis | |
| Qt.Key_Igrave | |
| Qt.Key_Iacute | |
| Qt.Key_Icircumflex | |
| Qt.Key_Idiaeresis | |
| Qt.Key_ETH | |
| Qt.Key_Ntilde | |
| Qt.Key_Ograve | |
| Qt.Key_Oacute | |
| Qt.Key_Ocircumflex | |
| Qt.Key_Otilde | |
| Qt.Key_Odiaeresis | |
| Qt.Key_multiply | |
| Qt.Key_Ooblique | |
| Qt.Key_Ugrave | |
| Qt.Key_Uacute | |
| Qt.Key_Ucircumflex | |
| Qt.Key_Udiaeresis | |
| Qt.Key_Yacute | |
| Qt.Key_THORN | |
| Qt.Key_ssharp | |
| Qt.Key_division | |
| Qt.Key_ydiaeresis | |
| Qt.Key_Multi_key | |
| Qt.Key_Codeinput | |
| Qt.Key_SingleCandidate | |
| Qt.Key_MultipleCandidate | |
| Qt.Key_PreviousCandidate | |
| Qt.Key_Mode_switch | |
| Qt.Key_Kanji | |
| Qt.Key_Muhenkan | |
| Qt.Key_Henkan | |
| Qt.Key_Romaji | |
| Qt.Key_Hiragana | |
| Qt.Key_Katakana | |
| Qt.Key_Hiragana_Katakana | |
| Qt.Key_Zenkaku | |
| Qt.Key_Hankaku | |
| Qt.Key_Zenkaku_Hankaku | |
| Qt.Key_Touroku | |
| Qt.Key_Massyo | |
| Qt.Key_Kana_Lock | |
| Qt.Key_Kana_Shift | |
| Qt.Key_Eisu_Shift | |
| Qt.Key_Eisu_toggle | |
| Qt.Key_Hangul | |
| Qt.Key_Hangul_Start | |
| Qt.Key_Hangul_End | |
| Qt.Key_Hangul_Hanja | |
| Qt.Key_Hangul_Jamo | |
| Qt.Key_Hangul_Romaja | |
| Qt.Key_Hangul_Jeonja | |
| Qt.Key_Hangul_Banja | |
| Qt.Key_Hangul_PreHanja | |
| Qt.Key_Hangul_PostHanja | |
| Qt.Key_Hangul_Special | |
| Qt.Key_Dead_Grave | |
| Qt.Key_Dead_Acute | |
| Qt.Key_Dead_Circumflex | |
| Qt.Key_Dead_Tilde | |
| Qt.Key_Dead_Macron | |
| Qt.Key_Dead_Breve | |
| Qt.Key_Dead_Abovedot | |
| Qt.Key_Dead_Diaeresis | |
| Qt.Key_Dead_Abovering | |
| Qt.Key_Dead_Doubleacute | |
| Qt.Key_Dead_Caron | |
| Qt.Key_Dead_Cedilla | |
| Qt.Key_Dead_Ogonek | |
| Qt.Key_Dead_Iota | |
| Qt.Key_Dead_Voiced_Sound | |
| Qt.Key_Dead_Semivoiced_Sound | |
| Qt.Key_Dead_Belowdot | |
| Qt.Key_Dead_Hook | |
| Qt.Key_Dead_Horn | |
| Qt.Key_Back | |
| Qt.Key_Forward | |
| Qt.Key_Stop | |
| Qt.Key_Refresh | |
| Qt.Key_VolumeDown | |
| Qt.Key_VolumeMute | |
| Qt.Key_VolumeUp | |
| Qt.Key_BassBoost | |
| Qt.Key_BassUp | |
| Qt.Key_BassDown | |
| Qt.Key_TrebleUp | |
| Qt.Key_TrebleDown | |
| Qt.Key_MediaPlay | A key setting the state of the media player to play |
| Qt.Key_MediaStop | A key setting the state of the media player to stop |
| Qt.Key_MediaPrevious | |
| Qt.Key_MediaNext | |
| Qt.Key_MediaRecord | |
| Qt.Key_MediaPause | A key setting the state of the media player to pause ( 注意: not the pause/break key) |
| Qt.Key_MediaTogglePlayPause | A key to toggle the play/pause state in the media player (rather than setting an absolute state) |
| Qt.Key_HomePage | |
| Qt.Key_Favorites | |
| Qt.Key_Search | |
| Qt.Key_Standby | |
| Qt.Key_OpenUrl | |
| Qt.Key_LaunchMail | |
| Qt.Key_LaunchMedia | |
| Qt.Key_Launch0 | On X11 this key is mapped to “My Computer” (XF86XK_MyComputer) key for legacy reasons. |
| Qt.Key_Launch1 | On X11 this key is mapped to “Calculator” (XF86XK_Calculator) key for legacy reasons. |
| Qt.Key_Launch2 | On X11 this key is mapped to XF86XK_Launch0 key for legacy reasons. |
| Qt.Key_Launch3 | On X11 this key is mapped to XF86XK_Launch1 key for legacy reasons. |
| Qt.Key_Launch4 | On X11 this key is mapped to XF86XK_Launch2 key for legacy reasons. |
| Qt.Key_Launch5 | On X11 this key is mapped to XF86XK_Launch3 key for legacy reasons. |
| Qt.Key_Launch6 | On X11 this key is mapped to XF86XK_Launch4 key for legacy reasons. |
| Qt.Key_Launch7 | On X11 this key is mapped to XF86XK_Launch5 key for legacy reasons. |
| Qt.Key_Launch8 | On X11 this key is mapped to XF86XK_Launch6 key for legacy reasons. |
| Qt.Key_Launch9 | On X11 this key is mapped to XF86XK_Launch7 key for legacy reasons. |
| Qt.Key_LaunchA | On X11 this key is mapped to XF86XK_Launch8 key for legacy reasons. |
| Qt.Key_LaunchB | On X11 this key is mapped to XF86XK_Launch9 key for legacy reasons. |
| Qt.Key_LaunchC | On X11 this key is mapped to XF86XK_LaunchA key for legacy reasons. |
| Qt.Key_LaunchD | On X11 this key is mapped to XF86XK_LaunchB key for legacy reasons. |
| Qt.Key_LaunchE | On X11 this key is mapped to XF86XK_LaunchC key for legacy reasons. |
| Qt.Key_LaunchF | On X11 this key is mapped to XF86XK_LaunchD key for legacy reasons. |
| Qt.Key_LaunchG | On X11 this key is mapped to XF86XK_LaunchE key for legacy reasons. |
| Qt.Key_LaunchH | On X11 this key is mapped to XF86XK_LaunchF key for legacy reasons. |
| Qt.Key_MonBrightnessUp | |
| Qt.Key_MonBrightnessDown | |
| Qt.Key_KeyboardLightOnOff | |
| Qt.Key_KeyboardBrightnessUp | |
| Qt.Key_KeyboardBrightnessDown | |
| Qt.Key_PowerOff | |
| Qt.Key_WakeUp | |
| Qt.Key_Eject | |
| Qt.Key_ScreenSaver | |
| Qt.Key_WWW | |
| Qt.Key_Memo | |
| Qt.Key_LightBulb | |
| Qt.Key_Shop | |
| Qt.Key_History | |
| Qt.Key_AddFavorite | |
| Qt.Key_HotLinks | |
| Qt.Key_BrightnessAdjust | |
| Qt.Key_Finance | |
| Qt.Key_Community | |
| Qt.Key_AudioRewind | |
| Qt.Key_BackForward | |
| Qt.Key_ApplicationLeft | |
| Qt.Key_ApplicationRight | |
| Qt.Key_Book | |
| Qt.Key_CD | |
| Qt.Key_Calculator | On X11 this key is not mapped for legacy reasons. Use Qt.Key_Launch1 代替。 |
| Qt.Key_ToDoList | |
| Qt.Key_ClearGrab | |
| Qt.Key_Close | |
| Qt.Key_Copy | |
| Qt.Key_Cut | |
| Qt.Key_Display | |
| Qt.Key_DOS | |
| Qt.Key_Documents | |
| Qt.Key_Excel | |
| Qt.Key_Explorer | |
| Qt.Key_Game | |
| Qt.Key_Go | |
| Qt.Key_iTouch | |
| Qt.Key_LogOff | |
| Qt.Key_Market | |
| Qt.Key_Meeting | |
| Qt.Key_MenuKB | |
| Qt.Key_MenuPB | |
| Qt.Key_MySites | |
| Qt.Key_News | |
| Qt.Key_OfficeHome | |
| Qt.Key_Option | |
| Qt.Key_Paste | |
| Qt.Key_Phone | |
| Qt.Key_Calendar | |
| Qt.Key_Reply | |
| Qt.Key_Reload | |
| Qt.Key_RotateWindows | |
| Qt.Key_RotationPB | |
| Qt.Key_RotationKB | |
| Qt.Key_Save | |
| Qt.Key_Send | |
| Qt.Key_Spell | |
| Qt.Key_SplitScreen | |
| Qt.Key_Support | |
| Qt.Key_TaskPane | |
| Qt.Key_Terminal | |
| Qt.Key_Tools | |
| Qt.Key_Travel | |
| Qt.Key_Video | |
| Qt.Key_Word | |
| Qt.Key_Xfer | |
| Qt.Key_ZoomIn | |
| Qt.Key_ZoomOut | |
| Qt.Key_Away | |
| Qt.Key_Messenger | |
| Qt.Key_WebCam | |
| Qt.Key_MailForward | |
| Qt.Key_Pictures | |
| Qt.Key_Music | |
| Qt.Key_Battery | |
| Qt.Key_Bluetooth | |
| Qt.Key_WLAN | |
| Qt.Key_UWB | |
| Qt.Key_AudioForward | |
| Qt.Key_AudioRepeat | |
| Qt.Key_AudioRandomPlay | |
| Qt.Key_Subtitle | |
| Qt.Key_AudioCycleTrack | |
| Qt.Key_Time | |
| Qt.Key_Hibernate | |
| Qt.Key_View | |
| Qt.Key_TopMenu | |
| Qt.Key_PowerDown | |
| Qt.Key_Suspend | |
| Qt.Key_ContrastAdjust | |
| Qt.Key_MediaLast | |
| Qt.Key_unknown | |
| Qt.Key_Call | A key to answer or initiate a call (see Qt.Key_ToggleCallHangup for a key to toggle current call state) |
| Qt.Key_Camera | A key to activate the camera shutter |
| Qt.Key_CameraFocus | A key to focus the camera |
| Qt.Key_Context1 | |
| Qt.Key_Context2 | |
| Qt.Key_Context3 | |
| Qt.Key_Context4 | |
| Qt.Key_Flip | |
| Qt.Key_Hangup | A key to end an ongoing call (see Qt.Key_ToggleCallHangup for a key to toggle current call state) |
| Qt.Key_No | |
| Qt.Key_Select | |
| Qt.Key_Yes | |
| Qt.Key_ToggleCallHangup | A key to toggle the current call state (ie. either answer, or hangup) depending on current call state |
| Qt.Key_VoiceDial | |
| Qt.Key_LastNumberRedial | |
| Qt.Key_Execute | |
| Qt.Key_Printer | |
| Qt.Key_Play | |
| Qt.Key_Sleep | |
| Qt.Key_Zoom | |
| Qt.Key_Cancel |
另请参阅
QKeyEvent.key()
This enum describes attributes that change the behavior of application-wide features. These are enabled and disabled using QCoreApplication.setAttribute() , and can be tested for with QCoreApplication.testAttribute() .
| 常量 | 描述 |
|---|---|
| Qt.AA_ImmediateWidgetCreation | Ensures that widgets are created as soon as they are constructed. By default, resources for widgets are allocated on demand to improve efficiency and minimize resource usage. Setting or clearing this attribute affects widgets constructed after the change. Setting it tells Qt to create toplevel windows immediately. Therefore, if it is important to minimize resource consumption, do not set this attribute. |
| Qt.AA_MSWindowsUseDirect3DByDefault | 此值已过时且不起作用。 |
| Qt.AA_DontShowIconsInMenus | Actions with the Icon property won't be shown in any menus unless specifically set by the QAction.iconVisibleInMenu property. Menus that are currently open or menus already created in the native Mac OS X menubar may not pick up a change in this attribute. Changes in the QAction.iconVisibleInMenu property will always be picked up. |
| Qt.AA_NativeWindows | Ensures that widgets have native windows. |
| Qt.AA_DontCreateNativeWidgetSiblings | Ensures that siblings of native widgets stay non-native unless specifically set by the Qt.WA_NativeWindow 属性。 |
| Qt.AA_MacPluginApplication | Stops the Qt mac application from doing specific initializations that do not necessarily make sense when using Qt to author a plugin. This includes avoiding loading our nib for the main menu and not taking possession of the native menu bar. When setting this attribute to true will also set the AA_DontUseNativeMenuBar attribute to true. |
| Qt.AA_DontUseNativeMenuBar | All menubars created while this attribute is set to true won't be used as a native menubar (e.g, the menubar at the top of the main screen on Mac OS X or at the bottom in Windows CE). |
| Qt.AA_MacDontSwapCtrlAndMeta | On Mac OS X by default, Qt swaps the Control and Meta (Command) keys (i.e., whenever Control is pressed, Qt sends Meta, and whenever Meta is pressed Control is sent). When this attribute is true, Qt will not do the flip. QKeySequence::StandardShortcuts will also flip accordingly (i.e., QKeySequence.Copy will be Command+C on the keyboard regardless of the value set, though what is output for QKeySequence::toString( QKeySequence.PortableText ) will be different). |
| Qt.AA_S60DontConstructApplicationPanes | Stops Qt from initializing the S60 status pane and softkey pane on Symbian. This is useful to save memory and reduce startup time for applications that will run in fullscreen mode during their whole lifetime. This attribute must be set before PySide.QtGui.QApplication is constructed. |
| Qt.AA_S60DisablePartialScreenInputMode | By default in Symbian^3, a separate editing window is opened on top of an application. This is exactly like editing on previous versions of Symbian behave. When this attribute is false, a non-fullscreen virtual keyboard window is shown on top of application and it is ensured that the focused text input widget is visible. The auto-translation of input widget is only supported for applications based on PySide.QtGui.QGraphicsView , but the non-fullscreen virtual keyboard will work for any kind of application (i.e. QWidgets-based). By default this attribute is true. This attribute must be set after PySide.QtGui.QApplication is constructed. This is only supported in Symbian^3 and later Symbian releases. |
| Qt.AA_X11InitThreads | Calls XInitThreads() as part of the PySide.QtGui.QApplication construction in order to make Xlib calls thread-safe. This attribute must be set before PySide.QtGui.QApplication is constructed. |
| Qt.AA_CaptureMultimediaKeys | Enables application to receive multimedia key events (play, next, previous etc). This includes also external sources such as headsets. Application can not use Remote Control framework on Symbian if this attribute is set. On Symbian, multimedia key event routing may vary between different devices. For example, application on background may receive multimedia key events only if it has active audio stream i.e. it is playing music or video. This attribute must be set before PySide.QtGui.QApplication is constructed. This attribute is only supported in Symbian platform. |
This enum type is used to define some modifier flags. Some of these flags only make sense in the context of printing:
| 常量 | 描述 |
|---|---|
| Qt.TextSingleLine | Treats all whitespace as spaces and prints just one line. |
| Qt.TextDontClip | If it's impossible to stay within the given bounds, it prints outside. |
| Qt.TextExpandTabs | Makes the U+0009 (ASCII tab) character move to the next tab stop. |
| Qt.TextShowMnemonic | Displays the string “&P” as P (见 QButton for an example). For an ampersand, use “&&”. |
| Qt.TextWordWrap | Breaks lines at appropriate points, e.g. at word boundaries. |
| Qt.TextWrapAnywhere | Breaks lines anywhere, even within words. |
| Qt.TextHideMnemonic | 如同 Qt.TextShowMnemonic but doesn't draw the underlines. |
| Qt.TextDontPrint | Treat this text as “hidden” and don't print it. |
| Qt.IncludeTrailingSpaces | When this option is set, QTextLine.naturalTextWidth() and naturalTextRect() will return a value that includes the width of trailing spaces in the text; otherwise this width is excluded. |
| Qt.TextIncludeTrailingSpaces | 如同 IncludeTrailingSpaces |
| Qt.TextJustificationForced | Ensures that text lines are justified. |
Ensures that the longest variant is always used when computing the size of a multi-variant string. (Internal)
You can use as many modifier flags as you want, except that Qt.TextSingleLine and Qt.TextWordWrap cannot be combined.
Flags that are inappropriate for a given use are generally ignored.
This enum type defines the brush styles supported by Qt, i.e. the fill pattern of shapes drawn using PySide.QtGui.QPainter .
| 常量 | 描述 |
|---|---|
| Qt.NoBrush | 没有笔刷图案。 |
| Qt.SolidPattern | Uniform color. |
| Qt.Dense1Pattern | Extremely dense brush pattern. |
| Qt.Dense2Pattern | Very dense brush pattern. |
| Qt.Dense3Pattern | Somewhat dense brush pattern. |
| Qt.Dense4Pattern | Half dense brush pattern. |
| Qt.Dense5Pattern | Somewhat sparse brush pattern. |
| Qt.Dense6Pattern | Very sparse brush pattern. |
| Qt.Dense7Pattern | Extremely sparse brush pattern. |
| Qt.HorPattern | Horizontal lines. |
| Qt.VerPattern | Vertical lines. |
| Qt.CrossPattern | Crossing horizontal and vertical lines. |
| Qt.BDiagPattern | Backward diagonal lines. |
| Qt.FDiagPattern | Forward diagonal lines. |
| Qt.DiagCrossPattern | Crossing diagonal lines. |
| Qt.LinearGradientPattern | Linear gradient (set using a dedicated PySide.QtGui.QBrush constructor). |
| Qt.ConicalGradientPattern | Conical gradient (set using a dedicated PySide.QtGui.QBrush constructor). |
| Qt.RadialGradientPattern | Radial gradient (set using a dedicated PySide.QtGui.QBrush constructor). |
| Qt.TexturePattern | 自定义图案 (见 QBrush.setTexture() ). |
另请参阅
此枚举类型用于指定各种 Widget 属性。属性被设置和清零采用 QWidget.setAttribute() , and queried with QWidget.testAttribute() , although some have special convenience functions which are mentioned below.
| 常量 | 描述 |
|---|---|
| Qt.WA_AcceptDrops | 允许来自拖放操作的数据掉落到 Widget (见 QWidget.setAcceptDrops() ). |
| Qt.WA_AlwaysShowToolTips | 为不活动窗口启用工具提示。 |
| Qt.WA_ContentsPropagated | 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 | 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 | 使 Qt 删除此 Widget 当小部件接受关闭事件时 (见 QWidget.closeEvent() ). |
| Qt.WA_Disabled | 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 | Indicates that the widget is hidden or is not a part of the viewable Desktop. |
| Qt.WA_ForceDisabled | 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 | 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 | 此属性已弃用。 使用 QWidget.windowModality 代替。 |
| Qt.WA_Hover | 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 样式 范例了解细节。 |
| Qt.WA_InputMethodEnabled | Enables input methods for Asian languages. Must be set when creating custom text editing widgets. On Windows CE and Symbian this flag can be used in addition to QApplication.autoSipEnabled to automatically display the SIP when entering a widget. |
| Qt.WA_KeyboardFocusChange | Set on a toplevel window when the users changes focus with the keyboard (tab, backtab, or shortcut). |
| Qt.WA_KeyCompression | 启用键事件压缩,若设置;否则禁用,若未设置。默认情况下,键压缩是关闭的,因此每次按键 (或更多,因为自动重复通常是打开的) Widget 只接收一个键事件。若打开,而程序却跟不上键输入,Qt 可能试着去压缩键事件,以便在每个事件中可以处理多个字符。例如:字处理 Widget 可能接收 2、3 或更多字符,在各 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 | Indicates that the widget wants PySide.QtGui.QLayout to operate on the entire QWidget.rect() , not only on QWidget.contentsRect() . This is set by the widget's author. |
| Qt.WA_LayoutUsesWidgetRect | Ignore the layout item rect from the style when laying out this widget with PySide.QtGui.QLayout . This makes a difference in PySide.QtGui.QMacStyle and PySide.QtGui.QPlastiqueStyle for some widgets. |
| Qt.WA_MacNoClickThrough | When a widget that has this attribute set is clicked, and its window is inactive, the click will make the window active but won't be seen by the widget. Typical use of this attribute is on widgets with “destructive” actions, such as a “Delete” button. WA_MacNoClickThrough also applies to all child widgets of the widget that has it set. |
| Qt.WA_MacOpaqueSizeGrip | Indicates that the native Carbon size grip should be opaque instead of transparent (the default). This attribute is only applicable to Mac OS X and is set by the widget's author. |
| Qt.WA_MacShowFocusRect | Indicates that this widget should get a PySide.QtGui.QFocusFrame around it. Some widgets draw their own focus halo regardless of this attribute. Not that the QWidget.focusPolicy also plays the main role in whether something is given focus or not, this only controls whether or not this gets the focus frame. This attribute is only applicable to Mac OS X. |
| Qt.WA_MacNormalSize | Indicates the widget should have the normal size for widgets in Mac OS X. This attribute is only applicable to Mac OS X. |
| Qt.WA_MacSmallSize | Indicates the widget should have the small size for widgets in Mac OS X. This attribute is only applicable to Mac OS X. |
| Qt.WA_MacMiniSize | Indicates the widget should have the mini size for widgets in Mac OS X. This attribute is only applicable to Mac OS X. |
| Qt.WA_MacVariableSize | Indicates the widget can choose between alternative sizes for widgets to avoid clipping. This attribute is only applicable to Mac OS X. |
| Qt.WA_MacBrushedMetal | Indicates the widget should be drawn in the brushed metal style as supported by the windowing system. This attribute is only applicable to Mac OS X. |
| Qt.WA_Mapped | Indicates that the widget is mapped on screen. This is set/cleared by the Qt kernel. |
| Qt.WA_MouseNoMask | Makes the widget receive mouse events for the entire widget regardless of the currently set mask, overriding QWidget.setMask() . This is not applicable for top-level windows. |
| Qt.WA_MouseTracking | 指示 Widget 已启用鼠标跟踪。见 QWidget.mouseTracking . |
| Qt.WA_Moved | 指示 Widget 拥有明确位置。这的设置/清零通过 QWidget.move() and by QWidget.setGeometry() . |
| Qt.WA_MSWindowsUseDirect3D | 此值已过时且不起作用。 |
| Qt.WA_NoBackground | This value is obsolete. Use WA_OpaquePaintEvent 代替。 |
| Qt.WA_NoChildEventsForParent | Indicates that the widget does not want ChildAdded or ChildRemoved events sent to its parent. This is rarely necessary but can help to avoid automatic insertion widgets like splitters and layouts. This is set by a widget's author. |
| Qt.WA_NoChildEventsFromChildren | Indicates that the widget does not want to receive ChildAdded or ChildRemoved events sent from its children. This is set by a widget's author. |
| Qt.WA_NoMouseReplay | Used for pop-up widgets. Indicates that the most recent mouse press event should not be replayed when the pop-up widget closes. The flag is set by the widget's author and cleared by the Qt kernel every time the widget receives a new mouse event. |
| Qt.WA_NoMousePropagation | 阻止将鼠标事件传播到 Widget 父级。此属性被禁用,默认情况下。 |
| Qt.WA_TransparentForMouseEvents | When enabled, this attribute disables the delivery of mouse events to the widget and its children. Mouse events are delivered to other widgets as if the widget and its children were not present in the widget hierarchy; mouse clicks and other events effectively “pass through” them. This attribute is disabled by default. |
| Qt.WA_NoSystemBackground | 指示 Widget 没有背景 (即:当 Widget 接收描绘事件时,不自动重新绘制背景)。 注意: 不像 WA_OpaquePaintEvent , newly exposed areas are never filled with the background (e.g., after showing a window for the first time the user can see “through” it until the application processes the paint events). This flag is set or cleared by the widget's author. |
| Qt.WA_OpaquePaintEvent | Indicates that the widget paints all its pixels when it receives a paint event. Thus, it is not required for operations like updating, resizing, scrolling and focus changes to erase the widget before generating paint events. The use of WA_OpaquePaintEvent provides a small optimization by helping to reduce flicker on systems that do not support double buffering and avoiding computational cycles necessary to erase the background prior to painting. 注意: 不像 WA_NoSystemBackground , WA_OpaquePaintEvent makes an effort to avoid transparent window backgrounds. This flag is set or cleared by the widget's author. |
| Qt.WA_OutsideWSRange | Indicates that the widget is outside the valid range of the window system's coordinate system. A widget outside the valid range cannot be mapped on screen. This is set/cleared by the Qt kernel. |
| Qt.WA_PaintOnScreen | Indicates that the widget wants to draw directly onto the screen. Widgets with this attribute set do not participate in composition management, i.e. they cannot be semi-transparent or shine through semi-transparent overlapping widgets. 注意: This flag is only supported on X11 and it disables double buffering. On Qt for Embedded Linux, the flag only works when set on a top-level widget and it relies on support from the active screen driver. This flag is set or cleared by the widget's author. To render outside of Qt's paint system, e.g., if you require native painting primitives, you need to reimplement QWidget.paintEngine() to return 0 and set this flag. |
| Qt.WA_PaintOutsidePaintEvent | Makes it possible to use PySide.QtGui.QPainter to paint on the widget outside PySide.QtGui.QWidget.paintEvent() . This flag is not supported on Windows, Mac OS X or Embedded Linux. We recommend that you use it only when porting Qt 3 code to Qt 4. |
| Qt.WA_PaintUnclipped | Makes all painters operating on this widget unclipped. Children of this widget or other widgets in front of it do not clip the area the painter can paint on. This flag is only supported for widgets with the WA_PaintOnScreen flag set. The preferred way to do this in a cross platform way is to create a transparent widget that lies in front of the other widgets. |
| Qt.WA_PendingMoveEvent | Indicates that a move event is pending, e.g., when a hidden widget was moved. This flag is set or cleared by the Qt kernel. |
| Qt.WA_PendingResizeEvent | Indicates that a resize event is pending, e.g., when a hidden widget was resized. This flag is set or cleared by the Qt kernel. |
| Qt.WA_QuitOnClose | Makes Qt quit the application when the last widget with the attribute set has accepted closeEvent(). This behavior can be modified with the QApplication.quitOnLastWindowClosed property. By default this attribute is set for all widgets of type Qt.Window . |
| Qt.WA_Resized | Indicates that the widget has an explicit size. This flag is set or cleared by QWidget.resize() and QWidget.setGeometry() . |
| Qt.WA_RightToLeft | Indicates that the layout direction for the widget is right to left. |
| Qt.WA_SetCursor | Indicates that the widget has a cursor of its own. This flag is set or cleared by QWidget.setCursor() and QWidget.unsetCursor() . |
| Qt.WA_SetFont | Indicates that the widget has a font of its own. This flag is set or cleared by QWidget.setFont() . |
| Qt.WA_SetPalette | Indicates that the widget has a palette of its own. This flag is set or cleared by QWidget.setPalette() . |
| Qt.WA_SetStyle | Indicates that the widget has a style of its own. This flag is set or cleared by QWidget.setStyle() . |
| Qt.WA_ShowModal | 此属性已弃用。 使用 QWidget.windowModality 代替。 |
| Qt.WA_StaticContents | Indicates that the widget contents are north-west aligned and static. On resize, such a widget will receive paint events only for parts of itself that are newly visible. This flag is set or cleared by the widget's author. |
| Qt.WA_StyleSheet | Indicates that the widget is styled using a 样式表 . |
| Qt.WA_TranslucentBackground | Indicates that the widget should have a translucent background, i.e., any non-opaque regions of the widgets will be translucent because the widget will have an alpha channel. Setting this flag causes WA_NoSystemBackground to be set. On Windows the widget also needs the Qt.FramelessWindowHint 窗口标志被设置。此标志由 Widget 的作者设置或清零。 |
| Qt.WA_UnderMouse | Indicates that the widget is under the mouse cursor. The value is not updated correctly during drag and drop operations. There is also a getter function, QWidget.underMouse() . This flag is set or cleared by the Qt kernel. |
| Qt.WA_UpdatesDisabled | Indicates that updates are blocked (including the system background). This flag is set or cleared by the Qt kernel. |
警告
This flag must never be set or cleared by the widget's author.
| 常量 | 描述 |
|---|---|
| Qt.WA_WindowModified | Indicates that the window is marked as modified. On some platforms this flag will do nothing, on others (including Mac OS X and Windows) the window will take a modified appearance. This flag is set or cleared by QWidget.setWindowModified() . |
| Qt.WA_WindowPropagation | Makes a toplevel window inherit font and palette from its parent. |
| Qt.WA_MacAlwaysShowToolWindow | On Mac OS X, show the tool window even when the application is not active. By default, all tool windows are hidden when the application is inactive. |
| Qt.WA_SetLocale | Indicates the locale should be taken into consideration in the widget. |
| Qt.WA_StyledBackground | Indicates the widget should be drawn using a styled background. |
| Qt.WA_ShowWithoutActivating | Show the widget without making it active. |
| Qt.WA_NativeWindow | Indicates that a native window is created for the widget. Enabling this flag will also force a native window for the widget's ancestors unless Qt.WA_DontCreateNativeAncestors 被设置。 |
| Qt.WA_DontCreateNativeAncestors | Indicates that the widget's ancestors are kept non-native even though the widget itself is native. |
| Qt.WA_X11NetWmWindowTypeDesktop | Adds _NET_WM_WINDOW_TYPE_DESKTOP to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. |
| Qt.WA_X11NetWmWindowTypeDock | Adds _NET_WM_WINDOW_TYPE_DOCK to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. |
| Qt.WA_X11NetWmWindowTypeToolBar | Adds _NET_WM_WINDOW_TYPE_TOOLBAR to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. 注意: Qt automaticaly sets this attribute for PySide.QtGui.QToolBar . |
| Qt.WA_X11NetWmWindowTypeMenu | Adds _NET_WM_WINDOW_TYPE_MENU to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. 注意: Qt automatically sets this attribute for PySide.QtGui.QMenu when torn-off. |
| Qt.WA_X11NetWmWindowTypeUtility | Adds _NET_WM_WINDOW_TYPE_UTILITY to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. 注意: Qt automatically sets this attribute for the Qt.Tool window type. |
| Qt.WA_X11NetWmWindowTypeSplash | Adds _NET_WM_WINDOW_TYPE_SPLASH to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. 注意: Qt automatically sets this attribute for the Qt.SplashScreen window type. |
| Qt.WA_X11NetWmWindowTypeDialog | Adds _NET_WM_WINDOW_TYPE_DIALOG to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. 注意: Qt automatically sets this attribute for the Qt.Dialog and Qt.Sheet window types. |
| Qt.WA_X11NetWmWindowTypeDropDownMenu | Adds _NET_WM_WINDOW_TYPE_DROPDOWN_MENU to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. 注意: Qt automatically sets this attribute for QMenus added to a PySide.QtGui.QMenuBar . |
| Qt.WA_X11NetWmWindowTypePopupMenu | Adds _NET_WM_WINDOW_TYPE_POPUP_MENU to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. 注意: Qt automatically sets this attribute for PySide.QtGui.QMenu . |
| Qt.WA_X11NetWmWindowTypeToolTip | Adds _NET_WM_WINDOW_TYPE_TOOLTIP to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. 注意: Qt automatically sets this attribute for the Qt.ToolTip window type. |
| Qt.WA_X11NetWmWindowTypeNotification | Adds _NET_WM_WINDOW_TYPE_NOTIFICATION to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. |
| Qt.WA_X11NetWmWindowTypeCombo | Adds _NET_WM_WINDOW_TYPE_COMBO to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. 注意: Qt automatically sets this attribute for the PySide.QtGui.QComboBox pop-up. |
| Qt.WA_X11NetWmWindowTypeDND | Adds _NET_WM_WINDOW_TYPE_DND to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute has no effect on non-X11 platforms. 注意: Qt automatically sets this attribute on the feedback widget used during a drag. |
| Qt.WA_MacFrameworkScaled | Enables resolution independence aware mode on Mac when using Carbon. This attribute has no effect on Cocoa. The attribute is off by default and can be enabled on a per-window basis. |
| Qt.WA_AcceptTouchEvents | Allows touch events (see PySide.QtGui.QTouchEvent ) to be sent to the widget. Must be set on all widgets that can handle touch events. Without this attribute set, events from a touch device will be sent as mouse events. |
| Qt.WA_TouchPadAcceptSingleTouchEvents | Allows touchpad single touch events to be sent to the widget. |
| Qt.WA_MergeSoftkeys | Allows widget to merge softkeys with parent widget, i.e. widget can set only one softkeys and request softkey implementation to take rest of the softkeys from the parent. Note parents are traversed until WA_MergeSoftkeys is not set. See also Qt.WA_MergeSoftkeysRecursively This attribute currently has effect only on Symbian platforms |
| Qt.WA_MergeSoftkeysRecursively | Allows widget to merge softkeys recursively with all parents. If this attribute is set, the widget parents are traversed until window boundary (widget without parent or dialog) is found. This attribute currently has effect only on Symbian platforms |
| Qt.WA_X11DoNotAcceptFocus | Asks the window manager to not give focus to this top level window. This attribute has no effect on non-X11 platforms. |
| Qt.WA_LockPortraitOrientation | Locks the widget to a portrait orientation, ignoring changes to the display's orientation with respect to the user. |
| Qt.WA_LockLandscapeOrientation | Locks the widget to a landscape orientation, ignoring changes to the display's orientation with respect to the user. |
| Qt.WA_AutoOrientation | Causes the widget to change orientation whenever the display changes orientation with respect to the user. |
| Qt.WA_MacNoShadow | Since Qt 4.8, this attribute disables drop shadows for this top level window. Only affects Cocoa builds of Qt for Mac OS X. |
This enum represents the state of a touch point at the time the PySide.QtGui.QTouchEvent occurred.
| 常量 | 描述 |
|---|---|
| Qt.TouchPointPressed | The touch point is now pressed. |
| Qt.TouchPointMoved | The touch point moved. |
| Qt.TouchPointStationary | The touch point did not move. |
| Qt.TouchPointReleased | The touch point was released. |
注意
该枚举在 Qt 4.6 引入或被修改
此枚举指定文本显示 Widget,如何应答用户输入。
| 常量 | 描述 |
|---|---|
| Qt.NoTextInteraction | 不可能与文本进行交互。 |
| Qt.TextSelectableByMouse | 可以采用鼠标选择文本,然后使用上下文菜单 (或标准键盘快捷键) 将其拷贝到剪贴板。 |
| Qt.TextSelectableByKeyboard | 可以采用键盘光标键选择文本。展示文本光标。 |
| Qt.LinksAccessibleByMouse | 可以采用鼠标突显和激活链接。 |
| Qt.LinksAccessibleByKeyboard | 可以使用 Tab 聚焦链接,并采用 Enter 激活它们。 |
| Qt.TextEditable | 文本是完全可编辑的。 |
| Qt.TextEditorInteraction | 默认文本编辑器。 |
| Qt.TextBrowserInteraction | 默认为 PySide.QtGui.QTextBrowser . |
此枚举类型描述不同的鼠标按钮。
| 常量 | 描述 |
|---|---|
| Qt.NoButton | 按钮状态不引用任何按钮 (见 QMouseEvent.button() ). |
| Qt.LeftButton | 左边按钮被按下,或事件引用左边按钮 (左边按钮可能是惯用左手鼠标的右边按钮)。 |
| Qt.RightButton | 右边按钮。 |
| Qt.MidButton | 中间按钮。 |
| Qt.MiddleButton | 中间按钮。 |
| Qt.XButton1 | The first X button. |
| Qt.XButton2 | The second X button. |
另请参阅
Qt.KeyboardModifier Qt.Modifier
此枚举描述可以使用的匹配类型,当搜索模型项时。
| 常量 | 描述 |
|---|---|
| Qt.MatchExactly | Performs PySide.QtCore.QVariant -based matching. |
| Qt.MatchFixedString | Performs string-based matching. String-based comparisons are case-insensitive unless the MatchCaseSensitive flag is also specified. |
| Qt.MatchContains | 搜索术语包含在项中。 |
| Qt.MatchStartsWith | 搜索术语匹配项开头。 |
| Qt.MatchEndsWith | 搜索术语匹配项末尾。 |
| Qt.MatchCaseSensitive | 搜索区分大小写。 |
| Qt.MatchRegExp | Performs string-based matching using a regular expression as the search term. |
| Qt.MatchWildcard | Performs string-based matching using a string with wildcards as the search term. |
| Qt.MatchWrap | Perform a search that wraps around, so that when the search reaches the last item in the model, it begins again at the first item and continues until all items have been examined. |
| Qt.MatchRecursive | 搜索整个层次结构。 |
另请参阅
QString.compare() PySide.QtCore.QRegExp
This enum type defines the pen cap styles supported by Qt, i.e. the line end caps that can be drawn using PySide.QtGui.QPainter .
|
|
|
| Qt.SquareCap | Qt.FlatCap | Qt.RoundCap |
| 常量 | 描述 |
|---|---|
| Qt.FlatCap | a square line end that does not cover the end point of the line. |
| Qt.SquareCap | a square line end that covers the end point and extends beyond it by half the line width. |
| Qt.RoundCap | a rounded line end. |
另请参阅
This enum specifies where the ellipsis should appear when displaying texts that don't fit:
| 常量 | 描述 |
|---|---|
| Qt.ElideLeft | 省略号应出现在文本的开头。 |
| Qt.ElideRight | 省略号应出现在文本的末尾。 |
| Qt.ElideMiddle | 省略号应出现在文本的中间。 |
| Qt.ElideNone | 省略号不应出现在文本中。 |
Qt.ElideMiddle is normally the most appropriate choice for URLs (e.g., “ http://bugreports.qt.../QTWEBSITE-13/ ”), whereas Qt.ElideRight is appropriate for other strings (e.g., “Deploying Applications on Ma...”).
另请参阅
QAbstractItemView.textElideMode QFontMetrics.elidedText() Qt.AlignmentFlag QTabBar.elideMode