Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Style Plugin Example does not show red Button

    General and Desktop
    3
    10
    1522
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      samdol last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        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

        S 1 Reply Last reply Reply Quote 0
        • S
          samdol @mrjj last edited by samdol

          @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.

          mrjj 1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion @samdol last edited by

            @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.

            S 1 Reply Last reply Reply Quote 0
            • S
              samdol @mrjj last edited by samdol

              @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?

              mrjj 1 Reply Last reply Reply Quote 0
              • mrjj
                mrjj Lifetime Qt Champion @samdol last edited by mrjj

                @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.

                1 Reply Last reply Reply Quote 0
                • SGaist
                  SGaist Lifetime Qt Champion last edited by

                  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.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  S 1 Reply Last reply Reply Quote 1
                  • S
                    samdol @SGaist last edited by

                    @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" ...
                    
                    
                    1 Reply Last reply Reply Quote 0
                    • SGaist
                      SGaist Lifetime Qt Champion last edited by

                      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 ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      S 1 Reply Last reply Reply Quote 1
                      • S
                        samdol @SGaist last edited by

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

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post