Results 1 to 7 of 7

Thread: plastique style not the same like in the designer

  1. #1
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default plastique style not the same like in the designer

    Hello everybody,

    QT: 4.1.3
    Compiler: MINGW
    OS: Windows XP

    With following code i was able to change my app Style to plastique. But the colors are not the same like the plastique prewiew in the designer..
    My Fom is graw and in the preview from designer i get a beautiful bright blue

    Its possible to compile my app and get this beautiful colors like in the preview??
    Qt Code:
    1. #include <QApplication>
    2. #include "mainwindow.h"
    3.  
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7.  
    8.  
    9. QApplication app(argc, argv);
    10. app.setStyle("plastique");
    11. MainWindow m;
    12.  
    13. m.show();
    14. return app.exec();
    15. }
    To copy to clipboard, switch view to plain text mode 
    Think DigitalGasoline

  2. #2
    Join Date
    Jul 2006
    Location
    Slovakia
    Posts
    17
    Thanks
    12
    Thanked 6 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: plastique style not the same like in the designer

    Hi,

    my configuration:

    Qt 4.2.0-tp1
    mingw
    win2000

    I don't know how to help you but my plastique preview in designer and compiled app looks the same (see attached screenshot).
    Attached Images Attached Images

  3. #3
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: plastique style not the same like in the designer

    Hi,
    I can see diferences. Have a look in my pics:
    Attached Files Attached Files
    Think DigitalGasoline

  4. #4
    Join Date
    Jul 2006
    Location
    Slovakia
    Posts
    17
    Thanks
    12
    Thanked 6 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: plastique style not the same like in the designer

    You can achieve the color of form like this (in constructor):

    Qt Code:
    1. myApp::myApp() {
    2. ...
    3. // if .ui form like in my case
    4. // setupUi(this);
    5.  
    6. QPalette myPalette;
    7. myPalette = this->palette();
    8. myPalette.setColor(QPalette::Background,QColor(239, 239, 239));
    9. this->setPalette(myPalette);
    10. }
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

  5. #5
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: plastique style not the same like in the designer

    hi,
    i know how to change the colors
    ..But i just wanna know why the diference between preview and .exe file
    Think DigitalGasoline

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

    Aruz (24th December 2012)

  7. #6
    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: plastique style not the same like in the designer

    Try:
    Qt Code:
    1. app.setStyle( "plastique" );
    2. app.setPalette( app.style()->standardPalette() );
    To copy to clipboard, switch view to plain text mode 

  8. The following 4 users say thank you to jacek for this useful post:

    Aruz (24th December 2012), eggoor (30th March 2012), jmsbc (2nd November 2009), raphaelf (23rd August 2006)

  9. #7
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: plastique style not the same like in the designer

    Hi Jacek,
    It works perfect!!
    Think DigitalGasoline

Similar Threads

  1. Custom Style
    By Dusdan in forum Qt Tools
    Replies: 8
    Last Post: 1st September 2006, 22:50
  2. Designer crashes when selecting some widgets
    By gwendal in forum Qt Tools
    Replies: 4
    Last Post: 21st July 2006, 13:18
  3. Adding slots in Designer
    By jamos in forum Qt Tools
    Replies: 5
    Last Post: 18th May 2006, 23:28
  4. Replies: 2
    Last Post: 14th February 2006, 15:28
  5. How to create custom slot in Qt Designer 4.1?
    By jamadagni in forum Qt Tools
    Replies: 31
    Last Post: 18th January 2006, 20:46

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.