DtkWidget 5.6.0.2
DTK Widget module
|
DTabBar 是一个标签栏控件,是在 QTabBar 基础之上进行扩展增强. 更多...
Public 槽 | |
void | setCurrentIndex (int index) |
设置当前标签索引位置. 更多... | |
void | setVisibleAddButton (bool visibleAddButton) |
设置新建标签按钮是否显示. 更多... | |
void | setStartDragDistance (int startDragDistance) |
设置开始拖动距离. 更多... | |
void | setMaskColor (QColor maskColor) |
设置颜色. 更多... | |
void | setFlashColor (QColor flashColor) |
void | startDrag (int index) |
void | stopDrag (Qt::DropAction action) |
信号 | |
void | currentChanged (int index) |
当前索引位置改变. 更多... | |
void | tabCloseRequested (int index) |
点击关闭后发出. 更多... | |
void | tabMoved (int from, int to) |
索引位置发生变化 更多... | |
void | tabIsInserted (int index) |
新标签已插入. 更多... | |
void | tabIsRemoved (int index) |
标签已删除. 更多... | |
void | tabBarClicked (int index) |
点击索引标签. 更多... | |
void | tabBarDoubleClicked (int index) |
双击索引标签. 更多... | |
void | tabAddRequested () |
新标签加入. | |
void | tabReleaseRequested (int index) |
索引标签鼠标释放. 更多... | |
void | tabDroped (int index, Qt::DropAction action, QObject *target) |
标签拖放. 更多... | |
void | dragActionChanged (Qt::DropAction action) |
鼠标形状发生变化. 更多... | |
void | dragStarted () |
开始拖起. | |
void | dragEnd (Qt::DropAction action) |
拖放结束. 更多... | |
Public 成员函数 | |
DTabBar (QWidget *parent=0) | |
void | setTabMinimumSize (int index, const QSize &size) |
设置索引标签的最小尺寸. 更多... | |
void | setTabMaximumSize (int index, const QSize &size) |
设置索引标签的最大尺寸. 更多... | |
bool | visibleAddButton () const |
新建标签栏按钮是否可见. 更多... | |
QTabBar::Shape | shape () const |
标签栏形状. 更多... | |
void | setShape (QTabBar::Shape shape) |
设置标签栏形状. 更多... | |
int | addTab (const QString &text) |
添加一个新的标签,返回新标签的索引. 更多... | |
int | addTab (const QIcon &icon, const QString &text) |
添加一个新的标签,包含图标、文本. 更多... | |
int | insertTab (int index, const QString &text) |
插入一个文本标签. 更多... | |
int | insertTab (int index, const QIcon &icon, const QString &text) |
插入一个图标文本标签. 更多... | |
void | removeTab (int index) |
移除标签索引位置 更多... | |
void | moveTab (int from, int to) |
移动标签索引位置 更多... | |
bool | isTabEnabled (int index) const |
是否启用标签索引位置 更多... | |
void | setTabEnabled (int index, bool) |
设置标签索引位置启用状态 更多... | |
QString | tabText (int index) const |
返回标签索引位置文本. 更多... | |
void | setTabText (int index, const QString &text) |
设置标签索引位置文本. 更多... | |
QIcon | tabIcon (int index) const |
返回标签索引位置图标. 更多... | |
void | setTabIcon (int index, const QIcon &icon) |
设置标签索引位置图标. 更多... | |
Qt::TextElideMode | elideMode () const |
缩略模式. 更多... | |
void | setElideMode (Qt::TextElideMode mode) |
设置缩略模式 更多... | |
void | setTabToolTip (int index, const QString &tip) |
设置标签索引位置提示文本. 更多... | |
QString | tabToolTip (int index) const |
返回标签索引位置提示文本. 更多... | |
void | setTabWhatsThis (int index, const QString &text) |
QString | tabWhatsThis (int index) const |
void | setTabData (int index, const QVariant &data) |
设置标签索引位置数据. 更多... | |
QVariant | tabData (int index) const |
返回标签索引位置数据. 更多... | |
QRect | tabRect (int index) const |
返回标签索引位置矩形. 更多... | |
int | tabAt (const QPoint &pos) const |
根据位置返回标签索引位置. 更多... | |
int | currentIndex () const |
当前的标签索引位置. 更多... | |
int | count () const |
标签总数. 更多... | |
void | setDrawBase (bool drawTheBase) |
bool | drawBase () const |
QSize | iconSize () const |
图标大小. 更多... | |
void | setIconSize (const QSize &size) |
设置图标大小. 更多... | |
bool | usesScrollButtons () const |
void | setUsesScrollButtons (bool useButtons) |
bool | tabsClosable () const |
标签栏是否可关闭. 更多... | |
void | setTabsClosable (bool closable) |
设置标签栏是否可关闭. 更多... | |
void | setTabButton (int index, QTabBar::ButtonPosition position, QWidget *widget) |
QWidget * | tabButton (int index, QTabBar::ButtonPosition position) const |
QTabBar::SelectionBehavior | selectionBehaviorOnRemove () const |
void | setSelectionBehaviorOnRemove (QTabBar::SelectionBehavior behavior) |
bool | expanding () const |
void | setExpanding (bool enabled) |
bool | isMovable () const |
void | setMovable (bool movable) |
bool | isDragable () const |
void | setDragable (bool dragable) |
bool | documentMode () const |
void | setDocumentMode (bool set) |
bool | autoHide () const |
void | setAutoHide (bool hide) |
bool | changeCurrentOnDrag () const |
void | setChangeCurrentOnDrag (bool change) |
int | startDragDistance () const |
QColor | maskColor () const |
QColor | flashColor () const |
QWindow * | dragIconWindow () const |
void | setEnabledEmbedStyle (bool enable) |
启用直角样式的 Tabbar. 更多... | |
void | setTabLabelAlignment (Qt::Alignment alignment) |
设置 tab 标签文字对齐方式. 更多... | |
Protected 成员函数 | |
void | dragEnterEvent (QDragEnterEvent *e) override |
void | dragLeaveEvent (QDragLeaveEvent *e) override |
void | dragMoveEvent (QDragMoveEvent *e) override |
void | dropEvent (QDropEvent *e) override |
void | resizeEvent (QResizeEvent *e) override |
void | startTabFlash (int index) |
virtual void | paintTab (QPainter *painter, int index, const QStyleOptionTab &option) const |
virtual QPixmap | createDragPixmapFromTab (int index, const QStyleOptionTab &option, QPoint *hotspot) const |
virtual QMimeData * | createMimeDataFromTab (int index, const QStyleOptionTab &option) const |
virtual bool | canInsertFromMimeData (int index, const QMimeData *source) const |
virtual void | insertFromMimeData (int index, const QMimeData *source) |
virtual void | insertFromMimeDataOnDragEnter (int index, const QMimeData *source) |
virtual void | tabInserted (int index) |
virtual void | tabLayoutChange () |
virtual void | tabRemoved (int index) |
virtual QSize | tabSizeHint (int index) const |
virtual QSize | minimumTabSizeHint (int index) const |
virtual QSize | maximumTabSizeHint (int index) const |
属性 | |
bool | visibleAddButton |
QTabBar::Shape | shape |
int | currentIndex |
int | count |
bool | drawBase |
QSize | iconSize |
Qt::TextElideMode | elideMode |
bool | usesScrollButtons |
bool | tabsClosable |
QTabBar::SelectionBehavior | selectionBehaviorOnRemove |
bool | expanding |
bool | movable |
bool | dragable |
bool | documentMode |
bool | autoHide |
bool | changeCurrentOnDrag |
int | startDragDistance |
QColor | maskColor |
QColor | flashColor |
友元 | |
class | DTabBarPrivate |
DTabBar 是一个标签栏控件,是在 QTabBar 基础之上进行扩展增强.
\inmodule dtkwidget
增加了许多特性,比如:新建按钮,支持向外拖放事件...该控件目前被深度编辑器中所使用。
int Dtk::Widget::DTabBar::addTab | ( | const QIcon & | icon, |
const QString & | text | ||
) |
添加一个新的标签,包含图标、文本.
icon 新标签的标题图标, text 新标签的标题文本.
int Dtk::Widget::DTabBar::addTab | ( | const QString & | text | ) |
添加一个新的标签,返回新标签的索引.
text 新标签的标题文本.
int Dtk::Widget::DTabBar::count | ( | ) | const |
标签总数.
|
signal |
当前索引位置改变.
index 改变的索引值.
int Dtk::Widget::DTabBar::currentIndex | ( | ) | const |
当前的标签索引位置.
|
signal |
鼠标形状发生变化.
action 改变的拖拽动作.
|
signal |
拖放结束.
action 拖放动作.
Qt::TextElideMode Dtk::Widget::DTabBar::elideMode | ( | ) | const |
缩略模式.
QSize Dtk::Widget::DTabBar::iconSize | ( | ) | const |
图标大小.
int Dtk::Widget::DTabBar::insertTab | ( | int | index, |
const QIcon & | icon, | ||
const QString & | text | ||
) |
插入一个图标文本标签.
index 被插入的标签索引值,icon 新标签的图标,text 新标签文本
int Dtk::Widget::DTabBar::insertTab | ( | int | index, |
const QString & | text | ||
) |
插入一个文本标签.
index 被插入的标签索引值, text 新标签的标题文本.
bool Dtk::Widget::DTabBar::isTabEnabled | ( | int | index | ) | const |
是否启用标签索引位置
index 标签索引值.
void Dtk::Widget::DTabBar::moveTab | ( | int | from, |
int | to | ||
) |
移动标签索引位置
from 被移动前的标签索引,to 被移动后的标签索引.
void Dtk::Widget::DTabBar::removeTab | ( | int | index | ) |
移除标签索引位置
index 被移除的标签索引值.
|
slot |
设置当前标签索引位置.
index 标签索引.
void Dtk::Widget::DTabBar::setElideMode | ( | Qt::TextElideMode | mode | ) |
设置缩略模式
mode 文本缩略模式.
void Dtk::Widget::DTabBar::setEnabledEmbedStyle | ( | bool | enable | ) |
启用直角样式的 Tabbar.
此风格适用于切换窗口的操作,多用于支持多开的应用.
enable true 启用,false 恢复
void Dtk::Widget::DTabBar::setIconSize | ( | const QSize & | size | ) |
设置图标大小.
size 图标大小.
|
slot |
设置颜色.
maskColor 遮罩颜色.
void Dtk::Widget::DTabBar::setShape | ( | QTabBar::Shape | shape | ) |
设置标签栏形状.
shape 标签栏形状.
|
slot |
设置开始拖动距离.
startDragDistance 开始拖动的距离.
void Dtk::Widget::DTabBar::setTabData | ( | int | index, |
const QVariant & | data | ||
) |
设置标签索引位置数据.
index 标签索引, data 标签数据.
void Dtk::Widget::DTabBar::setTabEnabled | ( | int | index, |
bool | enable | ||
) |
设置标签索引位置启用状态
index 标签索引,enable 是否启用.
void Dtk::Widget::DTabBar::setTabIcon | ( | int | index, |
const QIcon & | icon | ||
) |
设置标签索引位置图标.
index 标签索引, icon 对应的标签图标.
void Dtk::Widget::DTabBar::setTabLabelAlignment | ( | Qt::Alignment | alignment | ) |
设置 tab 标签文字对齐方式.
alignment 对齐方式.
void Dtk::Widget::DTabBar::setTabMaximumSize | ( | int | index, |
const QSize & | size | ||
) |
设置索引标签的最大尺寸.
index 被设置标签的索引值,size ,size 最大大小.
void Dtk::Widget::DTabBar::setTabMinimumSize | ( | int | index, |
const QSize & | size | ||
) |
设置索引标签的最小尺寸.
index 被设置标签的索引值,size ,size 最小大小.
void Dtk::Widget::DTabBar::setTabsClosable | ( | bool | closable | ) |
设置标签栏是否可关闭.
closable 标签是否可关闭.
void Dtk::Widget::DTabBar::setTabText | ( | int | index, |
const QString & | text | ||
) |
设置标签索引位置文本.
index 标签索引, text 标签文本.
void Dtk::Widget::DTabBar::setTabToolTip | ( | int | index, |
const QString & | tip | ||
) |
设置标签索引位置提示文本.
index 标签索引, tip 提示文本.
|
slot |
设置新建标签按钮是否显示.
visibleAddButton 新建按钮是否可视.
QTabBar::Shape Dtk::Widget::DTabBar::shape | ( | ) | const |
标签栏形状.
int Dtk::Widget::DTabBar::tabAt | ( | const QPoint & | pos | ) | const |
根据位置返回标签索引位置.
pos 对应标签坐标,可以时标签内的任意坐标.
|
signal |
点击索引标签.
index 点击标签的索引值.
|
signal |
双击索引标签.
index 双击标记的索引值.
|
signal |
点击关闭后发出.
index 关闭的索引值.
QVariant Dtk::Widget::DTabBar::tabData | ( | int | index | ) | const |
返回标签索引位置数据.
index 标签索引.
|
signal |
标签拖放.
index 拖放的标签索引, action 拖放的动作, target 被拖放的标签 DTabBar 实例
QIcon Dtk::Widget::DTabBar::tabIcon | ( | int | index | ) | const |
返回标签索引位置图标.
index 标签索引.
|
signal |
新标签已插入.
index 被插入标签的索引值.
|
signal |
标签已删除.
index 被删除标签的索引值.
|
signal |
索引位置发生变化
from 索引位置变化的初始值, to 位置变化后的索引值.
QRect Dtk::Widget::DTabBar::tabRect | ( | int | index | ) | const |
返回标签索引位置矩形.
index 标签索引.
|
signal |
索引标签鼠标释放.
index 标签释放的索引值.
bool Dtk::Widget::DTabBar::tabsClosable | ( | ) | const |
标签栏是否可关闭.
QString Dtk::Widget::DTabBar::tabText | ( | int | index | ) | const |
返回标签索引位置文本.
index 标签索引.
QString Dtk::Widget::DTabBar::tabToolTip | ( | int | index | ) | const |
返回标签索引位置提示文本.
index 标签索引.
bool Dtk::Widget::DTabBar::visibleAddButton | ( | ) | const |
新建标签栏按钮是否可见.