DtkWidget 5.6.0.2
DTK Widget module
Public 槽 | 信号 | Public 成员函数 | Protected 成员函数 | 属性 | 所有成员列表
Dtk::Widget::DTitlebar类 参考

The DTitlebar class is an universal title bar on the top of windows. 更多...

类 Dtk::Widget::DTitlebar 继承关系图:
Inheritance graph
[图例]
Dtk::Widget::DTitlebar 的协作图:
Collaboration graph
[图例]

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()来获取已经自动初始化的标题栏, 不要自己来创建这个标题栏。

构造及析构函数说明

◆ DTitlebar()

Dtk::Widget::DTitlebar::DTitlebar ( QWidget *  parent = Q_NULLPTR)
explicit

This function provides to create an default widget with icon/title/ and buttons

创建一个DTitlebar对象,包含默认的窗口按钮.

parent 父控件指针

成员函数说明

◆ autoHideOnFullscreen()

bool Dtk::Widget::DTitlebar::autoHideOnFullscreen ( ) const

DTitlebar::autoHideOnFullscreen returns if titlebar show on fullscreen mode. separator of the titlebar.

全屏模式下标题栏是否自动隐藏.

◆ buttonAreaWidth()

int Dtk::Widget::DTitlebar::buttonAreaWidth ( ) const

DTitlebar::buttonAreaWidth returns the width of the area that all the window buttons occupies.

按钮区域大小,用于手动定位自定义控件时使用.

◆ customWidget()

QWidget * Dtk::Widget::DTitlebar::customWidget ( ) const

DTitlebar::customWidget

标题栏绑定的自定义控件

返回
the customized widget used in this title bar.
自定义控件

One can set customized widget to show some extra widgets on the title bar. 可以通过自定义控件来在标题栏上显示复杂的组合控件

参见
Dtk::Widget::DTitlebar::setCustomWidget()

◆ disableFlags()

Qt::WindowFlags Dtk::Widget::DTitlebar::disableFlags ( ) const

Return which button is disabled.

当前被禁用的按钮标志位.

返回
被禁用的窗口标志。

◆ menu()

QMenu * Dtk::Widget::DTitlebar::menu ( ) const

DTitlebar::menu holds the QMenu object attached to this title bar.

获取和标题栏关联的应用查询菜单.

返回
如该标题栏没有设置菜单,这里会返回空,但是如该使用 Dtk::Widget::DApplication , 那么这里一般会自动创建一个程序菜单。
the QMenu object it holds, returns null if there's no one set.

◆ menuIsDisabled()

bool Dtk::Widget::DTitlebar::menuIsDisabled ( ) const

菜单是否被禁用.

返回
true 菜单被禁用 false 菜单没有被禁用。

◆ menuIsVisible()

bool Dtk::Widget::DTitlebar::menuIsVisible ( ) const

菜单按钮的可视化.

返回
true 菜单可见 false菜单不可见.

◆ quitMenuIsDisabled()

bool Dtk::Widget::DTitlebar::quitMenuIsDisabled ( ) const

退出菜单是否被禁用.

返回
true 退出菜单被禁用 false退出菜单没有被禁用

◆ separatorVisible()

bool Dtk::Widget::DTitlebar::separatorVisible ( ) const

DTitlebar::separatorVisible returns the visibility of the bottom separator of the titlebar.

分隔线是否可见.

◆ setAutoHideOnFullscreen()

void Dtk::Widget::DTitlebar::setAutoHideOnFullscreen ( bool  autohide)

DTitlebar::setAutoHideOnFullscreen set if titlebar show when window is fullscreen state.

设置全屏模式下是否需要自动隐藏标题栏 autohide 是否自动隐藏

◆ setBackgroundTransparent

void Dtk::Widget::DTitlebar::setBackgroundTransparent ( bool  transparent)
slot

DTitlebar::setBackgroundTransparent set the title background transparent

设置标题栏背景是否透明,当为透明时标题栏直接叠加在下层控件上.

transparent is the targeting value. transparent 是否透明

◆ setCustomWidget()

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 是否需要自动修正控件位置,用于保持控件居中显示。

◆ setDisableFlags()

void Dtk::Widget::DTitlebar::setDisableFlags ( Qt::WindowFlags  flags)

This function provides to disable the button match flags.

设置需要被禁用的按钮,仅仅是在界面上禁用按钮,还是可以通过事件等机制来调用对应接口.

flags 需要被禁用的按钮标志位

◆ setEmbedMode()

void Dtk::Widget::DTitlebar::setEmbedMode ( bool  visible)

This function provides to set a titlebar is in parent.

设置为嵌入模式,而不是替换系统标题栏,用于不支持dxcb的平台.

visible 为 true 时,替换系统标题栏,否则隐藏系统标题栏。

◆ setFixedHeight

void Dtk::Widget::DTitlebar::setFixedHeight ( int  h)
slot

DTitlebar::setFixedHeight change the height of the title bar to another value.

设置标题栏的高度,默认高度为 50。

h 需要设置的高度 h is the target height.

◆ setIcon

void Dtk::Widget::DTitlebar::setIcon ( const QIcon &  icon)
slot

DTitlebar::setIcon sets the icon to be shown on the title bar.

设置标题栏图标

icon is to be used as the window icon. icon 待设置的图标

◆ setMenu()

void Dtk::Widget::DTitlebar::setMenu ( QMenu *  menu)

DTitlebar::setMenu attaches a QMenu object to the title bar.

设置自定义的程序菜单.

menu is the target menu. menu 需要被设置的菜单

◆ setMenuDisabled()

void Dtk::Widget::DTitlebar::setMenuDisabled ( bool  disabled)

设置菜单是否被禁用.

disabled true 菜单被禁用 false菜单没有被禁用。

◆ setMenuVisible()

void Dtk::Widget::DTitlebar::setMenuVisible ( bool  visible)

设置菜单是否可见.

visible true 菜单可见 false菜单不可见.

◆ setQuitMenuDisabled()

void Dtk::Widget::DTitlebar::setQuitMenuDisabled ( bool  disabled)

设置退出菜单是否被禁用.

disabled true 退出菜单被禁用 false退出菜单没有被禁用

◆ setQuitMenuVisible()

void Dtk::Widget::DTitlebar::setQuitMenuVisible ( bool  visible)

设置退出菜单是否可见.

visible true 退出菜单可见 false退出菜单不可见

◆ setSeparatorVisible

void Dtk::Widget::DTitlebar::setSeparatorVisible ( bool  visible)
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.

◆ setSwitchThemeMenuVisible()

void Dtk::Widget::DTitlebar::setSwitchThemeMenuVisible ( bool  visible)

设置切换主题菜单是否可见.

visible true 切换主题菜单可见 false 切换主题菜单不可见。

◆ setTitle

void Dtk::Widget::DTitlebar::setTitle ( const QString title)
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 待设置内容

◆ switchThemeMenuIsVisible()

bool Dtk::Widget::DTitlebar::switchThemeMenuIsVisible ( ) const

设置主题切换菜单的可视化.

返回
true 切换主题菜单可见 false切换主题菜单不可见

该类的文档由以下文件生成: