DtkWidget
DTK Widget module
|
The DMainWindow class provides a main application window. 更多...
Public 槽 | |
void | setWindowRadius (int windowRadius) |
DMainWindow::setWindowRadius 设定窗口的圆角 windowRadius 窗口的圆角值 | |
void | setBorderWidth (int borderWidth) |
DMainWindow::setBorderWidth 设定边框的宽度 borderWidth 边框的宽度 | |
void | setBorderColor (const QColor &borderColor) |
DMainWindow::setBorderColor 设定边框的颜色 borderColor 边框的颜色 | |
void | setShadowRadius (int shadowRadius) |
DMainWindow::setShadowRadius 设定阴影区域的圆角 shadowRadius 阴影区域圆角大小 | |
void | setShadowOffset (const QPoint &shadowOffset) |
DMainWindow::setShadowOffset 设定阴影区域的偏移距离 shadowOffset 阴影区域的偏移距离 | |
void | setShadowColor (const QColor &shadowColor) |
DMainWindow::setShadowColor 设定阴影的颜色 shadowColor 阴影的颜色 | |
void | setClipPath (const QPainterPath &clipPath) |
DMainWindow::setClipPath 设定裁剪路径 clipPath 裁剪的路径 | |
void | setFrameMask (const QRegion &frameMask) |
DMainWindow::setFrameMask 设定边框的mask区域 frameMask mask区域 | |
void | setTranslucentBackground (bool translucentBackground) |
DMainWindow::setTranslucentBackground 设定时候擦除背景 translucentBackground true擦除背景 false不擦除背景 | |
void | setEnableSystemResize (bool enableSystemResize) |
DMainWindow::setEnableSystemResize 设定是否允许系统调整窗口大小 enableSystemResize true允许系统调整 false不允许系统调整 | |
void | setEnableSystemMove (bool enableSystemMove) |
DMainWindow::setEnableSystemMove 设定时候允许系统移动窗口 enableSystemMove true允许移动 false不允许移动 | |
void | setEnableBlurWindow (bool enableBlurWindow) |
DMainWindow::setEnableBlurWindow 设置窗口模糊效果 开启此功能请设置setAttribute(Qt::WA_TranslucentBackground) enableBlurWindow true开启模糊效果 false关闭模糊效果 | |
void | setAutoInputMaskByClipPath (bool autoInputMaskByClipPath) |
通过裁剪区域自动设定mask. | |
void | sendMessage (const QIcon &icon, const QString &message) |
发送浮动消息. | |
void | sendMessage (DFloatingMessage *message) |
发送浮动消息. | |
void | setTitlebarShadowEnabled (bool titlebarShadowEnabled) |
Public 成员函数 | |
DMainWindow (QWidget *parent=0) | |
DMainWindow::DMainWindow constructs an instance of DMainWindow parent is passed to QMainWindow construtor. | |
DTitlebar * | titlebar () const |
DMainWindow::titlebar | |
void | setSidebarWidget (QWidget *widget) |
QWidget * | sidebarWidget () |
int | sidebarWidth () const |
void | setSidebarWidth (int width) |
bool | sidebarVisible () const |
void | setSidebarVisible (bool visible) |
bool | sidebarExpanded () const |
void | setSidebarExpanded (bool expended) |
bool | isDXcbWindow () const |
DMainWindow::isDXcbWindow | |
int | windowRadius () const |
int | borderWidth () const |
QColor | borderColor () const |
int | shadowRadius () const |
QPoint | shadowOffset () const |
QColor | shadowColor () const |
QPainterPath | clipPath () const |
QRegion | frameMask () const |
QMargins | frameMargins () const |
bool | translucentBackground () const |
bool | enableSystemResize () const |
DMainWindow::enableSystemResize | |
bool | enableSystemMove () const |
bool | enableBlurWindow () const |
bool | autoInputMaskByClipPath () const |
bool | titlebarShadowIsEnabled () const |
Protected 成员函数 | |
DMainWindow (DMainWindowPrivate &dd, QWidget *parent=0) | |
void | mouseMoveEvent (QMouseEvent *event) override |
void | resizeEvent (QResizeEvent *event) override |
void | changeEvent (QEvent *event) override |
属性 | |
int | windowRadius |
This property holds the radius of the main window. | |
int | borderWidth |
This property holds the width of the main window's border. | |
QColor | borderColor |
This property holds the color of the main window's border. | |
int | shadowRadius |
This property holds the shadow radius of the main widnow. | |
QPoint | shadowOffset |
This property holds the offset applied on the window shadow. | |
QColor | shadowColor |
This property holds the color of the window shadow. | |
QPainterPath | clipPath |
This property holds the custom QPainterPath to be used to clip the window. | |
QRegion | frameMask |
This property holds the mask to be applied on the window. | |
QMargins | frameMargins |
bool | translucentBackground |
This property holds whether the window has translucent background. | |
bool | enableSystemResize |
此属性保留是否可以由用户调整窗口大小。此属性的默认值是正确的。您可以将此属性设置为false并实现此属性的调整窗口大小 | |
bool | enableSystemMove |
This property holds whether the window can be moved by the user. | |
bool | enableBlurWindow |
This property holds whether the window background is blurred. | |
bool | autoInputMaskByClipPath |
This property holds whether the user input is masked by the clip path. | |
bool | titlebarShadowEnabled |
titleBar阴影属性. | |
The DMainWindow class provides a main application window.
DMainWindow类提供了一个主应用程序窗口,主窗口为构建应用程序的用户提供了一个框架 界面。与Qmainwindow相比,DmainWindow具有自己的布局它只有标题栏和内容区域,更简单。 开发人员可以提供自定义的标题栏和内容,以使应用功能丰富。
\inmodule dtkwidget
A main window provides a framework for building an application's user interface. DMainWindow has its own layout compared to QMainWindow, it has only title bar and content area, simpler and cleaner.
Developers can provide customized title bar and content to make the application rich functional.
DMainWindow类提供了一个主应用程序窗口,主窗口为构建应用程序的用户提供了一个框架 界面。与Qmainwindow相比,DmainWindow具有自己的布局它只有标题栏和内容区域,更简单。 开发人员可以提供自定义的标题栏和内容,以使应用功能丰富。
使用如下代码显示一个最简单的DMainWindow窗口:
以上例子运行结果如下:
点击菜单栏About弹出关于对话框,关于对话框具体参见daboutdialog,效果如下
bool Dtk::Widget::DMainWindow::enableSystemResize | ( | ) | const |
DMainWindow::enableSystemResize
The default value of this property is true.
You can set this property to false and implement the resize polizy of this window by you self.
DMainWindow::isDXcbWindow | ( | ) | const |
支持许多功能,例如背景模糊和窗口剪裁,仅当窗口使用DXCB QT平台插件时。
Many features like blurred background and window clipping are supported only if the window is using the dxcb Qt platform plugin.
|
slot |
发送浮动消息.
icon 消息展示图标 message 消息内容
|
slot |
发送浮动消息.
message DFloatingMessage消息
|
slot |
通过裁剪区域自动设定mask.
autoInputMaskByClipPath true自动设定 false不自动设定
|
slot |
|
slot |
|
slot |
|
slot |
DMainWindow::setEnableSystemMove 设定时候允许系统移动窗口 enableSystemMove true允许移动 false不允许移动
设定时候允许系统移动窗口
|
slot |
|
slot |
DMainWindow::setShadowOffset 设定阴影区域的偏移距离 shadowOffset 阴影区域的偏移距离
设定阴影区域的偏移距离
|
slot |
|
slot |
DMainWindow::setTranslucentBackground 设定时候擦除背景 translucentBackground true擦除背景 false不擦除背景
设定时候擦除背景
DMainWindow::titlebar | ( | ) | const |
为主窗口设置titlebar
dtitlebar
实例
|
readwrite |
This property holds whether the user input is masked by the clip path.
此属性是否将用户输入是否被剪辑路径掩盖,此属性的默认值是true
Sometimes you may want to handle events happening in the areas that are visually clipped by the setting DMainWindow::clipPath.
The default value of this property is true.
|
readwrite |
This property holds the color of the main window's border.
此属性具有主窗口边框的颜色
|
readwrite |
This property holds the width of the main window's border.
该属性拥有主窗边框的宽度
|
readwrite |
This property holds the custom QPainterPath to be used to clip the window.
此属性保留了自定义QPainterPath来夹住窗口。默认DMAINWINDOW被剪辑为一个 转角矩形,但是您可以提供自定义的QPainterPath
来执行自定义形状的窗口
By default DMainWindow is clipped as a corner-rounded rectangle, but you can supply a custom QPainterPath to do custom shaped window.
|
readwrite |
This property holds whether the window background is blurred.
该属性是否有窗口背景是否模糊
|
readwrite |
This property holds whether the window can be moved by the user.
此属性保留用户是否可以移动窗口。此属性的默认值为true。您可以将此属性设置为false,并选择有效的区域拖动和移动
The default value of this property is true.
You can set this property to false and choose the effective area to drag and move.
|
readwrite |
This property holds the mask to be applied on the window.
此属性将蒙版贴在窗口上。对于更好的剪辑质量,例如抗质量,请改用属性dmainwindow :: clippath
For better clip quality, for example antialiasing, use property DMainWindow::clipPath instead.
|
readwrite |
This property holds the color of the window shadow.
此属性拥有窗户阴影的颜色
|
readwrite |
This property holds the offset applied on the window shadow.
此属性保存在窗户阴影上应用的偏移量
|
readwrite |
This property holds the shadow radius of the main widnow.
该属性拥有主窗口的阴影半径
|
readwrite |
titleBar阴影属性.
titleBar阴影属性,用于设置或者判断是否设置titleBar阴影属性
用于设置或者判断是否设置titleBar阴影属性.
DMainWindow::setWindowRadius 设定窗口的圆角
|
readwrite |
This property holds whether the window has translucent background.
该属性属于窗口是否具有半透明背景
|
readwrite |
This property holds the radius of the main window.
该属性保持主窗口的半径