C++ Qt,颜色选择器对话框?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1972239/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 21:43:58  来源:igfitidea点击:

Qt, Color Picker Dialog?

c++qt

提问by user230821

Is there a color picker dialog for Qt like the following?

Qt 是否有一个颜色选择器对话框,如下所示?

Also it needs to have a OnColorChanged signal which is called when ever the selected color changes. I want to give a live preview when they are changing the colors, that is why.

Also it needs to have a OnColorChanged signal which is called when ever the selected color changes. 我想在他们更改颜色时进行实时预览,这就是原因。

http://i49.tinypic.com/vpu7hv.jpg

http://i49.tinypic.com/vpu7hv.jpg

Using google I could only find this one that was a triangle in side of a circle and personally I think it looks ugly.

使用谷歌我只能找到这个是一个圆圈边上的三角形,我个人认为它看起来很丑。

回答by Stefan Monov

QColorDialogdoes exactly what you want.

QColorDialog正是您想要的。

(It is easy to find when you Ctrl-F through the list of Qt classesfor "color")

(当您通过“颜色”的 Qt 类列表按 Ctrl-F 时很容易找到)

回答by Jan Laloux

Qt has now a "normal" color picker: http://doc.qt.io/qt-5/qcolordialog.html#details

Qt 现在有一个“普通”颜色选择器:http: //doc.qt.io/qt-5/qcolordialog.html#details