qtTimeZoneSelectWidget.h 1.69 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
//=========================================================================
//  Copyright (c) Kitware, Inc.
//  All rights reserved.
//  See LICENSE.txt for details.
//
//  This software is distributed WITHOUT ANY WARRANTY; without even
//  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
//  PURPOSE.  See the above copyright notice for more information.
//=========================================================================
// .NAME qtTimeZoneSelectWidget - ui panel for selecting timezone
// .SECTION Description
// .SECTION Caveats

#ifndef __smtk_extension_qtTimeZoneSelectWidget_h
#define __smtk_extension_qtTimeZoneSelectWidget_h

#include "smtk/extension/qt/Exports.h"
John Tourtellott's avatar
John Tourtellott committed
18 19
#include <QItemSelection>
#include <QModelIndex>
20
#include <QString>
21
#include <QWidget>
John Tourtellott's avatar
John Tourtellott committed
22

23 24
class Ui_qtTimeZoneSelectWidget;

25 26 27 28
namespace smtk
{
namespace extension
{
29 30 31 32 33

class SMTKQTEXT_EXPORT qtTimeZoneSelectWidget : public QWidget
{
  Q_OBJECT

34
public:
35
  qtTimeZoneSelectWidget(QWidget* parent = NULL);
36
  ~qtTimeZoneSelectWidget() override;
37

38 39 40 41 42
  // Used to initialize model
  void setRegion(const QString& index);

  // Returns continent/region or empty string
  QString selectedRegion() const;
John Tourtellott's avatar
John Tourtellott committed
43

44
public slots:
45

46
signals:
47
  void regionSelected(QString id);
48

49 50 51
protected slots:
  void onContinentChanged(const QItemSelection& selected, const QItemSelection& deselected);
  void onRegionChanged(const QItemSelection& selected, const QItemSelection& deselected);
52

53 54
protected:
  Ui_qtTimeZoneSelectWidget* UI;
John Tourtellott's avatar
John Tourtellott committed
55

56
  void setContinent(const QModelIndex index);
57 58

private:
John Tourtellott's avatar
John Tourtellott committed
59
  class qtTimeZoneSelectWidgetInternal;
60
  qtTimeZoneSelectWidgetInternal* Internal;
61 62
};

63
} // namespace model
64 65 66
} // namespace smtk

#endif // __smtk_extension_qtTimeZoneSelectWidget_h