[308aa4] | 1 | /*
|
---|
| 2 | * QtQuery.hpp
|
---|
| 3 | *
|
---|
| 4 | * Created on: Nov 8, 2010
|
---|
| 5 | * Author: heber
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #ifndef QTQUERY_HPP_
|
---|
| 9 | #define QTQUERY_HPP_
|
---|
| 10 |
|
---|
[56f73b] | 11 | // include config.h
|
---|
| 12 | #ifdef HAVE_CONFIG_H
|
---|
| 13 | #include <config.h>
|
---|
| 14 | #endif
|
---|
| 15 |
|
---|
| 16 |
|
---|
[7c9921] | 17 | #include <Qt/qwidget.h>
|
---|
[308aa4] | 18 | #include "Qt4/QtDialog.hpp"
|
---|
[7b8a8e] | 19 | #include "QtQueryList.hpp"
|
---|
[308aa4] | 20 |
|
---|
[33e801] | 21 | #include "Parameters/Parameter.hpp"
|
---|
| 22 |
|
---|
[0275ad] | 23 | class QHBoxLayout;
|
---|
[a5ddf0] | 24 | class QBoxLayout;
|
---|
| 25 | class QDialogButtonBox;
|
---|
| 26 | class QLabel;
|
---|
| 27 | class QSpinBox;
|
---|
| 28 | class QDoubleSpinBox;
|
---|
| 29 | class QLineEdit;
|
---|
| 30 | class QListWidget;
|
---|
[0275ad] | 31 | class QPushButton;
|
---|
[a5ddf0] | 32 | class QTableWidget;
|
---|
[0275ad] | 33 | class QTextEdit;
|
---|
[a5ddf0] | 34 | class QComboBox;
|
---|
[85b112] | 35 | class QCheckBox;
|
---|
[7c9921] | 36 | class QFileDialog;
|
---|
[a5ddf0] | 37 |
|
---|
[852ea3] | 38 | template<class T>
|
---|
| 39 | class QtQuery : public Dialog::TQuery<T>
|
---|
| 40 | {
|
---|
| 41 | public:
|
---|
[f130d4] | 42 | QtQuery(Parameter<T> &_param, const std::string &_title, const std::string &_description = "") :
|
---|
| 43 | Dialog::TQuery<T>(_param, _title, _description) {}
|
---|
[852ea3] | 44 | // QtQueries are interactive - no need for handle().
|
---|
| 45 | virtual bool handle(){ return true; }
|
---|
| 46 | };
|
---|
| 47 |
|
---|
| 48 | class QtDialog::AtomQtQuery : public QWidget, public QtQuery<const atom *> {
|
---|
[7c9921] | 49 | Q_OBJECT
|
---|
[308aa4] | 50 | public:
|
---|
[f130d4] | 51 | AtomQtQuery(Parameter<const atom *> &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[308aa4] | 52 | virtual ~AtomQtQuery();
|
---|
[7c9921] | 53 |
|
---|
| 54 | public slots:
|
---|
| 55 | void onUpdate(int);
|
---|
| 56 |
|
---|
[308aa4] | 57 | private:
|
---|
| 58 | QBoxLayout *parent;
|
---|
| 59 | QBoxLayout *thisLayout;
|
---|
| 60 | QLabel *titleLabel;
|
---|
| 61 | QComboBox *inputBox;
|
---|
[7dfd07] | 62 | Dialog *dialog;
|
---|
[308aa4] | 63 | };
|
---|
| 64 |
|
---|
[852ea3] | 65 | class QtDialog::AtomsQtQuery : public QWidget, public QtQuery<std::vector<const atom *> >, public QtQueryList<const atom *> {
|
---|
[7c9921] | 66 | Q_OBJECT
|
---|
[308aa4] | 67 | public:
|
---|
[f130d4] | 68 | AtomsQtQuery(Parameter<std::vector<const atom *> > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[308aa4] | 69 | virtual ~AtomsQtQuery();
|
---|
[7c9921] | 70 |
|
---|
[2f4e81] | 71 | virtual void onSubUpdate();
|
---|
| 72 |
|
---|
[7c9921] | 73 | public slots:
|
---|
[2f4e81] | 74 | void onAddElement();
|
---|
| 75 | void onRemoveElement();
|
---|
| 76 | void onElementSelected();
|
---|
[7c9921] | 77 |
|
---|
[308aa4] | 78 | private:
|
---|
[2f4e81] | 79 | AtomQtQuery *subQuery;
|
---|
[308aa4] | 80 | };
|
---|
| 81 |
|
---|
[852ea3] | 82 | class QtDialog::BooleanQtQuery : public QWidget, public QtQuery<bool> {
|
---|
[7c9921] | 83 | Q_OBJECT
|
---|
[308aa4] | 84 | public:
|
---|
[f130d4] | 85 | BooleanQtQuery(Parameter<bool> &, const std::string &_title, const std::string &description, QBoxLayout *_parent, Dialog *_dialog);
|
---|
[308aa4] | 86 | virtual ~BooleanQtQuery();
|
---|
[7c9921] | 87 |
|
---|
| 88 | public slots:
|
---|
| 89 | void onUpdate(int);
|
---|
| 90 |
|
---|
[308aa4] | 91 | private:
|
---|
| 92 | QBoxLayout *parent;
|
---|
| 93 | QBoxLayout *thisLayout;
|
---|
| 94 | QLabel *titleLabel;
|
---|
[85b112] | 95 | QCheckBox *booleanCheckBox;
|
---|
[7dfd07] | 96 | Dialog *dialog;
|
---|
[308aa4] | 97 | };
|
---|
| 98 |
|
---|
[852ea3] | 99 | class QtDialog::RealSpaceMatrixQtQuery : public QWidget, public QtQuery<RealSpaceMatrix> {
|
---|
[7c9921] | 100 | Q_OBJECT
|
---|
[308aa4] | 101 | public:
|
---|
[f130d4] | 102 | RealSpaceMatrixQtQuery(Parameter<RealSpaceMatrix> &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[7d9416] | 103 | virtual ~RealSpaceMatrixQtQuery();
|
---|
[7c9921] | 104 |
|
---|
| 105 | public slots:
|
---|
| 106 | void onUpdate(int, int);
|
---|
| 107 |
|
---|
[308aa4] | 108 | private:
|
---|
| 109 | QBoxLayout *parent;
|
---|
| 110 | QBoxLayout *thisLayout;
|
---|
| 111 | QLabel *titleLabel;
|
---|
| 112 | QTableWidget *inputTable;
|
---|
[7dfd07] | 113 | Dialog *dialog;
|
---|
[308aa4] | 114 | };
|
---|
| 115 |
|
---|
[852ea3] | 116 | class QtDialog::DoubleQtQuery : public QWidget, public QtQuery<double> {
|
---|
[7c9921] | 117 | Q_OBJECT
|
---|
[308aa4] | 118 | public:
|
---|
[f130d4] | 119 | DoubleQtQuery(Parameter<double> &, const std::string &_title, const std::string &_description,QBoxLayout *_parent,Dialog *_dialog);
|
---|
[308aa4] | 120 | virtual ~DoubleQtQuery();
|
---|
[7c9921] | 121 |
|
---|
| 122 | public slots:
|
---|
| 123 | void onUpdate(double);
|
---|
| 124 |
|
---|
[308aa4] | 125 | private:
|
---|
| 126 | QBoxLayout *parent;
|
---|
| 127 | QBoxLayout *thisLayout;
|
---|
| 128 | QLabel *titleLabel;
|
---|
| 129 | QDoubleSpinBox *inputBox;
|
---|
[7dfd07] | 130 | Dialog *dialog;
|
---|
[308aa4] | 131 | };
|
---|
| 132 |
|
---|
[852ea3] | 133 | class QtDialog::DoublesQtQuery : public QWidget, public QtQuery<std::vector<double> >, public QtQueryList<double> {
|
---|
[7c9921] | 134 | Q_OBJECT
|
---|
[308aa4] | 135 | public:
|
---|
[f130d4] | 136 | DoublesQtQuery(Parameter<std::vector<double> > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[308aa4] | 137 | virtual ~DoublesQtQuery();
|
---|
[7c9921] | 138 |
|
---|
[7e8e79] | 139 | virtual void onSubUpdate();
|
---|
| 140 |
|
---|
[7c9921] | 141 | public slots:
|
---|
[7e8e79] | 142 | void onAddElement();
|
---|
| 143 | void onRemoveElement();
|
---|
| 144 | void onElementSelected();
|
---|
[7c9921] | 145 |
|
---|
[308aa4] | 146 | private:
|
---|
[7e8e79] | 147 | DoubleQtQuery *subQuery;
|
---|
[308aa4] | 148 | };
|
---|
| 149 |
|
---|
[852ea3] | 150 | class QtDialog::ElementQtQuery : public QWidget, public QtQuery<const element *> {
|
---|
[7c9921] | 151 | Q_OBJECT
|
---|
[308aa4] | 152 | public:
|
---|
[f130d4] | 153 | ElementQtQuery(Parameter<const element *> &, const std::string &_title, const std::string &description, QBoxLayout *_parent, Dialog *_dialog);
|
---|
[308aa4] | 154 | virtual ~ElementQtQuery();
|
---|
[7c9921] | 155 |
|
---|
| 156 | public slots:
|
---|
| 157 | void onUpdate(int);
|
---|
| 158 |
|
---|
[308aa4] | 159 | private:
|
---|
| 160 | QBoxLayout *parent;
|
---|
| 161 | QBoxLayout *thisLayout;
|
---|
| 162 | QLabel *titleLabel;
|
---|
| 163 | QComboBox *inputBox;
|
---|
[7dfd07] | 164 | Dialog *dialog;
|
---|
[308aa4] | 165 | };
|
---|
| 166 |
|
---|
[852ea3] | 167 | class QtDialog::ElementsQtQuery : public QWidget, public QtQuery<std::vector<const element *> >, public QtQueryList<const element *> {
|
---|
[7c9921] | 168 | Q_OBJECT
|
---|
[308aa4] | 169 | public:
|
---|
[f130d4] | 170 | ElementsQtQuery(Parameter<std::vector<const element *> > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[308aa4] | 171 | virtual ~ElementsQtQuery();
|
---|
[7c9921] | 172 |
|
---|
[572701] | 173 | virtual void onSubUpdate();
|
---|
| 174 |
|
---|
[7c9921] | 175 | public slots:
|
---|
[572701] | 176 | void onAddElement();
|
---|
| 177 | void onRemoveElement();
|
---|
| 178 | void onElementSelected();
|
---|
[7c9921] | 179 |
|
---|
[308aa4] | 180 | private:
|
---|
[572701] | 181 | ElementQtQuery *subQuery;
|
---|
[308aa4] | 182 | };
|
---|
| 183 |
|
---|
| 184 | class QtDialog::EmptyQtQuery : public Dialog::EmptyQuery {
|
---|
| 185 | public:
|
---|
[f130d4] | 186 | EmptyQtQuery(const std::string &_title, const std::string &description, QBoxLayout *_parent, Dialog *_dialog);
|
---|
[308aa4] | 187 | virtual ~EmptyQtQuery();
|
---|
| 188 | virtual bool handle();
|
---|
| 189 | private:
|
---|
| 190 | QBoxLayout *parent;
|
---|
| 191 | QBoxLayout *thisLayout;
|
---|
| 192 | QLabel *titleLabel;
|
---|
[7dfd07] | 193 | Dialog *dialog;
|
---|
[308aa4] | 194 | };
|
---|
| 195 |
|
---|
[852ea3] | 196 | class QtDialog::FileQtQuery : public QWidget, public QtQuery<boost::filesystem::path> {
|
---|
[7c9921] | 197 | Q_OBJECT
|
---|
[308aa4] | 198 | public:
|
---|
[f130d4] | 199 | FileQtQuery(Parameter<boost::filesystem::path> &, const std::string &_title, const std::string &description, QBoxLayout *_parent, Dialog *_dialog);
|
---|
[308aa4] | 200 | virtual ~FileQtQuery();
|
---|
[7c9921] | 201 |
|
---|
| 202 | public slots:
|
---|
| 203 | void onUpdate();
|
---|
| 204 | void showFileDialog();
|
---|
| 205 |
|
---|
[308aa4] | 206 | private:
|
---|
| 207 | QBoxLayout *parent;
|
---|
| 208 | QBoxLayout *thisLayout;
|
---|
| 209 | QLabel *filenameLabel;
|
---|
| 210 | QLineEdit *filenameLineEdit;
|
---|
| 211 | QPushButton *filedialogButton;
|
---|
[7c9921] | 212 | QFileDialog *theFileDialog;
|
---|
[7dfd07] | 213 | Dialog *dialog;
|
---|
[dae158] | 214 | std::vector<std::string> suffixes;
|
---|
| 215 | bool mustBePresent;
|
---|
[308aa4] | 216 | };
|
---|
| 217 |
|
---|
[852ea3] | 218 | class QtDialog::FilesQtQuery : public QWidget, public QtQuery<std::vector<boost::filesystem::path> >, public QtQueryList<boost::filesystem::path> {
|
---|
[7c9921] | 219 | Q_OBJECT
|
---|
[2c5765] | 220 | public:
|
---|
[f130d4] | 221 | FilesQtQuery(Parameter<std::vector<boost::filesystem::path> > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[2c5765] | 222 | virtual ~FilesQtQuery();
|
---|
[324403] | 223 |
|
---|
| 224 | virtual void onSubUpdate();
|
---|
[7c9921] | 225 |
|
---|
| 226 | public slots:
|
---|
[324403] | 227 | void onAddElement();
|
---|
| 228 | void onRemoveElement();
|
---|
| 229 | void onElementSelected();
|
---|
[7c9921] | 230 |
|
---|
[2c5765] | 231 | private:
|
---|
[324403] | 232 | FileQtQuery *subQuery;
|
---|
[2c5765] | 233 | };
|
---|
| 234 |
|
---|
[852ea3] | 235 | class QtDialog::IntQtQuery : public QWidget, public QtQuery<int> {
|
---|
[7c9921] | 236 | Q_OBJECT
|
---|
[308aa4] | 237 | public:
|
---|
[f130d4] | 238 | IntQtQuery(Parameter<int> &, const std::string &_title, const std::string &description,QBoxLayout *_parent,Dialog *_dialog);
|
---|
[308aa4] | 239 | virtual ~IntQtQuery();
|
---|
[7c9921] | 240 |
|
---|
| 241 | public slots:
|
---|
| 242 | void onUpdate(int);
|
---|
| 243 |
|
---|
[308aa4] | 244 | private:
|
---|
| 245 | QBoxLayout *parent;
|
---|
| 246 | QBoxLayout *thisLayout;
|
---|
| 247 | QLabel *titleLabel;
|
---|
| 248 | QSpinBox *inputBox;
|
---|
[7dfd07] | 249 | Dialog *dialog;
|
---|
[308aa4] | 250 | };
|
---|
| 251 |
|
---|
[852ea3] | 252 | class QtDialog::IntsQtQuery : public QWidget, public QtQuery<std::vector<int> >, public QtQueryList<int> {
|
---|
[7c9921] | 253 | Q_OBJECT
|
---|
[308aa4] | 254 | public:
|
---|
[f130d4] | 255 | IntsQtQuery(Parameter<std::vector<int> > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[308aa4] | 256 | virtual ~IntsQtQuery();
|
---|
[26ac2d] | 257 |
|
---|
| 258 | virtual void onSubUpdate();
|
---|
[7c9921] | 259 |
|
---|
| 260 | public slots:
|
---|
[26ac2d] | 261 | void onAddElement();
|
---|
| 262 | void onRemoveElement();
|
---|
| 263 | void onElementSelected();
|
---|
[7c9921] | 264 |
|
---|
[308aa4] | 265 | private:
|
---|
[26ac2d] | 266 | IntQtQuery *subQuery;
|
---|
[308aa4] | 267 | };
|
---|
| 268 |
|
---|
[852ea3] | 269 | class QtDialog::MoleculeQtQuery : public QWidget, public QtQuery<const molecule *> {
|
---|
[7c9921] | 270 | Q_OBJECT
|
---|
[308aa4] | 271 | public:
|
---|
[f130d4] | 272 | MoleculeQtQuery(Parameter<const molecule *> &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[308aa4] | 273 | virtual ~MoleculeQtQuery();
|
---|
[7c9921] | 274 |
|
---|
| 275 | public slots:
|
---|
| 276 | void onUpdate(int);
|
---|
| 277 |
|
---|
[308aa4] | 278 | private:
|
---|
| 279 | QBoxLayout *parent;
|
---|
| 280 | QBoxLayout *thisLayout;
|
---|
| 281 | QLabel *titleLabel;
|
---|
| 282 | QComboBox *inputBox;
|
---|
[7dfd07] | 283 | Dialog *dialog;
|
---|
[308aa4] | 284 | };
|
---|
| 285 |
|
---|
[852ea3] | 286 | class QtDialog::MoleculesQtQuery : public QWidget, public QtQuery<std::vector<const molecule *> >, public QtQueryList<const molecule *> {
|
---|
[7c9921] | 287 | Q_OBJECT
|
---|
[308aa4] | 288 | public:
|
---|
[f130d4] | 289 | MoleculesQtQuery(Parameter<std::vector<const molecule *> > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[308aa4] | 290 | virtual ~MoleculesQtQuery();
|
---|
[7c9921] | 291 |
|
---|
[1ae820] | 292 | virtual void onSubUpdate();
|
---|
| 293 |
|
---|
[7c9921] | 294 | public slots:
|
---|
[1ae820] | 295 | void onAddElement();
|
---|
| 296 | void onRemoveElement();
|
---|
| 297 | void onElementSelected();
|
---|
[7c9921] | 298 |
|
---|
[308aa4] | 299 | private:
|
---|
[1ae820] | 300 | MoleculeQtQuery *subQuery;
|
---|
[308aa4] | 301 | };
|
---|
| 302 |
|
---|
[33e801] | 303 | class QtDialog::KeyValuePairQtQuery : public QWidget, public QtQuery<KeyValuePair> {
|
---|
| 304 | Q_OBJECT
|
---|
| 305 | public:
|
---|
| 306 | KeyValuePairQtQuery(Parameter<KeyValuePair> &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
| 307 | virtual ~KeyValuePairQtQuery();
|
---|
| 308 |
|
---|
| 309 | public slots:
|
---|
| 310 | void onUpdate(const QString&);
|
---|
| 311 | void onUpdateCombo(int index);
|
---|
| 312 |
|
---|
| 313 | private:
|
---|
| 314 | QBoxLayout *parent;
|
---|
| 315 | QBoxLayout *thisLayout;
|
---|
| 316 | QLabel *titleLabel;
|
---|
| 317 | QLineEdit *inputBox;
|
---|
| 318 | QComboBox *comboBox;
|
---|
| 319 | Dialog *dialog;
|
---|
| 320 | };
|
---|
| 321 |
|
---|
| 322 | class QtDialog::KeyValuePairsQtQuery : public QWidget, public QtQuery<std::vector<KeyValuePair> >, public QtQueryList<KeyValuePair> {
|
---|
| 323 | Q_OBJECT
|
---|
| 324 | public:
|
---|
| 325 | KeyValuePairsQtQuery(Parameter<std::vector<KeyValuePair> > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
| 326 | virtual ~KeyValuePairsQtQuery();
|
---|
| 327 |
|
---|
| 328 | virtual void onSubUpdate();
|
---|
| 329 |
|
---|
| 330 | public slots:
|
---|
| 331 | void onAddElement();
|
---|
| 332 | void onRemoveElement();
|
---|
| 333 | void onElementSelected();
|
---|
| 334 |
|
---|
| 335 | private:
|
---|
| 336 | KeyValuePairQtQuery *subQuery;
|
---|
| 337 | };
|
---|
| 338 |
|
---|
[852ea3] | 339 | class QtDialog::StringQtQuery : public QWidget, public QtQuery<std::string> {
|
---|
[7c9921] | 340 | Q_OBJECT
|
---|
[308aa4] | 341 | public:
|
---|
[f130d4] | 342 | StringQtQuery(Parameter<std::string> &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[308aa4] | 343 | virtual ~StringQtQuery();
|
---|
[7c9921] | 344 |
|
---|
| 345 | public slots:
|
---|
| 346 | void onUpdate(const QString&);
|
---|
[dbf6c7] | 347 | void onUpdateCombo(int index);
|
---|
[7c9921] | 348 |
|
---|
[308aa4] | 349 | private:
|
---|
| 350 | QBoxLayout *parent;
|
---|
| 351 | QBoxLayout *thisLayout;
|
---|
| 352 | QLabel *titleLabel;
|
---|
| 353 | QLineEdit *inputBox;
|
---|
[dbf6c7] | 354 | QComboBox *comboBox;
|
---|
[7dfd07] | 355 | Dialog *dialog;
|
---|
[308aa4] | 356 | };
|
---|
| 357 |
|
---|
[852ea3] | 358 | class QtDialog::StringsQtQuery : public QWidget, public QtQuery<std::vector<std::string> >, public QtQueryList<std::string> {
|
---|
[7c9921] | 359 | Q_OBJECT
|
---|
[308aa4] | 360 | public:
|
---|
[f130d4] | 361 | StringsQtQuery(Parameter<std::vector<std::string> > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[308aa4] | 362 | virtual ~StringsQtQuery();
|
---|
[7c9921] | 363 |
|
---|
[7b8a8e] | 364 | virtual void onSubUpdate();
|
---|
| 365 |
|
---|
[7c9921] | 366 | public slots:
|
---|
[7b8a8e] | 367 | void onAddElement();
|
---|
| 368 | void onRemoveElement();
|
---|
| 369 | void onElementSelected();
|
---|
[7c9921] | 370 |
|
---|
[308aa4] | 371 | private:
|
---|
[7b8a8e] | 372 | StringQtQuery *subQuery;
|
---|
[308aa4] | 373 | };
|
---|
| 374 |
|
---|
[852ea3] | 375 | class QtDialog::UnsignedIntQtQuery : public QWidget, public QtQuery<unsigned int> {
|
---|
[7c9921] | 376 | Q_OBJECT
|
---|
[838cd0] | 377 | public:
|
---|
[f130d4] | 378 | UnsignedIntQtQuery(Parameter<unsigned int> &, const std::string &_title, const std::string &description,QBoxLayout *_parent,Dialog *_dialog);
|
---|
[838cd0] | 379 | virtual ~UnsignedIntQtQuery();
|
---|
[7c9921] | 380 |
|
---|
| 381 | public slots:
|
---|
[a2aa2f] | 382 | void onUpdate(int);
|
---|
[7c9921] | 383 |
|
---|
[838cd0] | 384 | private:
|
---|
| 385 | QBoxLayout *parent;
|
---|
| 386 | QBoxLayout *thisLayout;
|
---|
| 387 | QLabel *titleLabel;
|
---|
| 388 | QSpinBox *inputBox;
|
---|
[7dfd07] | 389 | Dialog *dialog;
|
---|
[838cd0] | 390 | };
|
---|
| 391 |
|
---|
[852ea3] | 392 | class QtDialog::UnsignedIntsQtQuery : public QWidget, public QtQuery<std::vector<unsigned int> >, public QtQueryList<unsigned int> {
|
---|
[7c9921] | 393 | Q_OBJECT
|
---|
[12948c] | 394 | public:
|
---|
[f130d4] | 395 | UnsignedIntsQtQuery(Parameter<std::vector<unsigned int> > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[12948c] | 396 | virtual ~UnsignedIntsQtQuery();
|
---|
[a2aa2f] | 397 |
|
---|
| 398 | virtual void onSubUpdate();
|
---|
[7c9921] | 399 |
|
---|
| 400 | public slots:
|
---|
[a2aa2f] | 401 | void onAddElement();
|
---|
| 402 | void onRemoveElement();
|
---|
| 403 | void onElementSelected();
|
---|
[7c9921] | 404 |
|
---|
[12948c] | 405 | private:
|
---|
[a2aa2f] | 406 | UnsignedIntQtQuery *subQuery;
|
---|
[12948c] | 407 | };
|
---|
| 408 |
|
---|
[852ea3] | 409 | class QtDialog::VectorQtQuery : public QWidget, public QtQuery<Vector> {
|
---|
[7c9921] | 410 | Q_OBJECT
|
---|
[308aa4] | 411 | public:
|
---|
[f130d4] | 412 | VectorQtQuery(Parameter<Vector> &, const std::string &_title, const std::string &_description,QBoxLayout *,Dialog *);
|
---|
[308aa4] | 413 | virtual ~VectorQtQuery();
|
---|
[7c9921] | 414 |
|
---|
| 415 | public slots:
|
---|
| 416 | void onUpdateX(double);
|
---|
| 417 | void onUpdateY(double);
|
---|
| 418 | void onUpdateZ(double);
|
---|
| 419 |
|
---|
[308aa4] | 420 | private:
|
---|
| 421 | QBoxLayout *parent;
|
---|
| 422 | QBoxLayout *mainLayout;
|
---|
| 423 | QLabel *titleLabel;
|
---|
| 424 | QBoxLayout *subLayout;
|
---|
| 425 | QBoxLayout *coordLayout;
|
---|
| 426 | QLabel *coordLabel;
|
---|
[a14fe3] | 427 | QDoubleSpinBox *coordInputX;
|
---|
| 428 | QDoubleSpinBox *coordInputY;
|
---|
| 429 | QDoubleSpinBox *coordInputZ;
|
---|
[7dfd07] | 430 | Dialog *dialog;
|
---|
[308aa4] | 431 | };
|
---|
| 432 |
|
---|
[852ea3] | 433 | class QtDialog::VectorsQtQuery : public QWidget, public QtQuery<std::vector<Vector> >, public QtQueryList<Vector> {
|
---|
[7c9921] | 434 | Q_OBJECT
|
---|
[308aa4] | 435 | public:
|
---|
[f130d4] | 436 | VectorsQtQuery(Parameter<std::vector<Vector> > &, const std::string &_title, const std::string &description, QBoxLayout *_parent,Dialog *_dialog);
|
---|
[308aa4] | 437 | virtual ~VectorsQtQuery();
|
---|
[7c9921] | 438 |
|
---|
[f84992] | 439 | virtual void onSubUpdate();
|
---|
| 440 |
|
---|
[7c9921] | 441 | public slots:
|
---|
[f84992] | 442 | void onAddElement();
|
---|
| 443 | void onRemoveElement();
|
---|
| 444 | void onElementSelected();
|
---|
[7c9921] | 445 |
|
---|
[308aa4] | 446 | private:
|
---|
[f84992] | 447 | VectorQtQuery *subQuery;
|
---|
[308aa4] | 448 | };
|
---|
| 449 |
|
---|
| 450 | #endif /* QTQUERY_HPP_ */
|
---|