Results 1 to 2 of 2

Thread: CSS Problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Posts
    62
    Thanks
    28
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy CSS Problem

    I'm using Qt 4.2.3 with MS Visual Studio 2005.

    I have a nice style sheet I apply to my pushbuttons. Alas, while the sheet works just fine when I run my app within VS2005 IDE, it does not work at all in the stand-alone app.

    In my QMainWindow's creator function I have the following:
    Qt Code:
    1. setStyleSheet(
    2. "QMainWindow {"
    3. "background-color: #0C344B;"
    4. "}"
    5. "QFrame#navToolBox {"
    6. "color: black;"
    7. "font-size: 14pt;"
    8. "font-style: bold;"
    9. "background-color: #CCD4FF;"
    10. "selection-color: white;"
    11. "selection-background-color: #0C344B;"
    12. "}"
    13. "QSplitter {"
    14. "background-color: #CCD4FF;"
    15. "background-image: url(:/Mockup01/Resources/splitterControl.png);"
    16. "background-repeat: no-repeat;"
    17. "background-position: center;"
    18. "}"
    19. "QPushButton {"
    20. "color: white;"
    21. "background-color: #0C344B;"
    22. "background-image: url(:/Mockup01/Resources/buttonGradient.png);"
    23. "background-repeat: repeat-x;"
    24. "border-style: outset;"
    25. "border-width: 1px;"
    26. "border-radius: 5px;"
    27. "border-color: white;"
    28. "padding-top: 6px;"
    29. "padding-bottom: 6px;"
    30. "padding-right: 30px;"
    31. "padding-left: 30px;"
    32. "font-size: 11pt;"
    33. "}"
    34. "QPushButton:checked {"
    35. "border-width: 2px;"
    36. "border-color: cyan;"
    37. "}"
    38. "QFrame#buttonFrame {"
    39. "background-color: #0C344B;"
    40. "}"
    41. "QSlider {"
    42. "color: white;"
    43. "}"
    44. );
    To copy to clipboard, switch view to plain text mode 
    In the IDE, the buttons have a nice white border with rounded corners, and a gradient filled background. In the stand-alone they look pretty much like standard Windows buttons. I cannot figure out why they work in the IDE but not stand alone.

    I'm pretty sure I must be making a fairly fundamental newbie mistake, but I cannot seem to find it. Any ideas?

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

    Default Re: CSS Problem

    Maybe the resource file is not created correctly? Try compiling with console support turned on and see if you get any warnings in the console.

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.