Style Plugin Example does not show red Button



  • Hi,

    I have run Style Plugin Example in Qt5.6
    But I don't see the red button. Is it a bug?
    I am using Windows 7.


  • Qt Champions 2016

    hi
    Most likely the plugin dll was not copied to the right folder.
    This seems to be QTDIR/plugins/styles but not sure as I never made a Style plugin.
    Its not a bug with the sample as such.

    http://doc.qt.io/qt-5/plugins-howto.html



  • @mrjj
    Thanks,
    I found that the plugins at
    C:...\styleplugin\release\styles\libsimplestyleplugin.a
    C:...\styleplugin\release\styles\simplestyleplugin.dll
    Isn't it the right location?
    The excutable was created in
    C:...\styleplugin\release\styleplugin.exe
    But still I don't see the red button.
    I also put libsimplestyleplugin.a and simplestyleplugin.dll to
    QTDIR/plugins/styles
    but I could not see the red button.


  • Qt Champions 2016

    @samdol said in Style Plugin Example does not show red Button:

    simplestyleplugin.dll

    Hi , i think it needs to be placed in predefined folder unless the sample
    uses other means to load it.



  • @mrjj
    Does predefined folder mean QTDIR/plugins/styles?
    I also put libsimplestyleplugin.a and simplestyleplugin.dll to there, but it did not make any change.
    I used Qt windows binary version.
    Do I have to compile Qt itself to use plugin?


  • Qt Champions 2016

    @samdol said in Style Plugin Example does not show red Button:

    QTDIR/plugins/styles

    Yes I think so. I have not tried a Style plugin but it was the same with designer plugin.
    Should be placed in right folder.
    It should be clear from reading the docs.

    Update:
    The sample says
    "We set the library to be stored in the styles folder under stylewindow because this is a path in which Qt will search for style plugins."
    So maybe it looks there.


  • Lifetime Qt Champion

    Hi,

    You should also add QT_DEBUG_PLUGINS=1 to the environment variables in the Run part of the project panel. That should give you more clues about why it doesn't load.



  • @SGaist
    Thanks, I put qputenv("QT_DEBUG_PLUGINS", QByteArray("1")); before
    QApplication app(argv, args); in main(). And I got the following output,
    It seems it loaded the simplestyleplugin.dll. I don't understand why it checks
    C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/accessible which I don't have. And it
    says libsimplestyleplugin.a is not a plugin. I heard that .a is a static
    library. This example is for dynamic plugin. I have no idea why I created a
    static library.

    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qminimal.dll"
    Found metadata in lib C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qminimal.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "className": "QMinimalIntegrationPlugin",
        "debug": false,
        "version": 329218
    }
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qminimald.dll"
    Found metadata in lib C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qminimald.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "className": "QMinimalIntegrationPlugin",
        "debug": true,
        "version": 329218
    }
    
    
    "The plugin 'C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qminimald.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qoffscreen.dll"
    Found metadata in lib C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qoffscreen.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "className": "QOffscreenIntegrationPlugin",
        "debug": false,
        "version": 329218
    }
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qoffscreend.dll"
    Found metadata in lib C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qoffscreend.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "className": "QOffscreenIntegrationPlugin",
        "debug": true,
        "version": 329218
    }
    
    
    "The plugin 'C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qoffscreend.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qwindows.dll"
    Found metadata in lib C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qwindows.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "windows"
            ]
        },
        "className": "QWindowsIntegrationPlugin",
        "debug": false,
        "version": 329218
    }
    Got keys from plugin meta data ("windows")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qwindowsd.dll"
    Found metadata in lib C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qwindowsd.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "windows"
            ]
        },
        "className": "QWindowsIntegrationPlugin",
        "debug": true,
        "version": 329218
    }
    
    
    "The plugin 'C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qwindowsd.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
             not a plugin
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/build-styleplugin-Desktop_Qt_5_6_2_MinGW_32bit-Release/release/platforms" ...
    loaded library "C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platforms/qwindows.dll"
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/platformthemes" ...
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/build-styleplugin-Desktop_Qt_5_6_2_MinGW_32bit-Release/release/platformthemes" ...
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/styles" ...
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/build-styleplugin-Desktop_Qt_5_6_2_MinGW_32bit-Release/release/styles" ...
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/build-styleplugin-Desktop_Qt_5_6_2_MinGW_32bit-Release/release/styles/libsimplestyleplugin.a"
    "Failed to extract plugin meta data from 'C:/Qt/build-styleplugin-Desktop_Qt_5_6_2_MinGW_32bit-Release/release/styles/libsimplestyleplugin.a'"
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/build-styleplugin-Desktop_Qt_5_6_2_MinGW_32bit-Release/release/styles/simplestyleplugin.dll"
    Found metadata in lib C:/Qt/build-styleplugin-Desktop_Qt_5_6_2_MinGW_32bit-Release/release/styles/simplestyleplugin.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QStyleFactoryInterface",
        "MetaData": {
            "Keys": [
                "simplestyle"
            ]
        },
        "className": "SimpleStylePlugin",
        "debug": false,
        "version": 329218
    }
    Got keys from plugin meta data ("simplestyle")
    loaded library "C:/Qt/build-styleplugin-Desktop_Qt_5_6_2_MinGW_32bit-Release/release/styles/simplestyleplugin.dll"
    currentdir:  "C:/Qt/build-styleplugin-Desktop_Qt_5_6_2_MinGW_32bit-Release/release"
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/accessible" ...
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/build-styleplugin-Desktop_Qt_5_6_2_MinGW_32bit-Release/release/accessible" ...
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Qt5.6.2/5.6/mingw49_32/plugins/accessiblebridge" ...
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/build-styleplugin-Desktop_Qt_5_6_2_MinGW_32bit-Release/release/accessiblebridge" ...
    
    

  • Lifetime Qt Champion

    From this line: loaded library "C:/Qt/build-styleplugin-Desktop_Qt_5_6_2_MinGW_32bit-Release/release/styles/simplestyleplugin.dll" it looks like it has been loaded, no ?



  • @SGaist
    I think so. But I don't see the red button somehow.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.