Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QWindowDecorationInterface Class Reference
[QtBaseModule]

The QWindowDecorationInterface class provides an interface for Qt Extended window decoration styles. More...

    #include <QWindowDecorationInterface>

Public Types

Public Functions


Detailed Description

The QWindowDecorationInterface class provides an interface for Qt Extended window decoration styles.

Window decoration styles may be added to Qt Extended via plug-ins. In order to write a style plug-in you must derive from the QWindowDecorationInterface class and implement the virtual functions.

The window being decorated is defined by the QWindowDecorationPlugin::WindowData struct:

    struct WindowData {
        const QWidget *window;
        QRect rect;
        QPalette palette;
        QString caption;
        enum Flags { Maximized=0x01, Dialog=0x02, Active=0x04 };
        Q_UINT32 flags;
        Q_UINT32 reserved;
    };

Window decorations are loaded by setting the Decoration setting in the Appearance group of Trolltech/qpe, for example:

        [Appearance]
        Decoration=mydecoration

To allow a QWindowDecorationInterface class to be created a plug-in class derived from QWindowDecorationPlugin should be implemented.

Note that Qt Extended includes a decoration plugin that allows basic theming, and this should be used in preference to custom decoration plugins.

See also QWindowDecorationPlugin.


Member Type Documentation

enum QWindowDecorationInterface::Area

ConstantValueDescription
QWindowDecorationInterface::Border0defines the entire decoration area, excluding the title bar.
QWindowDecorationInterface::Title1defines the area at the top of the window that contains the buttons and captions. It must extend the full width of the window.
QWindowDecorationInterface::TitleText2defines the window caption.

enum QWindowDecorationInterface::Button

ConstantValueDescription
QWindowDecorationInterface::OK0the OK button.
QWindowDecorationInterface::Close1the close button.
QWindowDecorationInterface::Help2the help button.
QWindowDecorationInterface::Maximize3the maximize/restore button.

enum QWindowDecorationInterface::Metric

ConstantValueDescription
QWindowDecorationInterface::TitleHeight0the height of the title.
QWindowDecorationInterface::LeftBorder1the width of the border on the left of the window.
QWindowDecorationInterface::RightBorder2the width of the border on the right of the window.
QWindowDecorationInterface::TopBorder3the width of the border on the top of the window, above the title bar.
QWindowDecorationInterface::BottomBorder4the width of the border on the bottom of the window.
QWindowDecorationInterface::OKWidth5the width of the OK button.
QWindowDecorationInterface::CloseWidth6the width of the Close (X) button.
QWindowDecorationInterface::HelpWidth7the width of the Help (?) button.
QWindowDecorationInterface::MaximizeWidth8the width of the maximize/restore button.
QWindowDecorationInterface::CornerGrabSize9the size of the area allowing diagonal resize at each corner of the window.


Member Function Documentation

void QWindowDecorationInterface::drawArea ( Area area, QPainter * p, const WindowData * wd ) const   [virtual]

Draw the specified area using QPainter p for the window defined by wd.

void QWindowDecorationInterface::drawButton ( Button button, QPainter * painter, const WindowData * wd, int x, int y, int w, int h, QDecoration::DecorationState state ) const   [virtual]

Draw button with QPainter painter for the window defined by wd within the bounds supplied by x, y, w, h in the specified state.

QPixmap QWindowDecorationInterface::icon () const   [pure virtual]

Returns the icon of the decoration. This may be displayed in the appearance settings dialog.

QRegion QWindowDecorationInterface::mask ( const WindowData * wd ) const   [virtual]

Returns the mask of the decoration including all borders and the title for the window defined by wd as a QRegion. The window decorations do not necessarily need to be rectangular, however the title bar must be rectangular and must be the width of the window. This ensures the title is drawn correctly for maximized windows.

int QWindowDecorationInterface::metric ( Metric metric, const WindowData * wd ) const   [virtual]

Returns the metric for the window defined by wd.

QString QWindowDecorationInterface::name () const   [pure virtual]

Returns the name of the decoration. This will be displayed in the appearance settings dialog.


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3