KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
qtwidgets/views/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_SIDEBARWIDGET_P_H
13#define KD_SIDEBARWIDGET_P_H
14
15#include "View.h"
16#include "kddockwidgets/docks_export.h"
17#include <kddockwidgets/core/views/SideBarViewInterface.h>
18
19#include <QToolButton>
20#include <QPointer>
21
22QT_BEGIN_NAMESPACE
23class QBoxLayout;
24class QAbstractButton;
25QT_END_NAMESPACE
26
27namespace KDDockWidgets {
28
29namespace Core {
30class SideBar;
31}
32
33namespace QtWidgets {
34class SideBar;
35}
36
37class DOCKS_EXPORT SideBarButton : public QToolButton
38{
39 Q_OBJECT
40public:
41 explicit SideBarButton(Core::DockWidget *dw, QtWidgets::SideBar *parent);
42 ~SideBarButton() override;
43
44protected:
45 void paintEvent(QPaintEvent *) override;
46 QSize sizeHint() const override;
47
48private:
49 bool isVertical() const;
50
51 friend class QtWidgets::SideBar;
52 class Private;
53 Private *const d;
54};
55
56namespace QtWidgets {
57
58class DOCKS_EXPORT SideBar : public View<QWidget>, public Core::SideBarViewInterface
59{
60 Q_OBJECT
61public:
62 explicit SideBar(Core::SideBar *, QWidget *parent);
63
64protected:
65 void addDockWidget_Impl(Core::DockWidget *dock) override;
66 void removeDockWidget_Impl(Core::DockWidget *dock) override;
67
68 // virtual so users can provide their own buttons
69 virtual SideBarButton *createButton(Core::DockWidget *dw,
70 SideBar *parent) const;
71
72private:
73 void init() override;
74
75 QBoxLayout *m_layout = nullptr;
76};
77}
78
79}
80
81#endif
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
The interface that SideBar views should implement.
QSize sizeHint() const override
void paintEvent(QPaintEvent *) override
Class to abstract QAction, so code still works with QtQuick and Flutter.

© 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