KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
core/TabBar.h
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2020 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#pragma once
13
14#include "Controller.h"
15#include "Group.h"
16#include "Draggable_p.h"
17#include "DockWidget.h"
18
19namespace KDDockWidgets::Core {
20
21class Stack;
22class Group;
23
24class DOCKS_EXPORT TabBar : public Controller, public Draggable
25{
26 Q_OBJECT
27public:
28 explicit TabBar(Stack *tabWidget = nullptr);
29 virtual ~TabBar() override;
30
36 DockWidget *dockWidgetAt(int index) const;
37
39 DockWidget *dockWidgetAt(Point localPos) const;
40
42 DockWidget *currentDockWidget() const;
43 void setCurrentDockWidget(DockWidget *dw);
44
46 int currentIndex() const;
47 void setCurrentIndex(int index);
48
50 int indexOfDockWidget(const Core::DockWidget *dw) const;
51 void removeDockWidget(Core::DockWidget *dw);
52 void insertDockWidget(int index, Core::DockWidget *dw, const Icon &icon,
53 const QString &title);
54
55 // Draggable
56 bool dragCanStart(Point pressPos, Point pos) const override;
57 std::unique_ptr<WindowBeingDragged> makeWindow() override;
58 bool isWindow() const override;
59
60 void onMousePress(Point localPos);
61 void onMouseDoubleClick(Point localPos);
62
64 bool hasSingleDockWidget() const;
65
66 int numDockWidgets() const;
67
68 bool tabsAreMovable() const;
69
70 DockWidget *singleDockWidget() const override final;
71
73 bool isMDI() const override;
74
75 Group *group() const;
76 Stack *stack() const;
77
78 void moveTabTo(int from, int to);
79 QString text(int index) const;
80 Rect rectForTab(int index) const;
82 void renameTab(int index, const QString &);
83
85 void changeTabIcon(int index, const Icon &);
86
88 bool isMovingTab() const;
89
90 class Private;
91 Private *dptr() const;
92
93private:
94 Private *const d;
95};
96
97}
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
TabBar(Stack *tabWidget=nullptr)
virtual ~TabBar() override
Represents a dock widget.

© 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