Krita Source Code Documentation
Loading...
Searching...
No Matches
KoTitledTabWidget.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#include "KoTitledTabWidget.h"
8
9#include <QLabel>
10
12 : QTabWidget(parent)
13{
14 m_titleLabel = new QLabel(this);
15 setCornerWidget(m_titleLabel);
16
17 connect(this, SIGNAL(currentChanged(int)), SLOT(slotUpdateTitle()));
19}
20
22{
23 QWidget *widget = this->widget(currentIndex());
24
25 if (widget) {
26 const QString title = widget->windowTitle();
27
28 m_titleLabel->setVisible(!title.isEmpty());
29 m_titleLabel->setText(title);
30 }
31}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KoTitledTabWidget(QWidget *parent)