| 34 | #include "IPPropertyWidget.h" |
| 35 | |
| 36 | class IPPropertyColorRGB : public IPPropertyWidget, public IPLColorPickHandler |
| 37 | { |
| 38 | Q_OBJECT |
| 39 | public: |
| 40 | explicit IPPropertyColorRGB(IPLProcessPropertyColor* property, QWidget *parent, IPLColorPickProvider* provider) : IPPropertyWidget(property, parent) |
| 41 | { |
| 42 | _layout = new QGridLayout; |
| 43 | _layout->setMargin(0); |
| 44 | setLayout(_layout); |
| 45 | |
| 46 | _dialog = NULL; |
| 47 | |
| 48 | _property = property; |
| 49 | _colorProvider = provider; |
| 50 | |
| 51 | _colorPickCursor = new QCursor(QPixmap(":/colorpicker_cursor.png"), 9, 21); |
| 52 | |
| 53 | _sliderR = new QSlider(Qt::Horizontal); |
| 54 | _sliderG = new QSlider(Qt::Horizontal); |
| 55 | _sliderB = new QSlider(Qt::Horizontal); |
| 56 | |
| 57 | _colorLabel = new QPushButton(""); |
| 58 | _colorLabel->setMinimumHeight(20); |
| 59 | //_colorLabel->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); |
| 60 | |
| 61 | |
| 62 | QPalette paletteRed; |
| 63 | paletteRed.setColor(QPalette::Highlight, QColor(255, 0, 0)); |
| 64 | _sliderR->setPalette(paletteRed); |
| 65 | |
| 66 | QPalette paletteGreen; |
| 67 | paletteGreen.setColor(QPalette::Highlight, QColor(0, 255, 0)); |
| 68 | _sliderG->setPalette(paletteGreen); |
| 69 | |
| 70 | QPalette paletteBlue; |
| 71 | paletteBlue.setColor(QPalette::Highlight, QColor(0, 0, 255)); |
| 72 | _sliderB->setPalette(paletteBlue); |
| 73 | |
| 74 | _spinR = new QSpinBox; |
| 75 | _spinG = new QSpinBox; |
| 76 | _spinB = new QSpinBox; |
| 77 | |
| 78 | _spinR->setMinimum(0); |
| 79 | _spinR->setMaximum(255); |
| 80 | _spinG->setMinimum(0); |
| 81 | _spinG->setMaximum(255); |
| 82 | _spinB->setMinimum(0); |
| 83 | _spinB->setMaximum(255); |
| 84 | |
| 85 | _sliderR->setMinimum(0); |
| 86 | _sliderR->setMaximum(255); |
| 87 | _sliderG->setMinimum(0); |
| 88 | _sliderG->setMaximum(255); |
| 89 | _sliderB->setMinimum(0); |
| 90 | _sliderB->setMaximum(255); |
| 91 | |
| 92 | _btnColorPicker = new QPushButton(this); |
| 93 | _btnColorPicker->setCheckable(true); |
nothing calls this directly
no test coverage detected