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