Results 1 to 2 of 2

Thread: QColorDialog, Custom Color, Stored where and how to delete?

  1. #1
    Join Date
    Jul 2015
    Posts
    87
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default QColorDialog, Custom Color, Stored where and how to delete?

    Hello,
    i'm using the QColorDialog. For testing purpose i drag&drop a color
    into the custom colors. Even if i close my app, after restart the custom
    color remains.

    1) Where does Qt store the custom colors?
    2) How to delete a custom color from QColorDialog? (pressing "Delete" doesn't work)

    Thx
    HappyCoder

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QColorDialog, Custom Color, Stored where and how to delete?

    By default, Qt uses the operating system's native color dialog. Any custom colors are stored by the OS wherever it stores them and are shared by all color dialogs.

    You probably have two choices to work around this:

    1 - Set the DontUseNativeDialog option to use Qt's internal color dialog
    2 - Use a loop over QColorDialog::customCount() and QColorDialog::setCustomColor() to set them all to white before calling exec().

Similar Threads

  1. Change background color of a custom widget
    By rubikon in forum Newbie
    Replies: 10
    Last Post: 5th July 2012, 13:21
  2. How to custom Buttons in QColorDialog
    By picobsd in forum Qt Programming
    Replies: 3
    Last Post: 31st August 2011, 10:37
  3. Automatic comparisons for custom types stored in QVariant
    By viulskiez in forum Qt Programming
    Replies: 1
    Last Post: 18th July 2011, 14:07
  4. Replies: 2
    Last Post: 6th May 2010, 14:09
  5. delete custom event
    By Dmitry in forum Qt Programming
    Replies: 1
    Last Post: 15th October 2006, 16:55

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.