<?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[Color dialog for QGuiApplication (Qt 5.1) [SOLVED]]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I'm coding a simple (in terms of UI) application for OpenGL rendering using QGuiApplication/QWindow. Human interaction is exclusively via keyboard and mouse (i.e. no UI elements). The problem is to open a color picker/dialog when a specific key is pressed (and of course receive a QColor). Previously, using QWidgets, I would simply use QColorDialog:</p>
<p dir="auto">QColor color = QColorDialog::getColor();</p>
<p dir="auto">If there's a similar one-line approach for QWindow apps, then stop reading and please let me know what this is.</p>
<p dir="auto">I'm aware of a similar QtQuick color dialog, but I'm unfamiliar with QtQuick and QML. Assuming that I use the QML code provided "here":<a href="http://qt-project.org/doc/qt-5.1/qtquickdialogs/qml-qtquick-dialogs1-colordialog.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-5.1/qtquickdialogs/qml-qtquick-dialogs1-colordialog.html</a> is there a simple way (i.e. few lines of code) to use this in my application? Google and the qt documentation doesn't give me a straight answer here I'm afraid.</p>
<p dir="auto">Furthermore, using the QML code for the simple color dialog, I get the following error: unknown component (M300)  at ColorDialog, line 4. I'm not sure what or where I need to include something to get rid of this.</p>
<p dir="auto">SOLVED: after some reading, it turns out QQuickView can be used to run the QML application within my c++ app. It's a bit more code than the previous QWidget solution, since the colour needs to be fetched from the quit signal in the colour dialog app, but not too complicated either.</p>
]]></description><link>https://forum.qt.io/topic/33678/color-dialog-for-qguiapplication-qt-5-1-solved</link><generator>RSS for Node</generator><lastBuildDate>Mon, 12 Oct 2026 08:57:46 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/33678.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 29 Oct 2013 16:54:22 GMT</pubDate><ttl>60</ttl></channel></rss>