VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtQtUtil.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2016 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCoreQt/vrvCoreQt.h>
13 #include <QtGui/QMessageBox>
14 #include <QtCore/QEvent>
15 #include <QtCore/QString>
16 
17 namespace makVrv
18 {
19 
23  {
24  public:
25  // We check the Virtual Keys to differentiate between some of the
26  // keys that are mapped to the same QT enum.
27 
28  // Widows virtual key codes
29  // Only get the first 10 if numlock is on
30  static const unsigned int DtVK_NUMPAD0 = 0x60;
31  static const unsigned int DtVK_NUMPAD1 = 0x61;
32  static const unsigned int DtVK_NUMPAD2 = 0x62;
33  static const unsigned int DtVK_NUMPAD3 = 0x63;
34  static const unsigned int DtVK_NUMPAD4 = 0x64;
35  static const unsigned int DtVK_NUMPAD5 = 0x65;
36  static const unsigned int DtVK_NUMPAD6 = 0x66;
37  static const unsigned int DtVK_NUMPAD7 = 0x67;
38  static const unsigned int DtVK_NUMPAD8 = 0x68;
39  static const unsigned int DtVK_NUMPAD9 = 0x69;
40 
41  // Get these regardless of numlock state
42  static const unsigned int DtVK_MULTIPLY = 0x6A;
43  static const unsigned int DtVK_ADD = 0x6B;
44  static const unsigned int DtVK_SUBTRACT = 0x6D;
45  static const unsigned int DtVK_DECIMAL = 0x6E;
46  static const unsigned int DtVK_DIVIDE = 0x6F;
47 
48  // Linux virtual key codes
49  // Only get the first 10 if numlock is on
50  static const unsigned int DtVK_NUMPAD0_LINUX = 0xFFB0;
51  static const unsigned int DtVK_NUMPAD1_LINUX = 0xFFB1;
52  static const unsigned int DtVK_NUMPAD2_LINUX = 0xFFB2;
53  static const unsigned int DtVK_NUMPAD3_LINUX = 0xFFB3;
54  static const unsigned int DtVK_NUMPAD4_LINUX = 0xFFB4;
55  static const unsigned int DtVK_NUMPAD5_LINUX = 0xFFB5;
56  static const unsigned int DtVK_NUMPAD6_LINUX = 0xFFB6;
57  static const unsigned int DtVK_NUMPAD7_LINUX = 0xFFB7;
58  static const unsigned int DtVK_NUMPAD8_LINUX = 0xFFB8;
59  static const unsigned int DtVK_NUMPAD9_LINUX = 0xFFB9;
60 
61  // Get these regardless of numlock state
62  static const unsigned int DtVK_MULTIPLY_LINUX = 0xFFAA;
63  static const unsigned int DtVK_ADD_LINUX = 0xFFAB;
64  static const unsigned int DtVK_SUBTRACT_LINUX = 0xFFAD;
65  static const unsigned int DtVK_DECIMAL_LINUX = 0xFFAE;
66  static const unsigned int DtVK_DIVIDE_LINUX = 0xFFAF;
67 
68  public:
72  static QString eventTypeName(QEvent::Type eventType);
73 
77  static QString eventTypeName(QEvent const * event);
78 
81  static QMessageBox::StandardButton critical (
82  QWidget * parent, const QString & title, const QString & text,
83  QMessageBox::StandardButtons buttons = QMessageBox::Ok,
84  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton,
85  Qt::WindowFlags f = Qt::Tool | Qt::MSWindowsFixedSizeDialogHint);
86 
89  static QMessageBox::StandardButton information (
90  QWidget * parent, const QString & title, const QString & text,
91  QMessageBox::StandardButtons buttons = QMessageBox::Ok,
92  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton,
93  Qt::WindowFlags f = Qt::Tool | Qt::MSWindowsFixedSizeDialogHint );
94 
97  static QMessageBox::StandardButton question (
98  QWidget * parent, const QString & title, const QString & text,
99  QMessageBox::StandardButtons buttons = QMessageBox::Yes | QMessageBox::No,
100  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton,
101  Qt::WindowFlags f = Qt::MSWindowsFixedSizeDialogHint | Qt::Tool);
102 
105  static QMessageBox::StandardButton warning (
106  QWidget * parent, const QString & title, const QString & text,
107  QMessageBox::StandardButtons buttons = QMessageBox::Ok,
108  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton,
109  Qt::WindowFlags f = Qt::MSWindowsFixedSizeDialogHint | Qt::Tool);
110 
112 
113 
114 
115 
116 
117  static int calculateStepSize( int maxRange, int numberOfSteps );
118  static double calculateStepSize( double maxRange, int numberOfSteps, int decimals );
120 
121  private:
122 
125  static QMessageBox::StandardButton showMessageBox (
126  QMessageBox& mbox, QMessageBox::StandardButton defaultButton);
127 
128  };
129 
130 }

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)