KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
flutter/views/TabBar.cpp
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
20#include "TabBar.h"
21#include "kddockwidgets/core/TabBar.h"
22#include "kddockwidgets/core/Stack.h"
23#include "core/Logging_p.h"
24
25using namespace KDDockWidgets;
26using namespace KDDockWidgets::flutter;
27
29 : View(controller, Core::ViewType::TabBar, parent)
30 , TabBarViewInterface(controller)
31 , m_controller(controller)
32{
33}
34
35int TabBar::tabAt(Point) const
36{
37 KDDW_WARN("TabBar::tabAt: Not implemented");
38 return -1;
39}
40
42{
43 KDDW_WARN("TabBar::text: Not implemented");
44 return {};
45}
46
47Rect TabBar::rectForTab(int) const
48{
49 KDDW_WARN("TabBar::rectForTab: Not implemented");
50 return {};
51}
52
53void TabBar::moveTabTo(int from, int to)
54{
55 KDDW_UNUSED(from);
56 KDDW_UNUSED(to);
57 KDDW_WARN("TabBar::moveTabTo: Not implemented");
58}
59
60void TabBar::changeTabIcon(int, const Icon &)
61{
62 KDDW_WARN("TabBar::changeTabIcon: Not implemented");
63}
64
66{
68
69 // Rebuild the group as well, as it might want to remove the tabbar completely in case there's
70 // no tabs or a single tab
71 static_cast<flutter::View *>(m_controller->group()->view())->onRebuildRequested();
72}
73
74void TabBar::insertDockWidget(int, Core::DockWidget *dw, const Icon &,
75 const QString &)
76{
77 dw->view()->setParent(this);
78
80
81 // Rebuild the group as well, it might need to show the tabbar if it was hidden before
82 static_cast<flutter::View *>(m_controller->group()->view())->onRebuildRequested();
83}
84
85void TabBar::renameTab(int, const QString &)
86{
87 KDDW_WARN("TabBar::renameTab: Not implemented");
88}
89
94
95void TabBar::onMousePress(MouseEvent *me)
96{
97 m_controller->onMousePress(me->pos());
98}
#define KDDW_UNUSED(name)
View * view() const
Returns the view associated with this controller, if any.
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
void onMousePress(Point localPos)
virtual void setParent(View *)=0
Rect rectForTab(int index) const override
TabBar(Core::TabBar *controller, Core::View *parent=nullptr)
void renameTab(int index, const QString &name) override
void changeTabIcon(int index, const Icon &icon) override
int tabAt(Point localPos) const override
QString text(int index) const override
Returns the tab text for the specified index This is only used by tests, to make sure your tab's text...
void removeDockWidget(Core::DockWidget *dw) override
void insertDockWidget(int index, Core::DockWidget *dw, const Icon &icon, const QString &title) override
void moveTabTo(int from, int to) override
void onMousePress(MouseEvent *) override
View can override if it's interested in events which the event filter rejected.
void setCurrentIndex(int index) override
virtual void onRebuildRequested()
Implemented in Dart.
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