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
virtual void mouseMoveEvent(QMouseEvent *ev) override
void setTitle(const QString &Text)
Private data class of public interface CFloatingWidgetTitleBar.
virtual void mousePressEvent(QMouseEvent *ev) override
FloatingWidgetTitleBarPrivate * d
private data (pimpl)
void setNormalIcon(const QIcon &Icon)
virtual void mouseDoubleClickEvent(QMouseEvent *event) override
virtual void mouseReleaseEvent(QMouseEvent *ev) override
void setMaximizeIcon(const QIcon &Icon)
#define override
Definition: backward.hpp:387


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:47:34