KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
qtwidgets/views/TabBar.h
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2019 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11
12#ifndef KD_TABBAR_QTWIDGETS_H
13#define KD_TABBAR_QTWIDGETS_H
14
15#pragma once
16
17#include "View.h"
18#include <kddockwidgets/core/views/TabBarViewInterface.h>
19
20#include <QTabBar>
21
22QT_BEGIN_NAMESPACE
23class QMouseEvent;
24class QTabWidget;
25QT_END_NAMESPACE
26
27namespace KDDockWidgets::Core {
28class TabBar;
29class DockWidget;
30}
31
33
34class DOCKS_EXPORT TabBar : public View<QTabBar>, public Core::TabBarViewInterface
35{
36 Q_OBJECT
37public:
38 explicit TabBar(Core::TabBar *controller, QWidget *parent = nullptr);
39 ~TabBar() override;
40
41 Core::TabBar *tabBar() const;
42
43 void setCurrentIndex(int index) override;
44
45 QString text(int index) const override;
46 QRect rectForTab(int index) const override;
47 void moveTabTo(int from, int to) override;
48
49 int tabAt(QPoint localPos) const override;
50 void renameTab(int index, const QString &) override;
51 void changeTabIcon(int index, const QIcon &icon) override;
52 void removeDockWidget(Core::DockWidget *) override;
53 void insertDockWidget(int index, Core::DockWidget *, const QIcon &,
54 const QString &title) override;
55 QTabWidget *tabWidget() const;
56 void setTabsAreMovable(bool) override;
57
58Q_SIGNALS:
59 void dockWidgetInserted(int index);
60 void dockWidgetRemoved(int index);
63
64protected:
65 void init() override final;
66 void mousePressEvent(QMouseEvent *) override;
67 void mouseMoveEvent(QMouseEvent *e) override;
68 void mouseDoubleClickEvent(QMouseEvent *e) override;
69 bool event(QEvent *) override;
70 void tabInserted(int index) override;
71 void tabRemoved(int index) override;
72
73private:
74 class Private;
75 Private *const d;
76};
77
78}
79
80#endif
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
The interface that TabBar views should implement.
void currentDockWidgetChanged(KDDockWidgets::Core::DockWidget *)

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8