[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 |
|
---|
[308aa4] | 17 | #include "Qt4/QtDialog.hpp"
|
---|
| 18 |
|
---|
[0275ad] | 19 | class QHBoxLayout;
|
---|
[a5ddf0] | 20 | class QBoxLayout;
|
---|
| 21 | class QDialogButtonBox;
|
---|
| 22 | class QLabel;
|
---|
| 23 | class QSpinBox;
|
---|
| 24 | class QDoubleSpinBox;
|
---|
| 25 | class QLineEdit;
|
---|
| 26 | class QListWidget;
|
---|
[0275ad] | 27 | class QPushButton;
|
---|
[a5ddf0] | 28 | class QTableWidget;
|
---|
[0275ad] | 29 | class QTextEdit;
|
---|
[a5ddf0] | 30 | class QComboBox;
|
---|
[85b112] | 31 | class QCheckBox;
|
---|
[a5ddf0] | 32 |
|
---|
[308aa4] | 33 | // Forward declarations for plumbing
|
---|
| 34 | template<typename T> class QtQueryListPipe;
|
---|
[a5ddf0] | 35 | class AtomQtQueryPipe;
|
---|
| 36 | class AtomsQtQueryPipe;
|
---|
[308aa4] | 37 | class BooleanQtQueryPipe;
|
---|
| 38 | class BoxQtQueryPipe;
|
---|
| 39 | class DoubleQtQueryPipe;
|
---|
| 40 | class DoublesQtQueryPipe;
|
---|
| 41 | class ElementQtQueryPipe;
|
---|
| 42 | class ElementsQtQueryPipe;
|
---|
[a5ddf0] | 43 | class EmptyQtQueryPipe;
|
---|
| 44 | class FileQtQueryPipe;
|
---|
| 45 | class IntQtQueryPipe;
|
---|
| 46 | class MoleculeQtQueryPipe;
|
---|
| 47 | class MoleculesQtQueryPipe;
|
---|
| 48 | class StringQtQueryPipe;
|
---|
| 49 | class StringsQtQueryPipe;
|
---|
[838cd0] | 50 | class UnsignedIntQtQueryPipe;
|
---|
[12948c] | 51 | class UnsignedIntsQtQueryPipe;
|
---|
[308aa4] | 52 | class VectorQtQueryPipe;
|
---|
| 53 | class VectorsQtQueryPipe;
|
---|
[0275ad] | 54 | class RandomNumberDistribution_ParametersQtQueryPipe;
|
---|
[308aa4] | 55 |
|
---|
| 56 | class QtDialog::AtomQtQuery : public Dialog::AtomQuery {
|
---|
| 57 | public:
|
---|
| 58 | AtomQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 59 | virtual ~AtomQtQuery();
|
---|
| 60 | virtual bool handle();
|
---|
| 61 | private:
|
---|
| 62 | QBoxLayout *parent;
|
---|
| 63 | QBoxLayout *thisLayout;
|
---|
| 64 | QLabel *titleLabel;
|
---|
| 65 | QComboBox *inputBox;
|
---|
| 66 |
|
---|
| 67 | AtomQtQueryPipe *pipe;
|
---|
| 68 | };
|
---|
| 69 |
|
---|
| 70 | class QtDialog::AtomsQtQuery : public Dialog::AtomsQuery {
|
---|
| 71 | public:
|
---|
| 72 | AtomsQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 73 | virtual ~AtomsQtQuery();
|
---|
| 74 | virtual bool handle();
|
---|
| 75 | private:
|
---|
| 76 | QBoxLayout *parent;
|
---|
| 77 | QBoxLayout *thisLayout;
|
---|
| 78 | QLabel *titleLabel;
|
---|
| 79 | QLabel *inputLabel;
|
---|
| 80 | QListWidget *inputList;
|
---|
| 81 |
|
---|
| 82 | AtomsQtQueryPipe *pipe;
|
---|
| 83 | };
|
---|
| 84 |
|
---|
| 85 | class QtDialog::BooleanQtQuery : public Dialog::BooleanQuery {
|
---|
| 86 | public:
|
---|
| 87 | BooleanQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
| 88 | virtual ~BooleanQtQuery();
|
---|
| 89 | virtual bool handle();
|
---|
| 90 | private:
|
---|
| 91 | QBoxLayout *parent;
|
---|
| 92 | QBoxLayout *thisLayout;
|
---|
| 93 | QLabel *titleLabel;
|
---|
[85b112] | 94 | QCheckBox *booleanCheckBox;
|
---|
[308aa4] | 95 |
|
---|
| 96 | BooleanQtQueryPipe *pipe;
|
---|
| 97 | };
|
---|
| 98 |
|
---|
| 99 | class QtDialog::BoxQtQuery : public Dialog::BoxQuery {
|
---|
| 100 | public:
|
---|
| 101 | BoxQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 102 | virtual ~BoxQtQuery();
|
---|
| 103 | virtual bool handle();
|
---|
| 104 | private:
|
---|
| 105 | QBoxLayout *parent;
|
---|
| 106 | QBoxLayout *thisLayout;
|
---|
| 107 | QLabel *titleLabel;
|
---|
| 108 | QTableWidget *inputTable;
|
---|
| 109 |
|
---|
| 110 | BoxQtQueryPipe *pipe;
|
---|
| 111 | };
|
---|
| 112 |
|
---|
| 113 | class QtDialog::DoubleQtQuery : public Dialog::DoubleQuery {
|
---|
| 114 | public:
|
---|
| 115 | DoubleQtQuery(std::string title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 116 | virtual ~DoubleQtQuery();
|
---|
| 117 | virtual bool handle();
|
---|
| 118 | private:
|
---|
| 119 | QBoxLayout *parent;
|
---|
| 120 | QBoxLayout *thisLayout;
|
---|
| 121 | QLabel *titleLabel;
|
---|
| 122 | QDoubleSpinBox *inputBox;
|
---|
| 123 |
|
---|
| 124 | DoubleQtQueryPipe *pipe;
|
---|
| 125 | };
|
---|
| 126 |
|
---|
| 127 | class QtDialog::DoublesQtQuery : public Dialog::DoublesQuery {
|
---|
| 128 | public:
|
---|
| 129 | DoublesQtQuery(std::string title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 130 | virtual ~DoublesQtQuery();
|
---|
| 131 | virtual bool handle();
|
---|
| 132 | private:
|
---|
| 133 | QBoxLayout *parent;
|
---|
| 134 | QBoxLayout *thisLayout;
|
---|
| 135 | QLabel *titleLabel;
|
---|
| 136 | QDoubleSpinBox *inputBox;
|
---|
| 137 |
|
---|
| 138 | QtQueryListPipe<double> *pipe;
|
---|
| 139 | };
|
---|
| 140 |
|
---|
| 141 | class QtDialog::ElementQtQuery : public Dialog::ElementQuery {
|
---|
| 142 | public:
|
---|
| 143 | ElementQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
| 144 | virtual ~ElementQtQuery();
|
---|
| 145 | virtual bool handle();
|
---|
| 146 | private:
|
---|
| 147 | QBoxLayout *parent;
|
---|
| 148 | QBoxLayout *thisLayout;
|
---|
| 149 | QLabel *titleLabel;
|
---|
| 150 | QComboBox *inputBox;
|
---|
| 151 |
|
---|
| 152 | ElementQtQueryPipe *pipe;
|
---|
| 153 | };
|
---|
| 154 |
|
---|
| 155 | class QtDialog::ElementsQtQuery : public Dialog::ElementsQuery {
|
---|
| 156 | public:
|
---|
| 157 | ElementsQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
| 158 | virtual ~ElementsQtQuery();
|
---|
| 159 | virtual bool handle();
|
---|
| 160 | private:
|
---|
| 161 | QBoxLayout *parent;
|
---|
| 162 | QBoxLayout *thisLayout;
|
---|
| 163 | QLabel *titleLabel;
|
---|
| 164 | QComboBox *inputBox;
|
---|
| 165 |
|
---|
| 166 | ElementsQtQueryPipe *pipe;
|
---|
| 167 | };
|
---|
| 168 |
|
---|
| 169 | class QtDialog::EmptyQtQuery : public Dialog::EmptyQuery {
|
---|
| 170 | public:
|
---|
| 171 | EmptyQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
| 172 | virtual ~EmptyQtQuery();
|
---|
| 173 | virtual bool handle();
|
---|
| 174 | private:
|
---|
| 175 | QBoxLayout *parent;
|
---|
| 176 | QBoxLayout *thisLayout;
|
---|
| 177 | QLabel *titleLabel;
|
---|
| 178 |
|
---|
| 179 | EmptyQtQueryPipe *pipe;
|
---|
| 180 | };
|
---|
| 181 |
|
---|
| 182 | class QtDialog::FileQtQuery : public Dialog::FileQuery {
|
---|
| 183 | public:
|
---|
| 184 | FileQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
| 185 | virtual ~FileQtQuery();
|
---|
| 186 | virtual bool handle();
|
---|
| 187 | private:
|
---|
| 188 | QBoxLayout *parent;
|
---|
| 189 | QBoxLayout *thisLayout;
|
---|
| 190 | QLabel *filenameLabel;
|
---|
| 191 | QLineEdit *filenameLineEdit;
|
---|
| 192 | QPushButton *filedialogButton;
|
---|
| 193 |
|
---|
| 194 | FileQtQueryPipe *pipe;
|
---|
| 195 | };
|
---|
| 196 |
|
---|
[2c5765] | 197 | class QtDialog::FilesQtQuery : public Dialog::FilesQuery {
|
---|
| 198 | public:
|
---|
| 199 | FilesQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
| 200 | virtual ~FilesQtQuery();
|
---|
| 201 | virtual bool handle();
|
---|
| 202 | void IntegerEntered(const QString&);
|
---|
| 203 | void IntegerSelected();
|
---|
| 204 | void AddInteger();
|
---|
| 205 | void RemoveInteger();
|
---|
| 206 | private:
|
---|
| 207 | QBoxLayout *parent;
|
---|
| 208 | QBoxLayout *thisLayout;
|
---|
| 209 | QLabel *titleLabel;
|
---|
| 210 |
|
---|
| 211 | QtQueryListPipe<boost::filesystem::path> *pipe;
|
---|
| 212 | };
|
---|
| 213 |
|
---|
[308aa4] | 214 | class QtDialog::IntQtQuery : public Dialog::IntQuery {
|
---|
| 215 | public:
|
---|
| 216 | IntQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 217 | virtual ~IntQtQuery();
|
---|
| 218 | virtual bool handle();
|
---|
| 219 | private:
|
---|
| 220 | QBoxLayout *parent;
|
---|
| 221 | QBoxLayout *thisLayout;
|
---|
| 222 | QLabel *titleLabel;
|
---|
| 223 | QSpinBox *inputBox;
|
---|
| 224 |
|
---|
| 225 | IntQtQueryPipe *pipe;
|
---|
| 226 | };
|
---|
| 227 |
|
---|
| 228 | class QtDialog::IntsQtQuery : public Dialog::IntsQuery {
|
---|
| 229 | public:
|
---|
| 230 | IntsQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 231 | virtual ~IntsQtQuery();
|
---|
| 232 | virtual bool handle();
|
---|
| 233 | void IntegerEntered(const QString&);
|
---|
| 234 | void IntegerSelected();
|
---|
| 235 | void AddInteger();
|
---|
| 236 | void RemoveInteger();
|
---|
| 237 | private:
|
---|
| 238 | QBoxLayout *parent;
|
---|
| 239 | QBoxLayout *thisLayout;
|
---|
| 240 | QLabel *titleLabel;
|
---|
| 241 |
|
---|
| 242 | QtQueryListPipe<int> *pipe;
|
---|
| 243 | };
|
---|
| 244 |
|
---|
| 245 | class QtDialog::MoleculeQtQuery : public Dialog::MoleculeQuery {
|
---|
| 246 | public:
|
---|
| 247 | MoleculeQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 248 | virtual ~MoleculeQtQuery();
|
---|
| 249 | virtual bool handle();
|
---|
| 250 | private:
|
---|
| 251 | QBoxLayout *parent;
|
---|
| 252 | QBoxLayout *thisLayout;
|
---|
| 253 | QLabel *titleLabel;
|
---|
| 254 | QComboBox *inputBox;
|
---|
| 255 |
|
---|
| 256 | MoleculeQtQueryPipe *pipe;
|
---|
| 257 | };
|
---|
| 258 |
|
---|
| 259 | class QtDialog::MoleculesQtQuery : public Dialog::MoleculesQuery {
|
---|
| 260 | public:
|
---|
| 261 | MoleculesQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 262 | virtual ~MoleculesQtQuery();
|
---|
| 263 | virtual bool handle();
|
---|
| 264 | private:
|
---|
| 265 | QBoxLayout *parent;
|
---|
| 266 | QBoxLayout *thisLayout;
|
---|
| 267 | QLabel *titleLabel;
|
---|
| 268 | QComboBox *inputBox;
|
---|
| 269 |
|
---|
| 270 | MoleculesQtQueryPipe *pipe;
|
---|
| 271 | };
|
---|
| 272 |
|
---|
| 273 | class QtDialog::StringQtQuery : public Dialog::StringQuery {
|
---|
| 274 | public:
|
---|
| 275 | StringQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 276 | virtual ~StringQtQuery();
|
---|
| 277 | virtual bool handle();
|
---|
| 278 | private:
|
---|
| 279 | QBoxLayout *parent;
|
---|
| 280 | QBoxLayout *thisLayout;
|
---|
| 281 | QLabel *titleLabel;
|
---|
| 282 | QLineEdit *inputBox;
|
---|
| 283 |
|
---|
| 284 | StringQtQueryPipe *pipe;
|
---|
| 285 | };
|
---|
| 286 |
|
---|
| 287 | class QtDialog::StringsQtQuery : public Dialog::StringsQuery {
|
---|
| 288 | public:
|
---|
| 289 | StringsQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 290 | virtual ~StringsQtQuery();
|
---|
| 291 | virtual bool handle();
|
---|
| 292 | private:
|
---|
| 293 | QBoxLayout *parent;
|
---|
| 294 | QBoxLayout *thisLayout;
|
---|
| 295 | QLabel *titleLabel;
|
---|
| 296 | QLineEdit *inputBox;
|
---|
| 297 |
|
---|
| 298 | QtQueryListPipe<std::string> *pipe;
|
---|
| 299 | };
|
---|
| 300 |
|
---|
[838cd0] | 301 | class QtDialog::UnsignedIntQtQuery : public Dialog::UnsignedIntQuery {
|
---|
| 302 | public:
|
---|
| 303 | UnsignedIntQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 304 | virtual ~UnsignedIntQtQuery();
|
---|
| 305 | virtual bool handle();
|
---|
| 306 | private:
|
---|
| 307 | QBoxLayout *parent;
|
---|
| 308 | QBoxLayout *thisLayout;
|
---|
| 309 | QLabel *titleLabel;
|
---|
| 310 | QSpinBox *inputBox;
|
---|
| 311 |
|
---|
| 312 | UnsignedIntQtQueryPipe *pipe;
|
---|
| 313 | };
|
---|
| 314 |
|
---|
[12948c] | 315 | class QtDialog::UnsignedIntsQtQuery : public Dialog::UnsignedIntsQuery {
|
---|
| 316 | public:
|
---|
| 317 | UnsignedIntsQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
| 318 | virtual ~UnsignedIntsQtQuery();
|
---|
| 319 | virtual bool handle();
|
---|
| 320 | void IntegerEntered(const QString&);
|
---|
| 321 | void IntegerSelected();
|
---|
| 322 | void AddInteger();
|
---|
| 323 | void RemoveInteger();
|
---|
| 324 | private:
|
---|
| 325 | QBoxLayout *parent;
|
---|
| 326 | QBoxLayout *thisLayout;
|
---|
| 327 | QLabel *titleLabel;
|
---|
| 328 |
|
---|
| 329 | QtQueryListPipe<unsigned int> *pipe;
|
---|
| 330 | };
|
---|
| 331 |
|
---|
| 332 |
|
---|
[308aa4] | 333 | class QtDialog::VectorQtQuery : public Dialog::VectorQuery {
|
---|
| 334 | public:
|
---|
| 335 | VectorQtQuery(std::string title,bool _check,QBoxLayout *,QtDialog *);
|
---|
| 336 | virtual ~VectorQtQuery();
|
---|
| 337 | virtual bool handle();
|
---|
| 338 | private:
|
---|
| 339 | QBoxLayout *parent;
|
---|
| 340 | QBoxLayout *mainLayout;
|
---|
| 341 | QLabel *titleLabel;
|
---|
| 342 | QBoxLayout *subLayout;
|
---|
| 343 | QBoxLayout *coordLayout;
|
---|
| 344 | QLabel *coordLabel;
|
---|
[a14fe3] | 345 | QDoubleSpinBox *coordInputX;
|
---|
| 346 | QDoubleSpinBox *coordInputY;
|
---|
| 347 | QDoubleSpinBox *coordInputZ;
|
---|
[308aa4] | 348 |
|
---|
| 349 | VectorQtQueryPipe *pipe;
|
---|
| 350 | };
|
---|
| 351 |
|
---|
| 352 | class QtDialog::VectorsQtQuery : public Dialog::VectorsQuery {
|
---|
| 353 | public:
|
---|
| 354 | VectorsQtQuery(std::string title,bool _check,QBoxLayout *,QtDialog *);
|
---|
| 355 | virtual ~VectorsQtQuery();
|
---|
| 356 | virtual bool handle();
|
---|
| 357 | private:
|
---|
| 358 | QBoxLayout *parent;
|
---|
| 359 | QBoxLayout *mainLayout;
|
---|
| 360 | QLabel *titleLabel;
|
---|
| 361 | QBoxLayout *subLayout;
|
---|
| 362 | QBoxLayout *coordLayout;
|
---|
| 363 | QLabel *coordLabel;
|
---|
| 364 | QDoubleSpinBox *coordInput;
|
---|
| 365 |
|
---|
| 366 | VectorsQtQueryPipe *pipe;
|
---|
| 367 | };
|
---|
| 368 |
|
---|
[0275ad] | 369 | class QtDialog::RandomNumberDistribution_ParametersQtQuery : public Dialog::RandomNumberDistribution_ParametersQuery {
|
---|
| 370 | public:
|
---|
| 371 | RandomNumberDistribution_ParametersQtQuery(std::string title,QBoxLayout *,QtDialog *);
|
---|
| 372 | virtual ~RandomNumberDistribution_ParametersQtQuery();
|
---|
| 373 | virtual bool handle();
|
---|
| 374 | private:
|
---|
| 375 | QBoxLayout *parent;
|
---|
| 376 | QHBoxLayout *thisLayout;
|
---|
| 377 | QLabel *titleLabel;
|
---|
| 378 | QTextEdit *inputBox;
|
---|
| 379 | QPushButton *okButton;
|
---|
| 380 |
|
---|
| 381 | RandomNumberDistribution_ParametersQtQueryPipe *pipe;
|
---|
| 382 | };
|
---|
| 383 |
|
---|
[308aa4] | 384 | #endif /* QTQUERY_HPP_ */
|
---|