VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtQtUtil.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2022 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCoreQt/vrvCoreQt.h>
13 #include <QtWidgets/QMessageBox>
14 #include <QtCore/QEvent>
15 #include <QtCore/QString>
16 
17 namespace makVrv
18 {
19  class DtDe;
20 
24  {
25  public:
26  // We check the Virtual Keys to differentiate between some of the
27  // keys that are mapped to the same QT enum.
28 
29  // Widows virtual key codes
30  // Only get the first 10 if numlock is on
31  static const unsigned int DtVK_NUMPAD0 = 0x60;
32  static const unsigned int DtVK_NUMPAD1 = 0x61;
33  static const unsigned int DtVK_NUMPAD2 = 0x62;
34  static const unsigned int DtVK_NUMPAD3 = 0x63;
35  static const unsigned int DtVK_NUMPAD4 = 0x64;
36  static const unsigned int DtVK_NUMPAD5 = 0x65;
37  static const unsigned int DtVK_NUMPAD6 = 0x66;
38  static const unsigned int DtVK_NUMPAD7 = 0x67;
39  static const unsigned int DtVK_NUMPAD8 = 0x68;
40  static const unsigned int DtVK_NUMPAD9 = 0x69;
41 
42  // Get these regardless of numlock state
43  static const unsigned int DtVK_MULTIPLY = 0x6A;
44  static const unsigned int DtVK_ADD = 0x6B;
45  static const unsigned int DtVK_SUBTRACT = 0x6D;
46  static const unsigned int DtVK_DECIMAL = 0x6E;
47  static const unsigned int DtVK_DIVIDE = 0x6F;
48 
49  // Linux virtual key codes
50  // Only get the first 10 if numlock is on
51  static const unsigned int DtVK_NUMPAD0_LINUX = 0xFFB0;
52  static const unsigned int DtVK_NUMPAD1_LINUX = 0xFFB1;
53  static const unsigned int DtVK_NUMPAD2_LINUX = 0xFFB2;
54  static const unsigned int DtVK_NUMPAD3_LINUX = 0xFFB3;
55  static const unsigned int DtVK_NUMPAD4_LINUX = 0xFFB4;
56  static const unsigned int DtVK_NUMPAD5_LINUX = 0xFFB5;
57  static const unsigned int DtVK_NUMPAD6_LINUX = 0xFFB6;
58  static const unsigned int DtVK_NUMPAD7_LINUX = 0xFFB7;
59  static const unsigned int DtVK_NUMPAD8_LINUX = 0xFFB8;
60  static const unsigned int DtVK_NUMPAD9_LINUX = 0xFFB9;
61 
62  // Get these regardless of numlock state
63  static const unsigned int DtVK_MULTIPLY_LINUX = 0xFFAA;
64  static const unsigned int DtVK_ADD_LINUX = 0xFFAB;
65  static const unsigned int DtVK_SUBTRACT_LINUX = 0xFFAD;
66  static const unsigned int DtVK_DECIMAL_LINUX = 0xFFAE;
67  static const unsigned int DtVK_DIVIDE_LINUX = 0xFFAF;
68 
69  public:
73  static QString eventTypeName(QEvent::Type eventType);
74 
78  static QString eventTypeName(QEvent const * event);
79 
82  static QMessageBox::StandardButton critical(DtDe& de,
83  QWidget * parent, const QString & title, const QString & text,
84  QMessageBox::StandardButtons buttons = QMessageBox::Ok,
85  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton,
86  Qt::WindowFlags f = Qt::Tool | Qt::MSWindowsFixedSizeDialogHint);
87 
90  static QMessageBox::StandardButton critical(DtDe& de,
91  QWidget * parent, const QString & title, const QString & text,
92  bool & checkBoxChecked, const QString& checkBoxText = QString::fromStdString("Do not show this dialog again"),
93  QMessageBox::StandardButtons buttons = QMessageBox::Ok,
94  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton,
95  Qt::WindowFlags f = Qt::Tool | Qt::MSWindowsFixedSizeDialogHint);
96 
99  static QMessageBox::StandardButton information (DtDe& de,
100  QWidget * parent, const QString & title, const QString & text,
101  const QString& checkBoxText = QString(),
102  QMessageBox::StandardButtons buttons = QMessageBox::Ok,
103  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton,
104  Qt::WindowFlags f = Qt::Tool | Qt::MSWindowsFixedSizeDialogHint );
105 
108  static QMessageBox::StandardButton information(DtDe& de,
109  QWidget * parent, const QString & title, const QString & text,
110  bool & checkBoxChecked, const QString& checkBoxText = QString::fromStdString("Do not show this dialog again"),
111  QMessageBox::StandardButtons buttons = QMessageBox::Ok,
112  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton,
113  Qt::WindowFlags f = Qt::Tool | Qt::MSWindowsFixedSizeDialogHint);
114 
117  static QMessageBox::StandardButton question (DtDe& de,
118  QWidget * parent, const QString & title, const QString & text,
119  QMessageBox::StandardButtons buttons = QMessageBox::Yes | QMessageBox::No,
120  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton,
121  Qt::WindowFlags f = Qt::MSWindowsFixedSizeDialogHint | Qt::Tool);
122 
125  static QMessageBox::StandardButton question(DtDe& de,
126  QWidget * parent, const QString & title, const QString & text,
127  bool & checkBoxChecked, const QString& checkBoxText = QString::fromStdString("Do not show this dialog again"),
128  QMessageBox::StandardButtons buttons = QMessageBox::Yes | QMessageBox::No,
129  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton,
130  Qt::WindowFlags f = Qt::MSWindowsFixedSizeDialogHint | Qt::Tool);
131 
134  static QMessageBox::StandardButton warning (DtDe& de,
135  QWidget * parent, const QString & title, const QString & text,
136  QMessageBox::StandardButtons buttons = QMessageBox::Ok,
137  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton,
138  Qt::WindowFlags f = Qt::MSWindowsFixedSizeDialogHint | Qt::Tool);
139 
142  static QMessageBox::StandardButton warning(DtDe& de,
143  QWidget * parent, const QString & title, const QString & text,
144  bool & checkBoxChecked, const QString& checkBoxText = QString::fromStdString("Do not show this dialog again"),
145  QMessageBox::StandardButtons buttons = QMessageBox::Ok,
146  QMessageBox::StandardButton defaultButton = QMessageBox::NoButton,
147  Qt::WindowFlags f = Qt::MSWindowsFixedSizeDialogHint | Qt::Tool);
148 
150  static int calculateStepSize( int maxRange, int numberOfSteps );
156  static double calculateStepSize( double maxRange, int numberOfSteps, int decimals );
158 
159  private:
160 
163  static QMessageBox::StandardButton showMessageBox (
164  QMessageBox& mbox, QMessageBox::StandardButton defaultButton);
165 
166  };
167 
168 }
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
Provides static utility functions for Qt.
Definition: DtQtUtil.h:23

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)