|
|
|
@ -4,7 +4,6 @@
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
#include <QEvent>
|
|
|
|
|
#include <QKeyEvent>
|
|
|
|
|
#include <QMouseEvent>
|
|
|
|
|
#include <QLayout>
|
|
|
|
|
#include <QStyleOption>
|
|
|
|
|
|
|
|
|
@ -19,7 +18,6 @@ CSVWidget::ColorPickerPopup::ColorPickerPopup(QWidget *parent)
|
|
|
|
|
mColorPicker->setWindowFlags(Qt::Widget);
|
|
|
|
|
mColorPicker->setOptions(QColorDialog::NoButtons | QColorDialog::DontUseNativeDialog);
|
|
|
|
|
mColorPicker->installEventFilter(this);
|
|
|
|
|
mColorPicker->open();
|
|
|
|
|
connect(mColorPicker,
|
|
|
|
|
SIGNAL(currentColorChanged(const QColor &)),
|
|
|
|
|
this,
|
|
|
|
@ -39,8 +37,9 @@ void CSVWidget::ColorPickerPopup::showPicker(const QPoint &position, const QColo
|
|
|
|
|
geometry.moveTo(position);
|
|
|
|
|
setGeometry(geometry);
|
|
|
|
|
|
|
|
|
|
mColorPicker->setCurrentColor(initialColor);
|
|
|
|
|
show();
|
|
|
|
|
// Calling getColor() creates a blocking dialog that will continue execution once the user chooses OK or Cancel
|
|
|
|
|
QColor color = mColorPicker->getColor(initialColor);
|
|
|
|
|
mColorPicker->setCurrentColor(color);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVWidget::ColorPickerPopup::mousePressEvent(QMouseEvent *event)
|
|
|
|
@ -63,12 +62,6 @@ void CSVWidget::ColorPickerPopup::mousePressEvent(QMouseEvent *event)
|
|
|
|
|
QFrame::mousePressEvent(event);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVWidget::ColorPickerPopup::hideEvent(QHideEvent *event)
|
|
|
|
|
{
|
|
|
|
|
QFrame::hideEvent(event);
|
|
|
|
|
emit hid();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CSVWidget::ColorPickerPopup::eventFilter(QObject *object, QEvent *event)
|
|
|
|
|
{
|
|
|
|
|
if (object == mColorPicker && event->type() == QEvent::KeyPress)
|
|
|
|
|