KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
core/SideBar.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_SIDEBAR_P_H
13#define KD_SIDEBAR_P_H
14
15#pragma once
16
17#include "kddockwidgets/docks_export.h"
18
19#include "kddockwidgets/KDDockWidgets.h"
20#include "Controller.h"
21
22namespace KDDockWidgets {
23
24namespace Core {
25
26class DockWidget;
27class MainWindow;
28
29class DOCKS_EXPORT SideBar : public Controller
30{
31 Q_OBJECT
32public:
33 explicit SideBar(SideBarLocation, MainWindow *parent = nullptr);
34 ~SideBar() override;
35
36 void addDockWidget(DockWidget *dw);
37 void removeDockWidget(DockWidget *dw);
38 bool containsDockWidget(DockWidget *) const;
39
41 Qt::Orientation orientation() const;
42
44 bool isVertical() const
45 {
46 return m_orientation == Qt::Vertical;
47 }
48
50 bool isEmpty() const;
51
53 SideBarLocation location() const;
54
56 MainWindow *mainWindow() const;
57
59 void toggleOverlay(DockWidget *);
60
63 Vector<QString> serialize() const;
64
66 void clear();
67
69 Vector<DockWidget *> dockWidgets() const;
70
71 void onButtonClicked(DockWidget *dw);
72
73private:
74 void updateVisibility();
75
76 class Private;
77 Private *const d;
78
79 MainWindow *const m_mainWindow;
80 Vector<DockWidget *> m_dockWidgets;
81 const SideBarLocation m_location;
82 const Qt::Orientation m_orientation;
83};
84
85}
86
87}
88
89#endif
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
bool isVertical() const
returns if this side bar has vertical orientation
Class to abstract QAction, so code still works with QtQuick and Flutter.
SideBarLocation
Each main window supports 4 sidebars.
Orientation

© 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