MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / mouseMoveEvent

Method mouseMoveEvent

ElaWidgetTools/ElaTabBar.cpp:54–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 d->setScrollPosition(d->_scrollBar->value() + d->_dragScrollDirection * 12, false);
53 d->updateDropPosition(d->_dropPosition);
54 }
55 });
56}
57
58ElaTabBar::~ElaTabBar() = default;
59
60void ElaTabBar::setTabSize(QSize tabSize)
61{
62 Q_D(ElaTabBar);
63 d->_style->setTabSize(tabSize);
64 setMinimumHeight(minimumSizeHint().height());
65 updateGeometry();
66 // 字体变化事件让 Qt 按新的标签尺寸重新布局
67 QEvent event(QEvent::FontChange);
68 QTabBar::changeEvent(&event);
69 Q_EMIT pTabSizeChanged();
70}
71
72QSize ElaTabBar::getTabSize() const
73{
74 Q_D(const ElaTabBar);
75 return d->_style->getTabSize();
76}
77
78void ElaTabBar::setIsTabWidthAdaptive(bool isAdaptive)
79{
80 Q_D(ElaTabBar);
81 if (getIsTabWidthAdaptive() == isAdaptive)
82 {
83 return;
84 }
85 d->_style->setIsTabWidthAdaptive(isAdaptive);
86 QEvent event(QEvent::FontChange);
87 QTabBar::changeEvent(&event);
88 updateGeometry();
89 Q_EMIT pIsTabWidthAdaptiveChanged();
90}
91
92bool ElaTabBar::getIsTabWidthAdaptive() const
93{
94 Q_D(const ElaTabBar);
95 return d->_style->getIsTabWidthAdaptive();
96}
97
98void ElaTabBar::setTabText(int index, const QString& text)
99{
100 QTabBar::setTabText(index, text);
101 Q_EMIT tabBarTextChanged(index, text);
102}
103
104void ElaTabBar::setIsActive(bool isActive)
105{
106 Q_D(ElaTabBar);
107 d->_style->setIsActive(isActive);
108 update();
109}
110
111void ElaTabBar::setIsPinned(bool isPinned)

Callers

nothing calls this directly

Calls 1

getTabSizeMethod · 0.80

Tested by

no test coverage detected