Results 1 to 12 of 12

Thread: stylesheet

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2007
    Location
    Ukraine, Odessa
    Posts
    140
    Thanks
    15
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: stylesheet

    Quote Originally Posted by phillip_Qt View Post
    I'm applying the qss as above u've asked. my problem is that i need to apply frameshadow:Sunken to QLable .
    Why don't you just use QFrame::setFrameShadow (QFrame::Sunken) on your QLabel ?
    C++ & AMD forever

  2. #2
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: stylesheet

    Quote Originally Posted by THRESHE View Post
    Why don't you just use QFrame::setFrameShadow (QFrame::Sunken) on your QLabel ?

    Hi. I applied in side qss file as

    QLabel
    {
    QFrame::setFrameShadow (QFrame::Sunken)
    }
    still same problem.
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  3. #3
    Join Date
    Jan 2006
    Posts
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: stylesheet

    Looks like you're out of luck in the sense that, by default, according to the docs:

    Since 4.3, setting a stylesheet on a QLabel automatically sets the QFrame::frameStyle property to QFrame::StyledPanel.
    Have you tried using a border? Something like:

    Qt Code:
    1. {
    2. border: 1px inset gray;
    3. }
    To copy to clipboard, switch view to plain text mode 

    Or something similar?
    Last edited by Shadowfiend; 25th April 2008 at 16:40. Reason: [code] does not, in fact, end with [/quote]

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: stylesheet

    aahhhh,,, u posted before me :P

    I played with the stylesheet example in the QtDemo and made the following changes in code -
    Qt Code:
    1. nameLabel->setFrameStyle(QFrame::StyledPanel);
    To copy to clipboard, switch view to plain text mode 

    and on running the application, i tried edit, and in the edit made the following change -
    Qt Code:
    1. /* Mark mandatory fields with a brownish color. */
    2. .mandatory {
    3. color: brown;
    4. border-width:2;
    5. border-style: inset;
    6.  
    7. }
    To copy to clipboard, switch view to plain text mode 


    finally something
    by the way, Philip, ur questions will make everyone expert in using stylesheets

  5. #5
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: stylesheet

    Quote Originally Posted by aamer4yu View Post
    aahhhh,,, u posted before me :P

    I played with the stylesheet example in the QtDemo and made the following changes in code -
    Qt Code:
    1. nameLabel->setFrameStyle(QFrame::StyledPanel);
    To copy to clipboard, switch view to plain text mode 

    and on running the application, i tried edit, and in the edit made the following change -
    Qt Code:
    1. /* Mark mandatory fields with a brownish color. */
    2. .mandatory {
    3. color: brown;
    4. border-width:2;
    5. border-style: inset;
    6.  
    7. }
    To copy to clipboard, switch view to plain text mode 


    finally something
    by the way, Philip, ur questions will make everyone expert in using stylesheets
    Thank u aamer.
    I'm a new bee in Qt. So really im intrested to learn from u peopls.
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  6. #6
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: stylesheet

    I am neither an expert, I too learn from such postings.
    believe me, i didnt knew the answer i had to search, glad i learned something new too.

  7. #7
    Join Date
    Mar 2007
    Location
    Ukraine, Odessa
    Posts
    140
    Thanks
    15
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: stylesheet

    Quote Originally Posted by phillip_Qt View Post
    Hi. I applied in side qss file as

    QLabel
    {
    QFrame::setFrameShadow (QFrame::Sunken)
    }
    still same problem.
    It may sound rude but are you familiar with Qt style sheets and Qt itself ?
    What I wrote means that you should literally write in your program code. For instance
    Qt Code:
    1. QLabel myLabel;
    2. myLabel.setFrameShadow (QFrame::Sunken);
    To copy to clipboard, switch view to plain text mode 
    I hope it helps
    C++ & AMD forever

Similar Threads

  1. Styling QComoBox using CSS Stylesheet
    By bjoernbg in forum Qt Programming
    Replies: 1
    Last Post: 6th October 2010, 23:12
  2. StyleSheet components using Qt designer
    By Kostanev in forum Qt Tools
    Replies: 1
    Last Post: 21st April 2008, 08:28
  3. how to apply stylesheet to qtopia application using qss file
    By namita in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 31st March 2008, 07:04
  4. Replies: 8
    Last Post: 17th March 2008, 14:04

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.