KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
qtquick/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_SIDEBAR_QTQUICK_H
13#define KD_SIDEBAR_QTQUICK_H
14
15#pragma once
16
17#include "View.h"
18#include "kddockwidgets/docks_export.h"
19#include "kddockwidgets/core/views/SideBarViewInterface.h"
20
21#include <QToolButton>
22#include <QPointer>
23
24QT_BEGIN_NAMESPACE
25class QBoxLayout;
26class QAbstractButton;
27QT_END_NAMESPACE
28
29namespace KDDockWidgets {
30
31class Group;
32
33namespace Core {
34class SideBar;
35}
36
37namespace QtQuick {
38class SideBar;
39}
40
42{
44public:
45 explicit SideBarButton(Core::DockWidget *dw, QtQuick::SideBar *parent);
46 bool isVertical() const;
47 void paintEvent(QPaintEvent *) override;
48 QSize sizeHint() const override;
49
50private:
51 QtQuick::SideBar *const m_sideBar;
52 const QPointer<Core::DockWidget> m_dockWidget;
53};
54
55namespace QtQuick {
56
57class DOCKS_EXPORT SideBar : public QtQuick::View<QQuickItem>, public Core::SideBarViewInterface
58{
59 Q_OBJECT
60public:
61 explicit SideBar(Core::SideBar *, QQuickItem *parent);
62
63 void init() override;
64 bool isVertical() const;
65
66 void addDockWidget_Impl(Core::DockWidget *) override;
67 void removeDockWidget_Impl(Core::DockWidget *) override;
68
69 // virtual so users can provide their own buttons
70 virtual SideBarButton *createButton(Core::DockWidget *dw, SideBar *parent) const;
71
72private:
73 QBoxLayout *m_layout = nullptr;
74};
75}
76
77}
78
79#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.
SideBarButton(Core::DockWidget *dw, QtQuick::SideBar *parent)
void paintEvent(QPaintEvent *) override
Class to abstract QAction, so code still works with QtQuick and Flutter.
Q_OBJECTQ_OBJECT
QObject * parent() const const

© 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