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