File indexing completed on 2024-05-05 10:03:23
0001 /* 0002 This file is part of KCachegrind. 0003 0004 SPDX-FileCopyrightText: 2009-2016 Josef Weidendorfer <Josef.Weidendorfer@gmx.de> 0005 0006 SPDX-License-Identifier: GPL-2.0-only 0007 */ 0008 0009 /* 0010 * QCachegrind configuration dialog 0011 */ 0012 0013 #ifndef CONFIGDIALOG_H 0014 #define CONFIGDIALOG_H 0015 0016 #include <QString> 0017 #include <QDialog> 0018 #include <QMap> 0019 #include <QTimer> 0020 0021 #include "configpage.h" 0022 0023 class QWidget; 0024 class QLabel; 0025 class QListWidget; 0026 class QStackedWidget; 0027 0028 class TraceData; 0029 0030 class ConfigDialog: public QDialog 0031 { 0032 Q_OBJECT 0033 0034 public: 0035 // If s is not empty, navigate to a given setting on opening 0036 ConfigDialog(TraceData* data, QWidget* parent, const QString &s = QString()); 0037 0038 void activate(QString); 0039 QString currentPage(); 0040 0041 public Q_SLOTS: 0042 void accept() override; 0043 void listItemChanged(QString); 0044 void clearError(); 0045 0046 private: 0047 void addPage(ConfigPage*); 0048 0049 QLabel* _titleLabel; 0050 QLabel* _errorLabel; 0051 QListWidget *_listWidget; 0052 QStackedWidget *_widgetStack; 0053 QMap<QString,ConfigPage*> _pages; 0054 QString _activeSetting; 0055 QTimer _clearTimer; 0056 }; 0057 0058 #endif // CONFIGDIALOG