File indexing completed on 2024-05-19 03:49:39
0001 /* 0002 File : DatapickerView.h 0003 Project : LabPlot 0004 Description : View class for Datapicker 0005 -------------------------------------------------------------------- 0006 SPDX-FileCopyrightText: 2015 Ankit Wagadre <wagadre.ankit@gmail.com> 0007 SPDX-FileCopyrightText: 2015-2020 Alexander Semke <alexander.semke@web.de> 0008 0009 SPDX-License-Identifier: GPL-2.0-or-later 0010 */ 0011 0012 #ifndef DATAPICKERVIEW_H 0013 #define DATAPICKERVIEW_H 0014 0015 #include <QWidget> 0016 0017 class AbstractAspect; 0018 class Datapicker; 0019 0020 class QMenu; 0021 class QTabWidget; 0022 class QToolBar; 0023 0024 class DatapickerView : public QWidget { 0025 Q_OBJECT 0026 0027 public: 0028 explicit DatapickerView(Datapicker*); 0029 ~DatapickerView() override; 0030 0031 void createContextMenu(QMenu*) const; 0032 void fillToolBar(QToolBar*); 0033 int currentIndex() const; 0034 0035 private: 0036 QTabWidget* m_tabWidget; 0037 Datapicker* m_datapicker; 0038 int lastSelectedIndex{0}; 0039 bool m_initializing; 0040 0041 private Q_SLOTS: 0042 void showTabContextMenu(QPoint); 0043 void itemSelected(int); 0044 void tabChanged(int); 0045 void tabMoved(int, int); 0046 void handleDescriptionChanged(const AbstractAspect*); 0047 void handleAspectAdded(const AbstractAspect*); 0048 void handleAspectAboutToBeRemoved(const AbstractAspect*); 0049 }; 0050 0051 #endif