Results 1 to 11 of 11

Thread: website of suggested styles for widgets

  1. #1

    Default website of suggested styles for widgets

    Hi there guys,

    do you know if exist a website or any type of resource of nice text to input in the setStyleSheet method?

    IIt would be nice something like: preview-image-of-the-widget ---------> code


    I hope it exists!

    Cheers!

  2. #2
    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: website of suggested styles for widgets

    Could you elaborate what you mean? What is "preview-image-of-the-widget"?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3

    Default Re: website of suggested styles for widgets

    Quote Originally Posted by wysota View Post
    Could you elaborate what you mean? What is "preview-image-of-the-widget"?
    Sure!

    I mean something like: (A) --> (B)

    where (A) is the image of the widget:
    ________________
    |_my___button____|


    and (B) is the code necessary to obtain that result:

    for instance:

    Qt Code:
    1. mywidget->setStyleSheet("color: blue;"
    2. "background-color: yellow;"
    3. "selection-color: yellow;"
    4. "selection-background-color: blue;");
    To copy to clipboard, switch view to plain text mode 


    If no site of this type exists, it would be nice to know at least the exact styles of the Qt widgets. I haven't found this information in the wiki

  4. #4
    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: website of suggested styles for widgets

    Quote Originally Posted by valerianst View Post
    Sure!

    I mean something like: (A) --> (B)

    where (A) is the image of the widget:
    ________________
    |_my___button____|


    and (B) is the code necessary to obtain that result:

    for instance:

    Qt Code:
    1. mywidget->setStyleSheet("color: blue;"
    2. "background-color: yellow;"
    3. "selection-color: yellow;"
    4. "selection-background-color: blue;");
    To copy to clipboard, switch view to plain text mode 
    There are a lot of CSS examples in the Web.



    If no site of this type exists, it would be nice to know at least the exact styles of the Qt widgets. I haven't found this information in the wiki
    Style Sheets Reference
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5

    Default Re: website of suggested styles for widgets

    Quote Originally Posted by wysota View Post
    There are a lot of CSS examples in the Web.




    Style Sheets Reference
    Hi, thank you for the links.

    Unfortunately, it's not what I was looking for.. that link doesn't show the exact styles of the Qt widgets but only some example..

    About the CSS, yep.. you're right.. but as you said they are.. CSS. Thank you anyway

  6. #6
    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: website of suggested styles for widgets

    Qt doesn't use stylesheets to draw its controls, so you won't see such definition.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7

    Default Re: website of suggested styles for widgets

    Quote Originally Posted by wysota View Post
    Qt doesn't use stylesheets to draw its controls, so you won't see such definition.
    Ok, can I ask you what does it use? is there any change to get the information from which I can create a correspondent stylesheet?

  8. #8
    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: website of suggested styles for widgets

    Quote Originally Posted by valerianst View Post
    Ok, can I ask you what does it use?
    It uses QStyle API that may perform direct painting calls or delegate drawing to the system.

    is there any change to get the information from which I can create a correspondent stylesheet?
    I don't understand your question. If you are asking whether you can precisely mimic the default look using stylesheets then no, you can't.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9

    Default Re: website of suggested styles for widgets

    Quote Originally Posted by wysota View Post
    It uses QStyle API that may perform direct painting calls or delegate drawing to the system.


    I don't understand your question. If you are asking whether you can precisely mimic the default look using stylesheets then no, you can't.
    Yes I was asking that.. it's very strange that I can't do it.. it should be possible using the right definition. Why can't I?

  10. #10
    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: website of suggested styles for widgets

    Quote Originally Posted by valerianst View Post
    Why can't I?
    Because expressiveness of stylesheets is not big enough to handle everything Qt draws. And in addition to that system drawn styles can have themes which simply can't be mimicked by a static style sheet.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11

    Default Re: website of suggested styles for widgets

    Ok I understand. Thank you very much for all your explanations!

Similar Threads

  1. Suggested Error Handling
    By Max Yaffe in forum Qt Programming
    Replies: 6
    Last Post: 15th July 2014, 17:29
  2. Suggested patch to QMap
    By ComServant in forum Qt Programming
    Replies: 1
    Last Post: 23rd April 2012, 23:25
  3. Replies: 2
    Last Post: 3rd January 2012, 15:00
  4. Replies: 5
    Last Post: 31st March 2009, 14:55
  5. GUI Styles
    By dsmcc in forum Qt Programming
    Replies: 1
    Last Post: 19th November 2008, 15:58

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.