Results 1 to 4 of 4

Thread: Making qstyleplugins work with QT application

  1. #1
    Join Date
    Dec 2016
    Posts
    15
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Making qstyleplugins work with QT application

    Hi,

    I want to use the 'Plastique' style in my QT5 application. I have downloaded the QStylePlugins zip and ran qmake on it.
    How do I load this into my application and do :
    app.setStyle(QStyleFactory::create("Plastique")); ?

    Thanks,
    Padma

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Making qstyleplugins work with QT application

    You can also

    * call the setStyle() overload that takes a string, i.e. the style's name.
    * build the style as part of the qapplication (if the license combinaton allows that) and directly instantiate the style class

    Cheers,
    _

  3. #3
    Join Date
    Dec 2016
    Posts
    15
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Making qstyleplugins work with QT application

    I included the qt_plugin_qplastiquestyle.pri in my app's .pro file.
    Now I called "plastique" in a.setStyle.
    I dont see the changes appearing in the application. Will I need to include the headers and .cpp as well in the .pro file for it to work?

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Making qstyleplugins work with QT application

    Depends on how you want to use it.

    If you load it by name (first option) you need to ensure that the plugin can be found, it you compile it as a class you can instantiate it (second option).

    Cheers,
    _

Similar Threads

  1. Using custom QStylePlugins with PyQt?
    By Johannes in forum Qt Programming
    Replies: 0
    Last Post: 3rd August 2011, 11:07
  2. Making QT Work with SQLite View
    By Baasie in forum Qt Programming
    Replies: 5
    Last Post: 13th September 2009, 14:22
  3. Making MySQL plugin work on a windows x86 enviroment
    By Baasie in forum Installation and Deployment
    Replies: 1
    Last Post: 2nd September 2009, 15:15
  4. Making some simple help for my application
    By Godlike in forum Newbie
    Replies: 9
    Last Post: 21st April 2006, 18:43
  5. QTextEdit Justify align making work
    By dec0ding in forum Qt Programming
    Replies: 2
    Last Post: 13th January 2006, 12:02

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.