qa: Resolve Qt deprecation warnings - default-construct QFlags
[quassel.git] / src / qtui / verticaldock.h
index 33e684e..703b47c 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005/06 by the Quassel Project                          *
+ *   Copyright (C) 2005-2020 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -15,7 +15,7 @@
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
 #ifndef VERTICALDOCKTITLE_H
 #include <QDockWidget>
 #include <QSize>
 
-class VerticalDockTitle : public QWidget {
-  Q_OBJECT
+class VerticalDockTitle : public QWidget
+{
+    Q_OBJECT
 
 public:
-  VerticalDockTitle(QDockWidget *parent);
-  virtual ~VerticalDockTitle();
+    VerticalDockTitle(QDockWidget* parent);
 
-  virtual QSize sizeHint() const;
-  virtual QSize minimumSizeHint() const;
+    QSize sizeHint() const override;
+    QSize minimumSizeHint() const override;
+    void show(bool show_);
 
 protected:
-  virtual void paintEvent(QPaintEvent *event);
+    void paintEvent(QPaintEvent* event) override;
+
+private:
+    bool _show;
 };
 
-class VerticalDock : public QDockWidget {
-  Q_OBJECT
+class EmptyDockTitle : public QWidget
+{
+    Q_OBJECT
 
 public:
-  VerticalDock(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = 0);
-  VerticalDock(QWidget *parent = 0, Qt::WindowFlags flags = 0);
-  virtual ~VerticalDock();
+    inline EmptyDockTitle(QDockWidget* parent)
+        : QWidget(parent)
+    {}
 
-  void setDefaultTitleWidget();
+    inline QSize sizeHint() const override { return {0, 0}; }
 };
 
+class VerticalDock : public QDockWidget
+{
+    Q_OBJECT
+
+public:
+    VerticalDock(const QString& title, QWidget* parent = nullptr, Qt::WindowFlags flags = {});
+    VerticalDock(QWidget* parent = nullptr, Qt::WindowFlags flags = {});
+
+    void showTitle(bool show);
+    void setDefaultTitleWidget();
+};
 
-#endif // VERTICALDOCKTITLE_H
-  
+#endif  // VERTICALDOCKTITLE_H