File indexing completed on 2024-05-19 05:35:23
0001 #ifndef oxygenbenchmarkwidget_h 0002 #define oxygenbenchmarkwidget_h 0003 0004 ////////////////////////////////////////////////////////////////////////////// 0005 // oxygenbenchmarkwidget.h 0006 // oxygen buttons demo widget 0007 // ------------------- 0008 // 0009 // SPDX-FileCopyrightText: 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr> 0010 // 0011 // SPDX-License-Identifier: MIT 0012 ////////////////////////////////////////////////////////////////////////////// 0013 0014 #include "../oxygen.h" 0015 #include "oxygendemowidget.h" 0016 #include "ui_oxygenbenchmarkwidget.h" 0017 0018 #include <KPageDialog> 0019 #include <QCheckBox> 0020 #include <QPair> 0021 #include <QVector> 0022 #include <QWidget> 0023 0024 namespace Oxygen 0025 { 0026 class BenchmarkWidget : public DemoWidget 0027 { 0028 Q_OBJECT 0029 0030 public: 0031 //! constructor 0032 explicit BenchmarkWidget(QWidget * = nullptr); 0033 0034 //! setup widgets 0035 void init(KPageDialog *, QVector<KPageWidgetItem *>); 0036 0037 Q_SIGNALS: 0038 0039 void runBenchmark(void); 0040 0041 private Q_SLOTS: 0042 0043 //! button state 0044 void updateButtonState(void); 0045 0046 //! grabMouse 0047 void updateGrabMouse(bool value) 0048 { 0049 Simulator::setGrabMouse(value); 0050 } 0051 0052 //! run 0053 void run(void); 0054 0055 private: 0056 //! select page from index in parent page widget 0057 void selectPage(int) const; 0058 0059 //! ui 0060 Ui_BenchmarkWidget ui; 0061 0062 //! pointer to pagewidget 0063 WeakPointer<KPageDialog> _pageDialog; 0064 0065 //! map checkboxes to demo widgets 0066 using ItemPointer = WeakPointer<KPageWidgetItem>; 0067 using ItemPair = QPair<QCheckBox *, ItemPointer>; 0068 using ItemList = QVector<ItemPair>; 0069 ItemList _items; 0070 }; 0071 } 0072 0073 #endif