Results 1 to 11 of 11

Thread: Saving color setting

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Saving color setting

    Quote Originally Posted by waynew View Post
    The problem is (just for Wysota ) qDebug() save color is empty.
    If I use .value<QColor>() instead of .toString(), the qDebug() says the color is invalid.

    I just want to save the user chosen color to my database and restore it on start up.
    Any ideas?
    Well, you probably have some errors in your code. See following example, try it and if it works, you messed up your code with QString/QColor etc.
    Qt Code:
    1. QColor c = QColor(145,23,0);
    2. qWarning() << c;
    3. s.setValue("test", c);
    4. QColor cc = s.value("test").value<QColor>();
    5. qWarning() << cc;
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to Lykurg for this useful post:

    waynew (25th January 2010)

Similar Threads

  1. SETTING THE TEXT COLOR FOR QMessageBox
    By vinkakarun in forum Newbie
    Replies: 2
    Last Post: 5th November 2009, 16:32
  2. setting background color and repositioning
    By mind_freak in forum Qt Programming
    Replies: 2
    Last Post: 11th August 2009, 06:22
  3. setting background color of QMessageBox
    By wagmare in forum Qt Programming
    Replies: 7
    Last Post: 23rd May 2009, 13:26
  4. QTreeWidgetItem setting color for the text
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 29th August 2007, 17:22
  5. setting text also changes color?
    By drhex in forum Qt Programming
    Replies: 5
    Last Post: 22nd November 2006, 16:36

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
  •  
Qt is a trademark of The Qt Company.