File indexing completed on 2025-01-05 03:35:38
0001 /* 0002 File : ExamplesWidget.h 0003 Project : LabPlot 0004 Description : widget showing the available example projects 0005 -------------------------------------------------------------------- 0006 SPDX-FileCopyrightText: 2021 Alexander Semke <alexander.semke@web.de> 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #ifndef EXAMPLESWIDGET_H 0011 #define EXAMPLESWIDGET_H 0012 0013 #include "ui_exampleswidget.h" 0014 0015 class QCompleter; 0016 class QStandardItemModel; 0017 class ExamplesManager; 0018 0019 class ExamplesWidget : public QWidget { 0020 Q_OBJECT 0021 0022 public: 0023 explicit ExamplesWidget(QWidget*); 0024 ~ExamplesWidget() override; 0025 0026 QString path() const; 0027 0028 private: 0029 Ui::ExamplesWidget ui; 0030 QCompleter* m_completer{nullptr}; 0031 QStandardItemModel* m_model{nullptr}; 0032 ExamplesManager* m_manager{nullptr}; 0033 0034 void loadCollections(); 0035 void activateIconViewItem(const QString& name); 0036 void activateListViewItem(const QString& name); 0037 0038 private Q_SLOTS: 0039 void collectionChanged(int); 0040 void exampleChanged(); 0041 void showInfo(); 0042 void toggleIconView(); 0043 void viewModeChanged(int); 0044 void activated(const QString&); 0045 0046 Q_SIGNALS: 0047 void doubleClicked(); 0048 }; 0049 0050 #endif // EXAMPLESWIDGET_H