Results 1 to 10 of 10

Thread: QColorDialog Apperance?

  1. #1
    Join Date
    Feb 2006
    Location
    Portugal
    Posts
    24
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QColorDialog Apperance?

    Hi,

    I would like to change the text labels and pushup buttons text labels of the QcolorDialog.

    I wasn't able to find how to do that after reading the documentation. Is it possible to do that changes ? or that labels are nor supose to change ?

    my best regards,

    António tomé

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QColorDialog Apperance?

    You can't modify the appearance of such a widget. the only way to get a different color dialog that fit your needs is to craft your own from more basic components (widgets) and maybe looking at the source to see how the color stuff are handled

    Good luck.

    BTW I'm looking for a color combobox widget to use in a Qt app, anyone has clue?
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QColorDialog Apperance?

    It is possible to change them, at least it should be. One way is to use i18n mechanisms integrated with Qt (QTranslator and stuff), another is to look at the dialog's sources to find names of those widgets you need and then ask the dialog to return a pointer to a named child using QObject::findChildren() and when you have them, you can alter them the way you want.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QColorDialog Apperance?

    Quote Originally Posted by wysota
    another is to look at the dialog's sources to find names of those widgets you need and then ask the dialog to return a pointer to a named child using QObject::findChildren() and when you have them, you can alter them the way you want.
    QColorDialog has only static methods (and a private constructor) so I'm afraid this is not possible.
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    antonio.r.tome (5th April 2006)

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QColorDialog Apperance?

    True. So only the translator solution is possible.

  7. The following user says thank you to wysota for this useful post:

    antonio.r.tome (5th April 2006)

  8. #6
    Join Date
    Apr 2006
    Location
    Minsk, Belarus
    Posts
    23
    Thanks
    3
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QColorDialog Apperance?

    The feature your want to achieve may be somehow achieved using the native platform code. Or at least it is possible to get inside the dialog and change something using the WinAPI code on Windows. If this suits your needs, you can poke around the CodeProject - there definetely was a nice example.

    But anyway, I would rather use the Qt sources and implement my own color dialog basing on them.

  9. #7
    Join Date
    Feb 2006
    Location
    Portugal
    Posts
    24
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QColorDialog Apperance?

    Quote Originally Posted by Lemming
    But anyway, I would rather use the Qt sources and implement my own color dialog basing on them.
    Yes I've done it.
    I copied to my work directory the files
    qcolordialog.cpp
    qcolordialog.h
    qdialog_p.h
    created a subdirectory named private and copy there the files
    qobject_p.h qwidget_p.h

    after that I only need to change the qcolordialog.cpp source and everthing seems to be working fine.

    I would have thought that it should be possible to change those thinks. The Qt developers didn't seem to agree with me, and complaining about a free thing is nonsense.

    Many thanks,

  10. #8
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QColorDialog Apperance?

    Quote Originally Posted by antonio.r.tome
    I would have thought that it should be possible to change those thinks. The Qt developers didn't seem to agree with me, and complaining about a free thing is nonsense.

    Many thanks,
    Why did you need to change it anyway?
    Save yourself some pain. Learn C++ before learning Qt.

  11. #9
    Join Date
    Feb 2006
    Location
    Portugal
    Posts
    24
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QColorDialog Apperance?

    Quote Originally Posted by Chicken Blood Machine
    Why did you need to change it anyway?
    I don't need it! I want it. I intend to use the custom color mecanism, and the facilities associated with it. Then I use the color dialog as a tool to choose a discret color patern table (user made) through the custom color mechanism.
    So instead of "add to custom color" I want "accept as labels colors" and instead of "custom colors" I want "labels colors" and for the windows title I obviously want "labels colors". As you see nothing important. No extra functionality, only more user friendness.

    best regards,

    António Tomé

  12. #10
    Join Date
    Jan 2006
    Posts
    109
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QColorDialog Apperance?

    You could still have used the i18n mechanism to avoid re-coding QColorDialog.

    Oh, and about the "complaining about a free thing is nonsense" part, you can report bugs here:
    http://www.trolltech.com/forms/feedbackform.html
    It's just that this is not a bug, and Trolltech will probably not implement a new feature if you're the only one asking for it.
    Last edited by dimitri; 16th April 2006 at 07:46.

Similar Threads

  1. QColorDialog style sheet modification
    By Angelo Moriconi in forum Qt Programming
    Replies: 0
    Last Post: 2nd April 2008, 14:20

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.