QtWin 名稱空間

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 = Q_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 (HRESULT 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 , HBitmapFormat format = HBitmapNoAlpha)
    QPixmap fromHICON (HICON icon )
    QRegion fromHRGN (HRGN hrgn )
    QImage imageFromHBITMAP (HDC hdc , HBITMAP bitmap , int width , int height )
    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 , WindowFlip3DPolicy policy )
    void setWindowFlip3DPolicy (QWidget * window , WindowFlip3DPolicy policy )
    QString stringFromHresult (HRESULT 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 , HBitmapFormat format = HBitmapNoAlpha)
    HICON toHICON (const QPixmap & p )
    HRGN toHRGN (const QRegion & region )
    WindowFlip3DPolicy windowFlip3DPolicy (QWindow * window )
    WindowFlip3DPolicy windowFlip3DPolicy (QWidget * window )

    詳細描述

    The QtWin namespace contains miscellaneous Windows-specific functions.

    類型文檔編製

    enum QtWin:: HBitmapFormat

    此枚舉定義如何轉換介於 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 ().

    enum QtWin:: WindowFlip3DPolicy

    此枚舉類型指定 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 ().

    函數文檔編製

    QColor QtWin:: colorizationColor ( bool * opaqueBlend = Q_NULLPTR)

    返迴 DWM (桌麵窗口管理器) 著色顔色。在函數返迴後,可選 opaqueBlend 將包含 true 若顔色是不透明融閤,否則 false。

    該函數在 Qt 5.2 引入。

    HBITMAP QtWin:: createMask (const QBitmap & bitmap )

    創建 HBITMAP 相當於 QBitmap bitmap .

    調用者負責釋放 HBITMAP 數據在使用後。

    該函數在 Qt 5.2 引入。

    另請參閱 toHBITMAP ().

    void QtWin:: disableBlurBehindWindow ( QWindow * window )

    禁用先前啓用的模糊效果為指定 window .

    該函數在 Qt 5.2 引入。

    另請參閱 enableBlurBehindWindow ().

    void QtWin:: disableBlurBehindWindow ( QWidget * window )

    此函數重載 QtWin::disableBlurBehindWindow ().

    該函數在 Qt 5.2 引入。

    void QtWin:: enableBlurBehindWindow ( QWindow * window , const QRegion & region )

    啓用模糊效果為指定 region 的指定 window .

    該函數在 Qt 5.2 引入。

    另請參閱 disableBlurBehindWindow ().

    void QtWin:: enableBlurBehindWindow ( QWindow * window )

    啓用模糊效果為指定 window .

    該函數在 Qt 5.2 引入。

    另請參閱 disableBlurBehindWindow ().

    void QtWin:: enableBlurBehindWindow ( QWidget * window , const QRegion & region )

    此函數重載 QtWin::enableBlurBehindWindow ().

    該函數在 Qt 5.2 引入。

    void QtWin:: enableBlurBehindWindow ( QWidget * window )

    此函數重載 QtWin::enableBlurBehindWindow ().

    該函數在 Qt 5.2 引入。

    QString QtWin:: errorStringFromHresult ( HRESULT hresult )

    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 引入。

    void QtWin:: extendFrameIntoClientArea ( QWindow * window , int left , int top , int right , int bottom )

    將玻璃框擴展到客戶端區域的指定 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 ().

    void QtWin:: extendFrameIntoClientArea ( QWindow * window , const QMargins & margins )

    此函數重載 QtWin::extendFrameIntoClientArea ().

    將玻璃框擴展到客戶端區域的指定 window 使用指定 margins .

    該函數在 Qt 5.2 引入。

    void QtWin:: extendFrameIntoClientArea ( QWidget * window , const QMargins & margins )

    此函數重載 QtWin::extendFrameIntoClientArea ().

    方便重載,允許傳遞框架尺寸按 margins 結構。

    該函數在 Qt 5.2 引入。

    void QtWin:: extendFrameIntoClientArea ( QWidget * window , int left , int top , int right , int bottom )

    此函數重載 QtWin::extendFrameIntoClientArea ().

    該函數在 Qt 5.2 引入。

    QPixmap QtWin:: fromHBITMAP ( HBITMAP bitmap , HBitmapFormat format = HBitmapNoAlpha)

    返迴 QPixmap 相當於給定 bitmap . The conversion is based on the specified format .

    該函數在 Qt 5.2 引入。

    另請參閱 toHBITMAP ().

    QPixmap QtWin:: fromHICON ( HICON icon )

    返迴 QPixmap 相當於給定 icon .

    該函數在 Qt 5.2 引入。

    另請參閱 toHICON ().

    QRegion QtWin:: fromHRGN ( HRGN hrgn )

    返迴 QRegion 相當於給定 hrgn .

    該函數在 Qt 5.2 引入。

    QImage QtWin:: imageFromHBITMAP ( HDC hdc , HBITMAP bitmap , int width , int height )

    返迴 QImage 相當於給定 bitmap . The conversion is based on the specified HDC context hdc 使用指定 width and height .

    該函數在 Qt 5.2 引入。

    另請參閱 toHBITMAP ().

    bool QtWin:: isCompositionEnabled ()

    返迴 DWM (桌麵窗口管理器) 閤成狀態。

    該函數在 Qt 5.2 引入。

    bool QtWin:: isCompositionOpaque ()

    返迴著色顔色是否為不透明融閤。

    該函數在 Qt 5.2 引入。

    bool QtWin:: isWindowExcludedFromPeek ( QWindow * window )

    返迴 true 若指定 window 被排除從 Aero Peek。

    該函數在 Qt 5.2 引入。

    bool QtWin:: isWindowExcludedFromPeek ( QWidget * window )

    此函數重載 QtWin::isWindowExcludedFromPeek ().

    該函數在 Qt 5.2 引入。

    bool QtWin:: isWindowPeekDisallowed ( QWindow * window )

    Returns true if Aero Peek is disallowed on the thumbnail of the specified window .

    該函數在 Qt 5.2 引入。

    bool QtWin:: isWindowPeekDisallowed ( QWidget * window )

    此函數重載 QtWin::isWindowPeekDisallowed ().

    該函數在 Qt 5.2 引入。

    void QtWin:: markFullscreenWindow ( QWindow * window , bool fullscreen = true)

    標記指定 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 引入。

    void QtWin:: markFullscreenWindow ( QWidget * window , bool fullscreen = true)

    此函數重載 QtWin::markFullscreenWindow ().

    該函數在 Qt 5.2 引入。

    QColor QtWin:: realColorizationColor ()

    返迴由用戶設置的真實著色顔色,使用未文檔化注冊鍵。基於 API 的函數 getColorizationColor() 返迴融閤 Alpha 的顔色 (通常變成半透明灰色,而不是類似由用戶選取的顔色)。

    該函數在 Qt 5.2 引入。

    另請參閱 colorizationColor ().

    void QtWin:: resetExtendedFrame ( QWindow * window )

    重置玻璃框並還原 window 屬性。

    此方便函數調用 extendFrameIntoClientArea () 采用 0 邊距設置。

    注意: You must unset the Qt::WA_NoSystemBackground attribute for extendFrameIntoClientArea () 要工作。

    該函數在 Qt 5.2 引入。

    另請參閱 extendFrameIntoClientArea ().

    void QtWin:: resetExtendedFrame ( QWidget * window )

    此函數重載 QtWin::resetExtendedFrame ().

    該函數在 Qt 5.2 引入。

    void QtWin:: setCompositionEnabled ( bool enabled )

    設置 Windows 桌麵閤成是否為 enabled .

    注意: 底層函數在 Windows 8 聲明棄用,且無效。

    該函數在 Qt 5.2 引入。

    另請參閱 isCompositionEnabled ().

    void QtWin:: setCurrentProcessExplicitAppUserModelID (const QString & id )

    設置應用程序用戶模型 ID id .

    更多信息,見 應用程序用戶模型 ID .

    該函數在 Qt 5.2 引入。

    void QtWin:: setWindowDisallowPeek ( QWindow * window , bool disallow )

    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 引入。

    void QtWin:: setWindowDisallowPeek ( QWidget * window , bool disallow )

    此函數重載 QtWin::setWindowDisallowPeek ().

    該函數在 Qt 5.2 引入。

    void QtWin:: setWindowExcludedFromPeek ( QWindow * window , bool exclude )

    排除指定 window from Aero Peek if exclude 為 true。

    該函數在 Qt 5.2 引入。

    另請參閱 isWindowExcludedFromPeek ().

    void QtWin:: setWindowExcludedFromPeek ( QWidget * window , bool exclude )

    此函數重載 QtWin::setWindowExcludedFromPeek ().

    該函數在 Qt 5.2 引入。

    void QtWin:: setWindowFlip3DPolicy ( QWindow * window , WindowFlip3DPolicy policy )

    Sets the Flip3D policy policy 為指定 window .

    該函數在 Qt 5.2 引入。

    另請參閱 windowFlip3DPolicy ().

    void QtWin:: setWindowFlip3DPolicy ( QWidget * window , WindowFlip3DPolicy policy )

    此函數重載 QtWin::setWindowFlip3DPolicy ().

    該函數在 Qt 5.2 引入。

    QString QtWin:: stringFromHresult ( HRESULT hresult )

    Returns a message string that explains the hresult error id specified or an empty string if the explanation cannot be found.

    該函數在 Qt 5.2 引入。

    void QtWin:: taskbarActivateTab ( QWindow * window )

    Activates an item on the taskbar without activating the window 本身。

    該函數在 Qt 5.2 引入。

    void QtWin:: taskbarActivateTab ( QWidget * window )

    此函數重載 QtWin::taskbarActivateTab ().

    該函數在 Qt 5.2 引入。

    void QtWin:: taskbarActivateTabAlt ( QWindow * window )

    Marks the item that represents the specified window on the taskbar as active, but does not activate it visually.

    該函數在 Qt 5.2 引入。

    void QtWin:: taskbarActivateTabAlt ( QWidget * window )

    此函數重載 QtWin::taskbarActivateTabAlt ().

    該函數在 Qt 5.2 引入。

    void QtWin:: taskbarAddTab ( QWindow * window )

    Adds an item for the specified window to the taskbar.

    該函數在 Qt 5.2 引入。

    void QtWin:: taskbarAddTab ( QWidget * window )

    此函數重載 QtWin::taskbarAddTab ().

    該函數在 Qt 5.2 引入。

    void QtWin:: taskbarDeleteTab ( QWindow * window )

    移除指定 window from the taskbar.

    該函數在 Qt 5.2 引入。

    void QtWin:: taskbarDeleteTab ( QWidget * window )

    此函數重載 QtWin::taskbarDeleteTab ().

    該函數在 Qt 5.2 引入。

    HBITMAP QtWin:: toHBITMAP (const QPixmap & p , HBitmapFormat format = HBitmapNoAlpha)

    創建 HBITMAP 相當於 QPixmap p , based on the given format 。返迴 HBITMAP 句柄。

    調用者負責釋放 HBITMAP 數據在使用後。

    該函數在 Qt 5.2 引入。

    另請參閱 fromHBITMAP ().

    HICON QtWin:: toHICON (const QPixmap & p )

    創建 HICON 相當於 QPixmap p 。返迴 HICON 句柄。

    調用者負責釋放 HICON 數據在使用後。

    該函數在 Qt 5.2 引入。

    另請參閱 fromHICON ().

    HRGN QtWin:: toHRGN (const QRegion & region )

    Returns a HRGN that is equivalent to the given region .

    該函數在 Qt 5.2 引入。

    WindowFlip3DPolicy QtWin:: windowFlip3DPolicy ( QWindow * window )

    Returns the current Flip3D policy for the specified window .

    該函數在 Qt 5.2 引入。

    另請參閱 setWindowFlip3DPolicy ().

    WindowFlip3DPolicy QtWin:: windowFlip3DPolicy ( QWidget * window )

    此函數重載 QtWin::windowFlip3DPolicy ().

    該函數在 Qt 5.2 引入。