Results 1 to 7 of 7

Thread: Customizig widgets ... ¿skins?

  1. #1
    Join Date
    Apr 2007
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Customizig widgets ... ¿skins?

    Hi:

    A very newbie question, I guess.

    I'm using QT 4.2 and Designer.

    I want to customize some of the common widgets so they look as I want to.

    For example:

    - Slider: I want to use my own slider graphics... I want the same behavior but I want to use my own custom graphics...

    - Button: In Visual Studio I can change the background image of a Button quite easily with the Image property...but keeping the text of the button... Here, in the Designer I see the Icon, but not the whole background Image property... where do I change this?

    How can I do these things in designer?


    Is there a "Skin" concept in QT as in PHP Nuke or things like that? So we just change some graphic files and the widgets automatically look as we want to?

    Thanks!!

    Regards,
    Hipo
    Last edited by hipogrito; 18th April 2007 at 21:50.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Customizig widgets ... ¿skins?

    Quote Originally Posted by hipogrito View Post
    Is there a "Skin" concept in QT as in PHP Nuke or things like that? So we just change some graphic files and the widgets automatically look as we want to?
    No, but there is a concept of "style", which controls all of the drawing process, and there are style sheets.

    See QStyle.

  3. #3
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Customizig widgets ... ¿skins?

    In Qt you have to use styles mostly to customize the appearance.
    Take a loom at the Styles example in the Qt Demos, the Widgets section and you'll get an idea.

    Of course, you could also implement a skin system, using images and stuff... But styles are better if you want to customize more controls.

    Regards

  4. #4
    Join Date
    Apr 2007
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Customizig widgets ... ¿skins?

    Hi:

    Thank you both for your quick replies

    I missed that part of the demos!

    A small piece missing in these demos is that they go directly into the code... and not from Designer... In Designer I see this Change styleSheet when I right click in a widget, but then there is just a blank text box... and I don't think the idea is to put C code there, so I guess I'm missing some other kind of demo or tutorial where it is explained what to put there... some kind of XML?, or CSS?, or ... ?

    Thanks!

    Regards
    Hipo

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Customizig widgets ... ¿skins?

    Quote Originally Posted by hipogrito View Post
    I'm missing some other kind of demo or tutorial
    Yes, it's called "documentation"

    http://doc.trolltech.com/4.2/stylesheet.html
    http://doc.trolltech.com/4.2/overviews.html

  6. The following user says thank you to jacek for this useful post:

    hipogrito (18th April 2007)

  7. #6
    Join Date
    Apr 2007
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Customizig widgets ... ¿skins?

    Hi:

    Thanks... yes... I didn't find this under the Qt Designer in the Qt Assistant... but I see it was in other place...

    Thanks

    Hipo

  8. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Customizig widgets ... ¿skins?

    Quote Originally Posted by hipogrito View Post
    I didn't find this under the Qt Designer in the Qt Assistant...
    Qt Designer is only a tool that helps you to layout the widgets, so you shouldn't expect much from it.

Similar Threads

  1. QLogText & QLogTable : 2 widgets to display text log
    By fcoiffie in forum Qt-based Software
    Replies: 7
    Last Post: 28th April 2019, 07:52
  2. Performance in hiding/showing widgets
    By Paalrammer in forum Newbie
    Replies: 12
    Last Post: 14th February 2007, 18:57
  3. Replies: 11
    Last Post: 7th July 2006, 13:09
  4. How to movable dock widgets?
    By becond in forum Qt Tools
    Replies: 3
    Last Post: 21st February 2006, 19:57
  5. Creating Widgets
    By hylke in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2006, 08:37

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.