1 #ifndef OPTIONSFORM_HPP 2 #define OPTIONSFORM_HPP 3 /* 4 Copyright © 2008-13 Qtrac Ltd. All rights reserved. 5 This program or module is free software: you can redistribute it 6 and/or modify it under the terms of the GNU General Public License 7 as published by the Free Software Foundation, either version 2 of 8 the License, or (at your option) any later version. This program is 9 distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 for more details. 13 */ 14 15 #include <QBrush> 16 #include <QDialog> 17 #include <QPen> 18 19 class QCheckBox; 20 class QComboBox; 21 class QDialogButtonBox; 22 class QDoubleSpinBox; 23 class QSpinBox; 24 class QTabWidget; 25 26 27 class OptionsForm : public QDialog 28 { 29 Q_OBJECT 30 31 public: 32 OptionsForm(QPen *pen, QBrush *brush, qreal *ruleWidth, 33 bool *showToolTips, bool *combineTextHighlighting, 34 int *cacheSize, int *alpha, int *squareSize, 35 QWidget *parent=0); 36 37 private slots: 38 void updateColor(int index); 39 void updateBrushStyle(int index); 40 void updatePenStyle(int index); 41 void updateSwatches(); 42 void updateUi(); 43 void accept(); 44 45 private: 46 void createWidgets(); 47 void createLayout(); 48 void createConnections(); 49 50 QTabWidget *tabWidget; 51 QComboBox *colorComboBox; 52 QComboBox *brushStyleComboBox; 53 QComboBox *penStyleComboBox; 54 QSpinBox *alphaSpinBox; 55 QSpinBox *squareSizeSpinBox; 56 QDoubleSpinBox *ruleWidthSpinBox; 57 QCheckBox *showToolTipsCheckBox; 58 QCheckBox *combineTextHighlightingCheckBox; 59 QSpinBox *cacheSizeSpinBox; 60 QDialogButtonBox *buttonBox; 61 62 QPen *m_pen; 63 QBrush *m_brush; 64 qreal *m_ruleWidth; 65 bool *m_showToolTips; 66 bool *m_combineTextHighlighting; 67 int *m_cacheSize; 68 int *m_alpha; 69 int *m_squareSize; 70 QPen pen; 71 QBrush brush; 72 }; 73 74 #endif // OPTIONSFORM_HPP 75 76 77