15#include "kddockwidgets/core/DockWidget.h"
16#include "kddockwidgets/core/TabBar.h"
17#include "kddockwidgets/core/Stack.h"
18#include "core/Utils_p.h"
19#include "core/TabBar_p.h"
20#include "core/Logging_p.h"
23#include "kddockwidgets/core/DockRegistry.h"
26#include <QApplication>
45 const QWidget *widget =
nullptr,
56 return baseStyle()->styleHint(hint, option, widget, returnData);
63 static auto *proxy =
new MyProxy;
67class QtWidgets::TabBar::Private
75 void onTabMoved(
int from,
int to);
84 :
View(controller, Core::ViewType::
TabBar, parent)
85 , TabBarViewInterface(controller)
86 , d(new Private(controller))
100 d->onTabMoved(from, to);
115 d->m_controller->onMousePress(e->
pos());
129 d->m_controller->onMouseDoubleClick(e->
pos());
148 parent->setFocusProxy(
this);
150 parent->setFocusProxy(
nullptr);
192 if (
auto tw =
dynamic_cast<Stack *
>(d->m_controller->stack()->view()))
195 qWarning() << Q_FUNC_INFO <<
"Unexpected null QTabWidget";
229 return d->m_controller;
232void TabBar::Private::onTabMoved(
int from,
int to)
234 if (from == to || m_controller->isMovingTab())
240 m_controller->dptr()->moveTabTo(from, to);
Application-wide config to tune certain behaviours of the framework.
A ScopedConnection is a RAII-style way to make sure a Connection is disconnected.
QEvent::Type type() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const const
void currentChanged(int index)
void setCurrentIndex(int index)
virtual bool event(QEvent *event) override
virtual void mouseMoveEvent(QMouseEvent *event) override
virtual void mousePressEvent(QMouseEvent *event) override
void setMovable(bool movable)
void moveTab(int from, int to)
void setTabIcon(int index, const QIcon &icon)
void setTabText(int index, const QString &text)
int tabAt(const QPoint &position) const const
virtual void tabInserted(int index)
void tabMoved(int from, int to)
QRect tabRect(int index) const const
virtual void tabRemoved(int index)
QString tabText(int index) const const