File indexing completed on 2024-12-22 04:40:21
0001 /* 0002 SPDX-FileCopyrightText: 2007-2009 Sergio Pistone <sergio_pistone@yahoo.com.ar> 0003 SPDX-FileCopyrightText: 2010-2022 Mladen Milinkovic <max@smoothware.net> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef LAYEREDWIDGET_H 0009 #define LAYEREDWIDGET_H 0010 0011 #include <QList> 0012 #include <QWidget> 0013 0014 /// a class used to show varios widgets simultaneously one in top 0015 /// of the another (unlike QStackWidget which shows one at a time) 0016 0017 class LayeredWidget : public QWidget 0018 { 0019 Q_OBJECT 0020 0021 public: 0022 typedef enum { HandleResize, IgnoreResize } Mode; 0023 0024 explicit LayeredWidget(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags()); 0025 0026 void setWidgetMode(QWidget *widget, Mode mode); 0027 0028 public slots: 0029 void setMouseTracking(bool enable); 0030 0031 protected: 0032 void resizeEvent(QResizeEvent *e) override; 0033 0034 private: 0035 QList<QObject *> m_ignoredWidgets; 0036 }; 0037 0038 #endif