Unsolved Color picker?
-
I'm looking for a color picker widget or dialog in QT quick. Does that exist already?
If not, any suggestions on how to create one? I'm thinking a square or round mouse area with a color tile. When the user clicks anywhere, it detects the location and passes the corresponding color to the underlying object code. The hard part will be getting the color that is passed to match up well with the location of the click.
-
@kgregory said in Color picker?:
I'm looking for a color picker widget or dialog in QT quick. Does that exist already?
Yes.
- Widgets: http://doc.qt.io/qt-5/qcolordialog.html
- Qt Quick: http://doc.qt.io/qt-5/qml-qtquick-dialogs-colordialog.html
Tip: I found these by Googling "color picker" in the Qt documentation
-
I'm sorry, I guess a dialog is actually not what I really want. I'm looking for a control that stays active on the screen so the user can change colors at any time.
-
@kgregory said in Color picker?:
I guess a dialog is actually not what I really want. I'm looking for a control that stays active on the screen so the user can change colors at any time.
If using Qt Widgets, you could try using the
QColorDialog::NoButtons
option, to make aQColorDialog
that never closes.For Qt Quick, you could copy and modify the code from DefaultColorDialog.qml: http://code.qt.io/cgit/qt/qtquickcontrols.git/tree/src/dialogs/DefaultColorDialog.qml
-
I may have to do that. I hate this color dialog in quick. It gets the job done though, so I guess I'll keep it while I develop the rest of the app.