18#include "core/Window_p.h"
19#include "core/DockRegistry_p.h"
20#include "core/Stack_p.h"
22#include "core/View_p.h"
29#include <QAbstractButton>
54 , StackViewInterface(controller)
76 if (dw->options() & DockWidgetOption_NotClosable) {
77 qWarning() <<
"QTabWidget::tabCloseRequested: Refusing to close dock widget with "
78 "Option_NotClosable option. name="
84 qWarning() <<
"QTabWidget::tabCloseRequested Couldn't find dock widget for index"
85 << index <<
"; count=" <<
count();
91 d->tabBarAutoHideChanged = m_stack->d->tabBarAutoHideChanged.connect(
95 setFocusProxy(
nullptr);
122void Stack::setupTabBarButtons()
138 d->cornerWidgetLayout->addWidget(d->floatButton);
139 d->cornerWidgetLayout->addWidget(d->closeButton);
142 Core::TitleBar *tb = m_stack->group()->titleBar();
143 tb->onFloatClicked();
147 Core::TitleBar *tb = m_stack->group()->titleBar();
148 tb->onCloseClicked();
152 d->screenChangedConnection =
DockRegistry::self()->
dptr()->windowChangedScreen.connect([
this](Core::Window::Ptr w) {
157 d->buttonsToHideIfDisabledConnection =
m_stack->d->buttonsToHideIfDisabledChanged.connect([
this] {
158 updateTabBarButtons();
161 if (
auto tb = qobject_cast<QtWidgets::TabBar *>(
tabBar()))
164 updateTabBarButtons();
167void Stack::updateTabBarButtons()
169 if (d->closeButton) {
172 d->closeButton->setEnabled(
enabled);
173 d->closeButton->setVisible(
visible);
177void Stack::updateMargins()
180 d->cornerWidgetLayout->setContentsMargins(
QMargins(0, 0, 2, 0) * factor);
181 d->cornerWidgetLayout->setSpacing(
int(2 * factor));
231 qWarning() << Q_FUNC_INFO <<
"Not implemented yet. Only North is supported";
243 return d->closeButton;
245 return d->floatButton;
Application-wide config to tune certain behaviours of the framework.
A ScopedConnection is a RAII-style way to make sure a Connection is disconnected.
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setObjectName(const QString &name)
bool contains(const QRect &rectangle, bool proper) const const
int tabAt(const QPoint &position) const const
QString tabText(int index) const const