VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
levelBar.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include <QStyledItemDelegate>
12 #include <QProgressBar>
13 
15 namespace makVrf
16 {
17  namespace makVrfGuiObjectInformationQt
18  {
22  {
23  public:
24  DtLevelBar(QWidget* parent = 0);
25 
26  ~DtLevelBar();
27 
29  virtual void setText(const QString& text);
30 
32  virtual QString text() const;
33 
34  protected:
35 
37  QString myText;
38  };
39 
40  typedef QString (*DtLevelBarTextFunction)(double level, double max);
41  typedef void (*DtLevelBarValuesFunction)(int& outLevel, int& outMax, double level, double max);
43 
47  {
48  public:
49 
50  DtLevelBarDelegate(QWidget *parent = 0);
52 
53  void paint(QPainter *painter, const QStyleOptionViewItem &option,
54  const QModelIndex &index) const;
55  QSize sizeHint(const QStyleOptionViewItem &option,
56  const QModelIndex &index) const;
57 
62 
64  virtual void setText(DtLevelBar& bar, double level, double max) const;
65 
71 
73  virtual void setValues(DtLevelBar& bar, double level, double max) const;
74 
79 
81  virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
82  const QModelIndex &index) const { return 0; }
83  virtual void setEditorData(QWidget *editor, const QModelIndex &index) const {}
84  virtual void setModelData(QWidget *editor, QAbstractItemModel *model,
85  const QModelIndex &index) const {}
86 
87  protected:
88 
90  static QString defaultTextFunction(double level, double max);
91 
93  static void defaultValuesFunction(int& outLevel, int& outMax, double level, double max);
94 
98  };
99  }
100 }
101 

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)