返回介绍

QWSDecoration Class

发布于 2019-10-04 15:04:08 字数 5387 浏览 878 评论 0 收藏 0

The QWSDecoration class allows the appearance of the Qt/Embedded Window Manager to be customized. More...

#include <qwsdecoration_qws.h>

List of all member functions.

Public Members

  • QWSDecoration ()
  • virtual ~QWSDecoration ()
  • enum Region { None = 0, All = 1, Title = 2, Top = 3, Bottom = 4, Left = 5, Right = 6, TopLeft = 7, TopRight = 8, BottomLeft = 9, BottomRight = 10, Close = 11, Minimize = 12, Maximize = 13, Normalize = 14, Menu = 15, LastRegion = Menu }
  • virtual QRegion region ( constQWidget*widget, constQRect&rect, Regiontype = All ) = 0
  • virtual void close ( QWidget*widget )
  • virtual void minimize ( QWidget*widget )
  • virtual void maximize ( QWidget*widget )
  • virtual QPopupMenu * menu ( const QWidget *, const QPoint & )
  • virtual void paint ( QPainter*painter, constQWidget*widget ) = 0
  • virtual void paintButton ( QPainter*painter, constQWidget*widget, Regiontype, intstate ) = 0

Detailed Description

The QWSDecoration class allows the appearance of the Qt/Embedded Window Manager to be customized.

Qt/Embedded provides window management to top level windows. The appearance of the borders and buttons (the decoration) around the managed windows can be customized by creating your own class derived from QWSDecoration and overriding a few methods.

This class is non-portable. It is available only in Qt/Embedded.

See also QApplication::qwsSetDecoration() and Qt/Embedded.


Member Type Documentation

QWSDecoration::Region

This enum describes the regions in the window decorations.

  • QWSDecoration::None - used internally.
  • QWSDecoration::All - the entire region used by the window decoration.
  • QWSDecoration::Title - Displays the window title and allows the window to be moved by dragging.
  • QWSDecoration::Top - allows the top of the window to be resized.
  • QWSDecoration::Bottom - allows the bottom of the window to be resized.
  • QWSDecoration::Left - allows the left edge of the window to be resized.
  • QWSDecoration::Right - allows the right edge of the window to be resized.
  • QWSDecoration::TopLeft - allows the top-left of the window to be resized.
  • QWSDecoration::TopRight - allows the top-right of the window to be resized.
  • QWSDecoration::BottomLeft - allows the bottom-left of the window to be resized.
  • QWSDecoration::BottomRight - allows the bottom-right of the window to be resized.
  • QWSDecoration::Close - clicking in this region closes the window.
  • QWSDecoration::Minimize - clicking in this region minimizes the window.
  • QWSDecoration::Maximize - clicking in this region maximizes the window.
  • QWSDecoration::Normalize - returns a maximized window to previous size.
  • QWSDecoration::Menu - clicking in this region opens the window operations menu.

Member Function Documentation

QWSDecoration::QWSDecoration ()

Constructs a decorator.

QWSDecoration::~QWSDecoration () [virtual]

Destroys a decorator.

void QWSDecoration::close ( QWidget*widget ) [virtual]

Called when the user clicks in the Close region.

widget is the QWidget to be closed.

The default behaviour is to close the widget.

void QWSDecoration::maximize ( QWidget*widget ) [virtual]

Called when the user clicks in the Maximize region.

widget is the QWidget to be maximized.

The default behaviour is to resize the widget to be full-screen. This method can be overridden to, e.g. avoid launch panels.

QPopupMenu* QWSDecoration::menu ( constQWidget*, constQPoint& ) [virtual]

Called to create a QPopupMenu containing the valid menu operations.

The default implementation adds all possible window operations.

void QWSDecoration::minimize ( QWidget*widget ) [virtual]

Called when the user clicks in the Minimize region.

widget is the QWidget to be minimized.

The default behaviour is to ignore this action.

void QWSDecoration::paint ( QPainter*painter, constQWidget*widget ) [pure virtual]

Override to paint the border and title decoration around widget using painter.

void QWSDecoration::paintButton ( QPainter*painter, constQWidget*widget, Regiontype, intstate ) [pure virtual]

Override to paint a button type using painter.

widget is the widget whose button is to be drawn. state is the state of the button. It can be a combination of the following ORed together:

  • QWSButton::MouseOver
  • QWSButton::Clicked
  • QWSButton::On

QRegion QWSDecoration::region ( constQWidget*widget, constQRect&rect, Regiontype = All ) [pure virtual]

Returns the requested region type which will contain widget with geometry rect.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文