FloatingWidgetTitleBar.h
Go to the documentation of this file.
1 #ifndef FLOATINGWIDGETTITLEBAR_H
2 #define FLOATINGWIDGETTITLEBAR_H
3 /*******************************************************************************
4 ** Qt Advanced Docking System
5 ** Copyright (C) 2017 Uwe Kindler
6 **
7 ** This library is free software; you can redistribute it and/or
8 ** modify it under the terms of the GNU Lesser General Public
9 ** License as published by the Free Software Foundation; either
10 ** version 2.1 of the License, or (at your option) any later version.
11 **
12 ** This library is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ** Lesser General Public License for more details.
16 **
17 ** You should have received a copy of the GNU Lesser General Public
18 ** License along with this library; If not, see <http://www.gnu.org/licenses/>.
19 ******************************************************************************/
20 
21 
22 //============================================================================
27 //============================================================================
28 
29 //============================================================================
30 // INCLUDES
31 //============================================================================
32 #include <QFrame>
33 #include <QIcon>
34 
35 namespace ads
36 {
37 class CFloatingDockContainer;
38 
39 struct FloatingWidgetTitleBarPrivate;
40 
41 
49 class CFloatingWidgetTitleBar : public QFrame
50 {
51  Q_OBJECT
52  Q_PROPERTY(QIcon maximizeIcon READ maximizeIcon WRITE setMaximizeIcon)
53  Q_PROPERTY(QIcon normalIcon READ normalIcon WRITE setNormalIcon)
54 private:
56 
57 protected:
58  virtual void mousePressEvent(QMouseEvent *ev) override;
59  virtual void mouseReleaseEvent(QMouseEvent *ev) override;
60  virtual void mouseMoveEvent(QMouseEvent *ev) override;
61  virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
62 
63  void setMaximizeIcon(const QIcon& Icon);
64  QIcon maximizeIcon() const;
65  void setNormalIcon(const QIcon& Icon);
66  QIcon normalIcon() const;
67 
68 public:
69  using Super = QWidget;
70  explicit CFloatingWidgetTitleBar(CFloatingDockContainer *parent = nullptr);
71 
75  virtual ~CFloatingWidgetTitleBar();
76 
80  void enableCloseButton(bool Enable);
81 
85  void setTitle(const QString &Text);
86 
90  void updateStyle();
91 
95  void setMaximizedIcon(bool maximized);
96 
97 signals:
101  void closeRequested();
102 
106  void maximizeRequested();
107 };
108 } // namespace ads
109 #endif // FLOATINGWIDGETTITLEBAR_H
ads::CFloatingWidgetTitleBar::mousePressEvent
virtual void mousePressEvent(QMouseEvent *ev) override
Definition: FloatingWidgetTitleBar.cpp:157
ads::FloatingWidgetTitleBarPrivate
Private data class of public interface CFloatingWidgetTitleBar.
Definition: FloatingWidgetTitleBar.cpp:54
ads::CFloatingWidgetTitleBar::setNormalIcon
void setNormalIcon(const QIcon &Icon)
Definition: FloatingWidgetTitleBar.cpp:269
ads::CFloatingWidgetTitleBar::updateStyle
void updateStyle()
Definition: FloatingWidgetTitleBar.cpp:221
ads::CFloatingWidgetTitleBar::mouseDoubleClickEvent
virtual void mouseDoubleClickEvent(QMouseEvent *event) override
Definition: FloatingWidgetTitleBar.cpp:228
ads::CFloatingWidgetTitleBar::normalIcon
QIcon normalIcon
Definition: FloatingWidgetTitleBar.h:53
ads::CFloatingWidgetTitleBar::setTitle
void setTitle(const QString &Text)
Definition: FloatingWidgetTitleBar.cpp:215
ads::CFloatingWidgetTitleBar::Super
QWidget Super
Definition: FloatingWidgetTitleBar.h:69
ads::CFloatingWidgetTitleBar::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *ev) override
Definition: FloatingWidgetTitleBar.cpp:171
ads
Definition: ads_globals.h:69
ads::CFloatingWidgetTitleBar::setMaximizeIcon
void setMaximizeIcon(const QIcon &Icon)
Definition: FloatingWidgetTitleBar.cpp:258
ads::CFloatingWidgetTitleBar::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *ev) override
Definition: FloatingWidgetTitleBar.cpp:183
ads::CFloatingWidgetTitleBar
Definition: FloatingWidgetTitleBar.h:49
ads::CFloatingWidgetTitleBar::maximizeIcon
QIcon maximizeIcon
Definition: FloatingWidgetTitleBar.h:52
ads::CFloatingWidgetTitleBar::enableCloseButton
void enableCloseButton(bool Enable)
Definition: FloatingWidgetTitleBar.cpp:208
override
#define override
Definition: backward.hpp:387
ads::CFloatingWidgetTitleBar::d
FloatingWidgetTitleBarPrivate * d
private data (pimpl)
Definition: FloatingWidgetTitleBar.h:55
ads::CFloatingDockContainer
Definition: FloatingDockContainer.h:104
ads::CFloatingWidgetTitleBar::setMaximizedIcon
void setMaximizedIcon(bool maximized)
Definition: FloatingWidgetTitleBar.cpp:243
ads::CFloatingWidgetTitleBar::maximizeRequested
void maximizeRequested()
ads::CFloatingWidgetTitleBar::closeRequested
void closeRequested()


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:44