SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
qtTimeZoneRegionModel.h
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 // .NAME qtTimeZoneRegionModel - Qt item model for time zone regions
11 // .SECTION Description
12 // .SECTION See Also
13 // qtItem
14 
15 // This class might be better implemented as a singleton, but it is not
16 // clear that the added complexity (for thread-safe use) is justified.
17 
18 #ifndef smtk_extension_qtTimeZoneRegionModel_h
19 #define smtk_extension_qtTimeZoneRegionModel_h
20 
21 #include "smtk/extension/qt/Exports.h"
22 #include <QAbstractItemModel>
23 #include <QModelIndex>
24 #include <QString>
25 #include <QVariant>
26 
27 namespace smtk
28 {
29 namespace extension
30 {
31 class SMTKQTEXT_EXPORT qtTimeZoneRegionModel : public QAbstractItemModel
32 {
33  Q_OBJECT
34 
35 public:
36  qtTimeZoneRegionModel(QObject* parent = nullptr);
37  ~qtTimeZoneRegionModel() override;
38  void initialize();
39 
40  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
41  QModelIndex parent(const QModelIndex& index) const override;
42  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
43  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
44  QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
45  //virtual Qt::ItemFlags flags(const QModelIndex& modelIndex) const;
46  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole)
47  const override;
48 
49  QString regionId(const QModelIndex& index) const;
50  QModelIndex findModelIndex(const QString& region) const;
51 
52 private:
55 }; // class qtTimeZoneRegionModel
56 }; // namespace extension
57 }; // namespace smtk
58 
59 #endif
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
smtk::extension::qtTimeZoneRegionModel
Definition: qtTimeZoneRegionModel.h:31
smtk::extension::qtTimeZoneRegionModel::TimeZoneRegionModelInternal
Definition: qtTimeZoneRegionModel.cxx:50