<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Native QColorDialog, Issue]]></title><description><![CDATA[<p dir="auto">Hello everyone!<br />
system: Ubuntu 22.04<br />
qt version: 6.2.4<br />
my app: <a href="https://github.com/try-hard-factory/familiar" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/try-hard-factory/familiar</a><br />
color picker library: <a href="https://github.com/ksnip/kColorPicker" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/ksnip/kColorPicker</a><br />
(this library for qt5, but I updated it for qt 6)</p>
<p dir="auto">When I try to call the dialog, the dialog box is created but not displayed. The interface is also blocked (you cannot close the window for example):  (select color window)<br />
<img src="https://ddgobkiprc33d.cloudfront.net/e7c12743-6824-4d43-9009-d66cf45ee3e5.png" alt="Screenshot from 2023-06-17 16-32-15.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">in the sample library everything works as it should:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/35e18d43-f2b6-4488-b121-c0158ed2e204.png" alt="Screenshot from 2023-06-17 16-32-44.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I changed the library code and added a flag QColorDialog::DontUseNativeDialog</p>
<pre><code>void ColorDialogButton::buttonClicked()
{
    auto color = QColorDialog::getColor(Qt::white, this, QString(), QColorDialog::DontUseNativeDialog | getColorDialogOptions());
    emit colorSelected(color);
}
</code></pre>
<p dir="auto">and it helped:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/c5516758-04f7-4a07-8e46-d8509047e2e6.png" alt="Screenshot from 2023-06-17 16-37-06.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I want to understand why this is happening. Perhaps I'm adding the color widget incorrectly?<br />
Some code for understanding what's going on:</p>
<p dir="auto">color picker example:</p>
<pre><code>int main(int argc, char **argv)
{
    QApplication app(argc, argv);
    auto widget = new QWidget();
    widget-&gt;setFixedWidth(200);
    widget-&gt;setFixedHeight(200);
    auto layout = new QVBoxLayout();
    auto colorPicker = new KColorPicker(true);
    colorPicker-&gt;setColor(QColor(Qt::red));
    layout-&gt;addWidget(colorPicker);
    widget-&gt;setLayout(layout);
    widget-&gt;show();

    return app.exec();
}
</code></pre>
<p dir="auto">my code:</p>
<pre><code>SettingsWindow::SettingsWindow(MainWindow* wm, QWidget* parent)
...
    , colorsTab_(new QWidget)
    , colors_(new ColorsWidget(colorsTab_))
...
{
   ...

    // colors
    auto* colorsLayout = new QVBoxLayout(colorsTab_);
    colorsTab_-&gt;setLayout(colorsLayout);
    colorsLayout-&gt;addWidget(colors_);
    tabWidget_-&gt;addTab(colorsTab_, tr("Colors"));

 ...
}
</code></pre>
<pre><code>ColorsWidget::ColorsWidget(QWidget* parent)
    : QWidget(parent)
    , layout_(new QVBoxLayout(this))
{
    layout_-&gt;setAlignment(Qt::AlignTop);
    auto colorPicker = new KColorPicker(true);
    colorPicker-&gt;setColor(QColor(Qt::red));
    layout_-&gt;addWidget(colorPicker);
    setLayout(layout_);
}
</code></pre>
<p dir="auto">regards, max</p>
]]></description><link>https://forum.qt.io/topic/145842/native-qcolordialog-issue</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Nov 2026 19:15:49 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/145842.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 17 Jun 2023 13:42:20 GMT</pubDate><ttl>60</ttl></channel></rss>