File indexing completed on 2025-09-14 03:43:31

0001 /*
0002     File                 : ThemesComboBox.h
0003     Project              : LabPlot
0004     Description          : Preview of all themes in a QComboBox
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2017 Alexander Semke <alexander.semke@web.de>
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #ifndef THEMESCOMBOBOX_H
0011 #define THEMESCOMBOBOX_H
0012 
0013 #include <QComboBox>
0014 
0015 class QGroupBox;
0016 class ThemesWidget;
0017 
0018 class ThemesComboBox : public QComboBox {
0019     Q_OBJECT
0020 
0021 public:
0022     explicit ThemesComboBox(QWidget* parent = nullptr);
0023     void setCurrentTheme(const QString&);
0024 
0025     void showPopup() override;
0026     void hidePopup() override;
0027 
0028 private:
0029     QGroupBox* m_groupBox;
0030     ThemesWidget* m_view;
0031     bool eventFilter(QObject*, QEvent*) override;
0032 
0033 private Q_SLOTS:
0034     void handleThemeChanged(const QString&);
0035 
0036 Q_SIGNALS:
0037     void currentThemeChanged(const QString&);
0038 };
0039 
0040 #endif