DtkWidget 5.6.0.2
DTK Widget module
|
The DTitlebar class is an universal title bar on the top of windows. 更多...
Public 槽 | |
void | setFixedHeight (int h) |
DTitlebar::setFixedHeight change the height of the title bar to another value. 更多... | |
void | setBackgroundTransparent (bool transparent) |
DTitlebar::setBackgroundTransparent set the title background transparent 更多... | |
void | setSeparatorVisible (bool visible) |
DTitlebar::setSeparatorVisible sets the bottom separator of the title bar and the window contents to be visible or not. 更多... | |
void | setTitle (const QString &title) |
DTitlebar::setTitle sets the title to be shown on the title bar. 更多... | |
void | setIcon (const QIcon &icon) |
DTitlebar::setIcon sets the icon to be shown on the title bar. 更多... | |
void | toggleWindowState () |
Maximized/Minumized | |
void | setBlurBackground (bool blurBackground) |
信号 | |
void | optionClicked () |
void | doubleClicked () |
void | mousePressed (Qt::MouseButtons buttons) |
void | mouseMoving (Qt::MouseButton button) |
Public 成员函数 | |
DTitlebar (QWidget *parent=Q_NULLPTR) | |
This function provides to create an default widget with icon/title/ and buttons 更多... | |
QMenu * | menu () const |
DTitlebar::menu holds the QMenu object attached to this title bar. 更多... | |
void | setMenu (QMenu *menu) |
DTitlebar::setMenu attaches a QMenu object to the title bar. 更多... | |
QWidget * | customWidget () const |
DTitlebar::customWidget 更多... | |
void | setCustomWidget (QWidget *, bool fixCenterPos=false) |
DTitlebar::setCustomWidget is an overloaded function. 更多... | |
void | addWidget (QWidget *w, Qt::Alignment alignment=Qt::Alignment()) |
void | removeWidget (QWidget *w) |
int | buttonAreaWidth () const |
DTitlebar::buttonAreaWidth returns the width of the area that all the window buttons occupies. 更多... | |
bool | separatorVisible () const |
DTitlebar::separatorVisible returns the visibility of the bottom separator of the titlebar. 更多... | |
bool | autoHideOnFullscreen () const |
DTitlebar::autoHideOnFullscreen returns if titlebar show on fullscreen mode. separator of the titlebar. 更多... | |
void | setAutoHideOnFullscreen (bool autohide) |
DTitlebar::setAutoHideOnFullscreen set if titlebar show when window is fullscreen state. 更多... | |
virtual void | setVisible (bool visible) Q_DECL_OVERRIDE |
void | setEmbedMode (bool embed) |
This function provides to set a titlebar is in parent. 更多... | |
bool | menuIsVisible () const |
菜单按钮的可视化. 更多... | |
void | setMenuVisible (bool visible) |
设置菜单是否可见. 更多... | |
bool | menuIsDisabled () const |
菜单是否被禁用. 更多... | |
void | setMenuDisabled (bool disabled) |
设置菜单是否被禁用. 更多... | |
bool | quitMenuIsDisabled () const |
退出菜单是否被禁用. 更多... | |
void | setQuitMenuDisabled (bool disabled) |
设置退出菜单是否被禁用. 更多... | |
void | setQuitMenuVisible (bool visible) |
设置退出菜单是否可见. 更多... | |
bool | switchThemeMenuIsVisible () const |
设置主题切换菜单的可视化. 更多... | |
void | setSwitchThemeMenuVisible (bool visible) |
设置切换主题菜单是否可见. 更多... | |
void | setDisableFlags (Qt::WindowFlags flags) |
This function provides to disable the button match flags. 更多... | |
Qt::WindowFlags | disableFlags () const |
Return which button is disabled. 更多... | |
void | setSplitScreenEnabled (bool enabled) |
bool | splitScreenIsEnabled () const |
virtual QSize | sizeHint () const override |
virtual QSize | minimumSizeHint () const override |
bool | blurBackground () const |
void | setFullScreenButtonVisible (bool enabled) |
Protected 成员函数 | |
bool | eventFilter (QObject *obj, QEvent *event) Q_DECL_OVERRIDE |
bool | event (QEvent *e) override |
void | showEvent (QShowEvent *event) Q_DECL_OVERRIDE |
void | mousePressEvent (QMouseEvent *event) Q_DECL_OVERRIDE |
void | mouseReleaseEvent (QMouseEvent *event) Q_DECL_OVERRIDE |
void | mouseMoveEvent (QMouseEvent *event) Q_DECL_OVERRIDE |
void | mouseDoubleClickEvent (QMouseEvent *event) Q_DECL_OVERRIDE |
void | resizeEvent (QResizeEvent *event) Q_DECL_OVERRIDE |
属性 | |
bool | blurBackground |
The DTitlebar class is an universal title bar on the top of windows.
\inmodule dtkwidget
Dtitlebar是Dtk程序通用的标题栏组件,用于实现标题栏的高度定制化.
parent is the parent widget to be attached on. 父组件,一般为标题栏所在的窗口
Usually you don't need to construct a DTitlebar instance by your self, you can get an DTitlebar instance by DMainWindow::titlebar . 一般情况下,请使用Dtk::Widget::DMainWindow::titlebar()来获取已经自动初始化的标题栏, 不要自己来创建这个标题栏。
|
explicit |
This function provides to create an default widget with icon/title/ and buttons
创建一个DTitlebar对象,包含默认的窗口按钮.
parent 父控件指针
bool Dtk::Widget::DTitlebar::autoHideOnFullscreen | ( | ) | const |
DTitlebar::autoHideOnFullscreen returns if titlebar show on fullscreen mode. separator of the titlebar.
全屏模式下标题栏是否自动隐藏.
int Dtk::Widget::DTitlebar::buttonAreaWidth | ( | ) | const |
DTitlebar::buttonAreaWidth returns the width of the area that all the window buttons occupies.
按钮区域大小,用于手动定位自定义控件时使用.
QWidget * Dtk::Widget::DTitlebar::customWidget | ( | ) | const |
标题栏绑定的自定义控件
One can set customized widget to show some extra widgets on the title bar. 可以通过自定义控件来在标题栏上显示复杂的组合控件
Qt::WindowFlags Dtk::Widget::DTitlebar::disableFlags | ( | ) | const |
Return which button is disabled.
当前被禁用的按钮标志位.
QMenu * Dtk::Widget::DTitlebar::menu | ( | ) | const |
DTitlebar::menu holds the QMenu object attached to this title bar.
获取和标题栏关联的应用查询菜单.
bool Dtk::Widget::DTitlebar::menuIsDisabled | ( | ) | const |
菜单是否被禁用.
bool Dtk::Widget::DTitlebar::menuIsVisible | ( | ) | const |
菜单按钮的可视化.
bool Dtk::Widget::DTitlebar::quitMenuIsDisabled | ( | ) | const |
退出菜单是否被禁用.
bool Dtk::Widget::DTitlebar::separatorVisible | ( | ) | const |
DTitlebar::separatorVisible returns the visibility of the bottom separator of the titlebar.
分隔线是否可见.
void Dtk::Widget::DTitlebar::setAutoHideOnFullscreen | ( | bool | autohide | ) |
DTitlebar::setAutoHideOnFullscreen set if titlebar show when window is fullscreen state.
设置全屏模式下是否需要自动隐藏标题栏 autohide 是否自动隐藏
|
slot |
DTitlebar::setBackgroundTransparent set the title background transparent
设置标题栏背景是否透明,当为透明时标题栏直接叠加在下层控件上.
transparent is the targeting value. transparent 是否透明
void Dtk::Widget::DTitlebar::setCustomWidget | ( | QWidget * | w, |
bool | fixCenterPos = false |
||
) |
DTitlebar::setCustomWidget is an overloaded function.
设置标题栏上的自定义控件.
w is the widget to be used as the customize widget shown in the title bar. fixCenterPos indicates whether it should automatically move the customize widget to the horizontal center of the title bar or not.
w 需要显示的控件。 fixCenterPos 是否需要自动修正控件位置,用于保持控件居中显示。
void Dtk::Widget::DTitlebar::setDisableFlags | ( | Qt::WindowFlags | flags | ) |
This function provides to disable the button match flags.
设置需要被禁用的按钮,仅仅是在界面上禁用按钮,还是可以通过事件等机制来调用对应接口.
flags 需要被禁用的按钮标志位
void Dtk::Widget::DTitlebar::setEmbedMode | ( | bool | visible | ) |
This function provides to set a titlebar is in parent.
设置为嵌入模式,而不是替换系统标题栏,用于不支持dxcb的平台.
visible 为 true 时,替换系统标题栏,否则隐藏系统标题栏。
|
slot |
DTitlebar::setFixedHeight change the height of the title bar to another value.
设置标题栏的高度,默认高度为 50。
h 需要设置的高度 h is the target height.
|
slot |
DTitlebar::setIcon sets the icon to be shown on the title bar.
设置标题栏图标
icon is to be used as the window icon. icon 待设置的图标
void Dtk::Widget::DTitlebar::setMenu | ( | QMenu * | menu | ) |
DTitlebar::setMenu attaches a QMenu object to the title bar.
设置自定义的程序菜单.
menu is the target menu. menu 需要被设置的菜单
void Dtk::Widget::DTitlebar::setMenuDisabled | ( | bool | disabled | ) |
设置菜单是否被禁用.
disabled true 菜单被禁用 false菜单没有被禁用。
void Dtk::Widget::DTitlebar::setMenuVisible | ( | bool | visible | ) |
设置菜单是否可见.
visible true 菜单可见 false菜单不可见.
void Dtk::Widget::DTitlebar::setQuitMenuDisabled | ( | bool | disabled | ) |
设置退出菜单是否被禁用.
disabled true 退出菜单被禁用 false退出菜单没有被禁用
void Dtk::Widget::DTitlebar::setQuitMenuVisible | ( | bool | visible | ) |
设置退出菜单是否可见.
visible true 退出菜单可见 false退出菜单不可见
|
slot |
DTitlebar::setSeparatorVisible sets the bottom separator of the title bar and the window contents to be visible or not.
设置菜单下面的分隔线是否可见,默认是可见的。
visible 是否可见 visible is the targeting value.
void Dtk::Widget::DTitlebar::setSwitchThemeMenuVisible | ( | bool | visible | ) |
设置切换主题菜单是否可见.
visible true 切换主题菜单可见 false 切换主题菜单不可见。
|
slot |
DTitlebar::setTitle sets the title to be shown on the title bar.
设置标题栏文本。
title is the text to be used as the window title. title 待设置内容
bool Dtk::Widget::DTitlebar::switchThemeMenuIsVisible | ( | ) | const |
设置主题切换菜单的可视化.