From 729fe1e1a97034ce9488228d7f306594294cfad5 Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Wed, 21 Sep 2022 11:04:37 +0100 Subject: [PATCH] #1452 - Workaround Linux bug in color picker in map settings --- plugins/feature/map/mapcolordialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/feature/map/mapcolordialog.cpp b/plugins/feature/map/mapcolordialog.cpp index 5dd1bb36d..f8ee49131 100644 --- a/plugins/feature/map/mapcolordialog.cpp +++ b/plugins/feature/map/mapcolordialog.cpp @@ -25,9 +25,10 @@ MapColorDialog::MapColorDialog(const QColor &initial, QWidget *parent) : QDialog(parent) { - m_colorDialog = new QColorDialog(initial); + m_colorDialog = new QColorDialog(); m_colorDialog->setWindowFlags(Qt::Widget); m_colorDialog->setOptions(QColorDialog::ShowAlphaChannel | QColorDialog::NoButtons | QColorDialog::DontUseNativeDialog); + m_colorDialog->setCurrentColor(initial); // Needs to be set after setOptions on Linux, which seems to overwrite QColorDialog(initial) QVBoxLayout *v = new QVBoxLayout(this); v->addWidget(m_colorDialog); QHBoxLayout *h = new QHBoxLayout();