如何在 Qt C 中使用 QColordialog 保存颜色
有人可以帮助解决这个问题,我在 QT c++ 广告中使用 QColorDialog 无法弄清楚如何保存所选颜色,因此在应用程序关闭然后重新启动后它会是相同的颜色。如果有帮助的话,我已经在此处包含了我的插槽,只要您将其关闭并重新启动,该应用程序就可以正常工作。
无效MainWindow::on_actionBackGround_Color_triggered()
{ QColor 颜色=QColorDialog::getColor(颜色);
if (color.isValid()) {
setPalette(QPalette(color));
{
{
感谢您的帮助,已经有一段时间了。
Can someone help with this problem,I am using the QColorDialog in QT c++ ad can't figure out how to save the selected color so it would be the same color after an app is shutdown and then restarted. I have included my slot here if it would help, the app work fine as long as you shut it off and restart it.
void MainWindow::on_actionBackGround_Color_triggered()
{
QColor color=QColorDialog::getColor(color);
if (color.isValid()) {
setPalette(QPalette(color));
{
{
Thanks for and help,it's been awhile.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论