The QtWin namespace contains miscellaneous Windows-specific functions. 更多...
| 頭: | #include <QtWin> |
| qmake: | QT += winextras |
| enum | HBitmapFormat { HBitmapNoAlpha, HBitmapPremultipliedAlpha, HBitmapAlpha } |
| enum | WindowFlip3DPolicy { FlipDefault, FlipExcludeAbove, FlipExcludeBelow } |
| QColor | colorizationColor (bool * opaqueBlend = nullptr) |
| HBITMAP | createMask (const QBitmap & bitmap ) |
| void | disableBlurBehindWindow (QWindow * window ) |
| void | disableBlurBehindWindow (QWidget * window ) |
| void | enableBlurBehindWindow (QWindow * window , const QRegion & region ) |
| void | enableBlurBehindWindow (QWindow * window ) |
| void | enableBlurBehindWindow (QWidget * window , const QRegion & region ) |
| void | enableBlurBehindWindow (QWidget * window ) |
| QString | errorStringFromHresult (int hresult ) |
| void | extendFrameIntoClientArea (QWindow * window , int left , int top , int right , int bottom ) |
| void | extendFrameIntoClientArea (QWindow * window , const QMargins & margins ) |
| void | extendFrameIntoClientArea (QWidget * window , const QMargins & margins ) |
| void | extendFrameIntoClientArea (QWidget * window , int left , int top , int right , int bottom ) |
| QPixmap | fromHBITMAP (HBITMAP bitmap , QtWin::HBitmapFormat format = HBitmapNoAlpha) |
| QPixmap | fromHICON (HICON icon ) |
| QRegion | fromHRGN (HRGN hrgn ) |
| QImage | imageFromHBITMAP (int hdc , HBITMAP bitmap , int width , int height ) |
| QImage | imageFromHBITMAP (HBITMAP bitmap , QtWin::HBitmapFormat format = HBitmapNoAlpha) |
| HBITMAP | imageToHBITMAP (const QImage & image , QtWin::HBitmapFormat format = HBitmapNoAlpha) |
| bool | isCompositionEnabled () |
| bool | isCompositionOpaque () |
| bool | isWindowExcludedFromPeek (QWindow * window ) |
| bool | isWindowExcludedFromPeek (QWidget * window ) |
| bool | isWindowPeekDisallowed (QWindow * window ) |
| bool | isWindowPeekDisallowed (QWidget * window ) |
| void | markFullscreenWindow (QWindow * window , bool fullscreen = true) |
| void | markFullscreenWindow (QWidget * window , bool fullscreen = true) |
| QColor | realColorizationColor () |
| void | resetExtendedFrame (QWindow * window ) |
| void | resetExtendedFrame (QWidget * window ) |
| void | setCompositionEnabled (bool enabled ) |
| void | setCurrentProcessExplicitAppUserModelID (const QString & id ) |
| void | setWindowDisallowPeek (QWindow * window , bool disallow ) |
| void | setWindowDisallowPeek (QWidget * window , bool disallow ) |
| void | setWindowExcludedFromPeek (QWindow * window , bool exclude ) |
| void | setWindowExcludedFromPeek (QWidget * window , bool exclude ) |
| void | setWindowFlip3DPolicy (QWindow * window , QtWin::WindowFlip3DPolicy policy ) |
| void | setWindowFlip3DPolicy (QWidget * window , QtWin::WindowFlip3DPolicy policy ) |
| QString | stringFromHresult (int hresult ) |
| void | taskbarActivateTab (QWindow * window ) |
| void | taskbarActivateTab (QWidget * window ) |
| void | taskbarActivateTabAlt (QWindow * window ) |
| void | taskbarActivateTabAlt (QWidget * window ) |
| void | taskbarAddTab (QWindow * window ) |
| void | taskbarAddTab (QWidget * window ) |
| void | taskbarDeleteTab (QWindow * window ) |
| void | taskbarDeleteTab (QWidget * window ) |
| HBITMAP | toHBITMAP (const QPixmap & p , QtWin::HBitmapFormat format = HBitmapNoAlpha) |
| HICON | toHICON (const QPixmap & p ) |
| HRGN | toHRGN (const QRegion & region ) |
| QtWin::WindowFlip3DPolicy | windowFlip3DPolicy (QWindow * window ) |
| QtWin::WindowFlip3DPolicy | windowFlip3DPolicy (QWidget * window ) |
The QtWin namespace contains miscellaneous Windows-specific functions.
此枚舉定義如何轉換介於
HBITMAP
and
QPixmap
的履行。
| 常量 | 值 | 描述 |
|---|---|---|
QtWin::HBitmapNoAlpha
|
0
|
The alpha channel is ignored and always treated as being set to fully opaque. This is preferred if the
HBITMAP
is used with standard GDI calls, such as
BitBlt()
.
|
QtWin::HBitmapPremultipliedAlpha
|
1
|
The
HBITMAP
is treated as having an alpha channel and premultiplied colors. This is preferred if the
HBITMAP
is accessed through the
AlphaBlend()
GDI function.
|
QtWin::HBitmapAlpha
|
2
|
The
HBITMAP
is treated as having a plain alpha channel. This is the preferred format if the
HBITMAP
is going to be used as an application icon or a systray icon.
|
該枚舉在 Qt 5.2 引入或被修改。
另請參閱 fromHBITMAP () 和 toHBITMAP ().
此枚舉類型指定 Flip3D 窗口策略。
| 常量 | 值 | 描述 |
|---|---|---|
QtWin::FlipDefault
|
0
|
Let the OS decide whether to include the window in the Flip3D rendering. |
QtWin::FlipExcludeAbove
|
2
|
Exclude the window from Flip3D and display it above the Flip3D rendering. |
QtWin::FlipExcludeBelow
|
1
|
Exclude the window from Flip3D and display it below the Flip3D rendering. |
該枚舉在 Qt 5.2 引入或被修改。
另請參閱 setWindowFlip3DPolicy ().
返迴 DWM (桌麵窗口管理器) 著色顔色。在函數返迴後,可選 opaqueBlend 將包含 true 若顔色是不透明融閤,否則 false。
該函數在 Qt 5.2 引入。
創建
HBITMAP
相當於
QBitmap
bitmap
.
調用者負責釋放
HBITMAP
數據在使用後。
該函數在 Qt 5.2 引入。
另請參閱 toHBITMAP ().
禁用先前啓用的模糊效果為指定 window .
該函數在 Qt 5.2 引入。
另請參閱 enableBlurBehindWindow ().
此函數重載 QtWin::disableBlurBehindWindow ().
該函數在 Qt 5.2 引入。
啓用模糊效果為指定 region 的指定 window .
該函數在 Qt 5.2 引入。
另請參閱 disableBlurBehindWindow ().
啓用模糊效果為指定 window .
該函數在 Qt 5.2 引入。
另請參閱 disableBlurBehindWindow ().
此函數重載 QtWin::enableBlurBehindWindow ().
該函數在 Qt 5.2 引入。
此函數重載 QtWin::enableBlurBehindWindow ().
該函數在 Qt 5.2 引入。
Returns the code name of the hresult error id specified (usually the name of the WinAPI macro) or an empty string if the message is unknown.
該函數在 Qt 5.2 引入。
將玻璃框擴展到客戶端區域的指定 window 使用 left , top , right ,和 bottom 邊距值。
傳遞 -1 作為任一 4 邊距值將完全擴展框架,創建 sheet of glass 效果。
若想要擴展框架扮演像標準窗口邊框,應自己處理。
注意: 若 window 是 QWidget handle, set the Qt::WA_NoSystemBackground attribute for your widget.
該函數在 Qt 5.2 引入。
另請參閱 resetExtendedFrame ().
此函數重載 QtWin::extendFrameIntoClientArea ().
將玻璃框擴展到客戶端區域的指定 window 使用指定 margins .
該函數在 Qt 5.2 引入。
此函數重載 QtWin::extendFrameIntoClientArea ().
方便重載,允許傳遞框架尺寸按 margins 結構。
該函數在 Qt 5.2 引入。
此函數重載 QtWin::extendFrameIntoClientArea ().
該函數在 Qt 5.2 引入。
返迴 QPixmap 相當於給定 bitmap . The conversion is based on the specified format .
該函數在 Qt 5.2 引入。
另請參閱 toHBITMAP ().
返迴 QPixmap 相當於給定 icon .
該函數在 Qt 5.2 引入。
另請參閱 toHICON ().
返迴 QRegion 相當於給定 hrgn .
該函數在 Qt 5.2 引入。
返迴
QImage
相當於給定
bitmap
. The conversion is based on the specified
HDC
context
hdc
使用指定
width
and
height
.
該函數在 Qt 5.2 引入。
另請參閱 toHBITMAP ().
返迴 QImage 相當於給定 bitmap . The conversion is based on the specified format .
該函數在 Qt 5.12 引入。
另請參閱 imageToHBITMAP ().
創建
HBITMAP
相當於
QImage
image
, based on the given
format
。返迴
HBITMAP
句柄。
調用者負責釋放
HBITMAP
數據在使用後。
該函數在 Qt 5.12 引入。
另請參閱 imageFromHBITMAP ().
返迴 DWM (桌麵窗口管理器) 閤成狀態。
該函數在 Qt 5.2 引入。
返迴著色顔色是否為不透明融閤。
該函數在 Qt 5.2 引入。
返迴 true 若指定 window 被排除從 Aero Peek。
該函數在 Qt 5.2 引入。
此函數重載 QtWin::isWindowExcludedFromPeek ().
該函數在 Qt 5.2 引入。
Returns true if Aero Peek is disallowed on the thumbnail of the specified window .
該函數在 Qt 5.2 引入。
此函數重載 QtWin::isWindowPeekDisallowed ().
該函數在 Qt 5.2 引入。
標記指定 window as running in the full-screen mode if fullscreen is true, so that the shell handles it correctly. Otherwise, removes the mark.
注意: You do not usually need to call this function, because the Windows taskbar always tries to determine whether a window is running in the full-screen mode.
該函數在 Qt 5.2 引入。
此函數重載 QtWin::markFullscreenWindow ().
該函數在 Qt 5.2 引入。
返迴由用戶設置的真實著色顔色,使用未文檔化注冊鍵。基於 API 的函數
getColorizationColor()
返迴融閤 Alpha 的顔色 (通常變成半透明灰色,而不是類似由用戶選取的顔色)。
該函數在 Qt 5.2 引入。
另請參閱 colorizationColor ().
重置玻璃框並還原 window 屬性。
此方便函數調用 extendFrameIntoClientArea () 采用 0 邊距設置。
注意: You must unset the Qt::WA_NoSystemBackground attribute for extendFrameIntoClientArea () 要工作。
該函數在 Qt 5.2 引入。
另請參閱 extendFrameIntoClientArea ().
此函數重載 QtWin::resetExtendedFrame ().
該函數在 Qt 5.2 引入。
設置 Windows 桌麵閤成是否為 enabled .
注意: 底層函數在 Windows 8 聲明棄用,且無效。
該函數在 Qt 5.2 引入。
另請參閱 isCompositionEnabled ().
設置應用程序用戶模型 ID id .
更多信息,見 應用程序用戶模型 ID .
該函數在 Qt 5.2 引入。
Disables Aero Peek for the specified window when hovering over the taskbar thumbnail of the window with the mouse pointer if disallow is true; otherwise allows it.
默認為 false。
該函數在 Qt 5.2 引入。
此函數重載 QtWin::setWindowDisallowPeek ().
該函數在 Qt 5.2 引入。
排除指定 window from Aero Peek if exclude 為 true。
該函數在 Qt 5.2 引入。
另請參閱 isWindowExcludedFromPeek ().
此函數重載 QtWin::setWindowExcludedFromPeek ().
該函數在 Qt 5.2 引入。
Sets the Flip3D policy policy 為指定 window .
該函數在 Qt 5.2 引入。
另請參閱 windowFlip3DPolicy ().
此函數重載 QtWin::setWindowFlip3DPolicy ().
該函數在 Qt 5.2 引入。
Returns a message string that explains the hresult error id specified or an empty string if the explanation cannot be found.
該函數在 Qt 5.2 引入。
Activates an item on the taskbar without activating the window 本身。
該函數在 Qt 5.2 引入。
此函數重載 QtWin::taskbarActivateTab ().
該函數在 Qt 5.2 引入。
Marks the item that represents the specified window on the taskbar as active, but does not activate it visually.
該函數在 Qt 5.2 引入。
此函數重載 QtWin::taskbarActivateTabAlt ().
該函數在 Qt 5.2 引入。
Adds an item for the specified window to the taskbar.
該函數在 Qt 5.2 引入。
此函數重載 QtWin::taskbarAddTab ().
該函數在 Qt 5.2 引入。
移除指定 window from the taskbar.
該函數在 Qt 5.2 引入。
此函數重載 QtWin::taskbarDeleteTab ().
該函數在 Qt 5.2 引入。
創建
HBITMAP
相當於
QPixmap
p
, based on the given
format
。返迴
HBITMAP
句柄。
調用者負責釋放
HBITMAP
數據在使用後。
該函數在 Qt 5.2 引入。
另請參閱 fromHBITMAP ().
創建
HICON
相當於
QPixmap
p
。返迴
HICON
句柄。
調用者負責釋放
HICON
數據在使用後。
該函數在 Qt 5.2 引入。
另請參閱 fromHICON ().
Returns a HRGN that is equivalent to the given region .
該函數在 Qt 5.2 引入。
Returns the current Flip3D policy for the specified window .
該函數在 Qt 5.2 引入。
另請參閱 setWindowFlip3DPolicy ().
此函數重載 QtWin::windowFlip3DPolicy ().
該函數在 Qt 5.2 引入。