KDDockWidgets API Documentation 1.7
Loading...
Searching...
No Matches
Separator_qwidget.cpp
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2020-2023 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#include "Separator_qwidget.h"
13#include "Widget_qwidget.h"
14#include "Logging_p.h"
15#include "Config.h"
16
17#include <QPainter>
18#include <QStyleOption>
19#include <QRubberBand>
20#include <QMouseEvent>
21
22using namespace Layouting;
23
25 : QWidget(parent->asQWidget())
26 , Separator(parent)
28{
29 setMouseTracking(true);
30}
31
33{
36 return;
37 }
38
39 QPainter p(this);
40
42 opt.palette = palette();
43 opt.rect = QWidget::rect();
44 opt.state = QStyle::State_None;
45 if (!isVertical())
47
48 if (isEnabled())
50
52}
53
54void SeparatorWidget::enterEvent(KDDockWidgets::Qt5Qt6Compat::QEnterEvent *)
55{
56 qCDebug(separators) << Q_FUNC_INFO << this;
57 if (isVertical())
59 else
61}
62
67
72
77
79{
80 onMouseReleased();
81}
82
87
92
94{
95 return this;
96}
97
99 : QRubberBand(QRubberBand::Line, parent ? parent->asQWidget() : nullptr)
101{
102}
Application-wide config to tune certain behaviours of the framework.
A Layouting::Widget that's deals in QWidget.
@ CustomizableWidget_Separator
The draggable separator between dock widgets in a layout.
Definition Config.h:123
static Config & self()
returns the singleton Config instance
Definition Config.cpp:84
RubberBand(Layouting::Widget *parent)
void paintEvent(QPaintEvent *) override
void leaveEvent(QEvent *) override
void mouseMoveEvent(QMouseEvent *) override
void mouseReleaseEvent(QMouseEvent *) override
void mouseDoubleClickEvent(QMouseEvent *) override
Widget * createRubberBand(Widget *parent) override
SeparatorWidget(Layouting::Widget *parent=nullptr)
void enterEvent(KDDockWidgets::Qt5Qt6Compat::QEnterEvent *) override
void mousePressEvent(QMouseEvent *) override
A Layouting::Widget that's deals in QWidget Allows to host a QWidget in the layout.
An abstraction/wrapper around QWidget, QtQuickItem or anything else.
Definition Widget.h:77
QObject * parent() const const
T qobject_cast(QObject *object)
virtual void drawControl(QStyle::ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const const=0
SizeVerCursor
void setCursor(const QCursor &)
bool isEnabled() const const
QPoint mapToParent(const QPoint &pos) const const
void setMouseTracking(bool enable)
virtual void paintEvent(QPaintEvent *event)
QWidget * parentWidget() const const
QStyle * style() const const

© 2019-2023 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 on Wed Nov 1 2023 00:02:31 for KDDockWidgets API Documentation by doxygen 1.9.8