Results 1 to 5 of 5

Thread: about QT style

  1. #1
    Join Date
    May 2006
    Posts
    32
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Default about QT style

    In QT4.1.2

    I designe dialog in QT designer,and preview in "plastique style".
    It looks beautiful with bright background just like Opera---an Internet Explorer.


    But when I Set the style in my source code it look gray,urgly.


    on Windows 2k pro.

    any one help?
    Thanks.
    Below is my code snippet:
    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3.  
    4. pque = new QPlastiqueStyle;
    5. /*
    6.   Should I call some member function of QPlastiqueStyle to
    7.   change it's default look?
    8.   pque->。。。
    9.  
    10.   */
    11.  
    12. QApplication::setStyle(pque);
    13. QApplication app(argc, argv);
    14. dlg imageDlg;
    15. imageDlg.show();
    16. //QCDEStyle::
    17. imageDlg.setImg();
    18. return app.exec();
    19. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by iGoo; 29th May 2006 at 10:47.

  2. #2
    Join Date
    Mar 2006
    Posts
    48
    Thanks
    5
    Thanked 4 Times in 3 Posts

    Default Re: about QT style

    try:
    QApplication app(argc, argv);
    app.setStyle(pque);

  3. #3
    Join Date
    May 2006
    Posts
    32
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Unhappy Re: about QT style

    Quote Originally Posted by evgenM
    try:
    QApplication app(argc, argv);
    app.setStyle(pque);

    Things goes the same.

  4. #4
    Join Date
    Jan 2006
    Posts
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: about QT style

    It is simply picking up the windows palette from your system.
    Here is how you use the palette provided by the style:
    Qt Code:
    1. QApplication::setPalette(QApplication::style()->standardPalette());
    To copy to clipboard, switch view to plain text mode 

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

    iGoo (31st May 2006)

  6. #5
    Join Date
    May 2006
    Posts
    32
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Default Re: about QT style

    Thanks all.

    It works in the way jens says,thanks.

Similar Threads

  1. What is your coding style ??
    By guestgulkan in forum General Discussion
    Replies: 9
    Last Post: 29th May 2006, 09:22
  2. Current KDE/Windows style
    By donmorr in forum Qt Tools
    Replies: 1
    Last Post: 19th May 2006, 17:49
  3. QToolBox and style
    By Maxilys in forum KDE Forum
    Replies: 6
    Last Post: 26th March 2006, 15:07
  4. Bugs, style changes in 4.1.0?
    By simk in forum Qt Programming
    Replies: 13
    Last Post: 13th February 2006, 11:05
  5. Qt style...
    By Sergey B. in forum Qt Programming
    Replies: 10
    Last Post: 21st January 2006, 22:48

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.