Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Additional style plugins
Forum Updated to NodeBB v4.3 + New Features

Additional style plugins

Scheduled Pinned Locked Moved Installation and Deployment
11 Posts 2 Posters 4.6k Views 1 Watching
  • 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.
  • H Offline
    H Offline
    hubipet
    wrote on last edited by
    #1

    Hello forum,

    I upgraded Qt from 4.7 to 5.2.1 and used QCleanlooksstyle in my project.
    on "https://codereview.qt-project.org/#change,75758" I found the additional styles.
    So I checked all out from the repository, opened the .pro file in QtCreator and compiled all successfully.
    After that I installed the plugins with "make install". Everything looked good.

    in my .pro file I added the line: QTPLUGIN += qcleanlooksstyle
    In the main window constructor I added qApp->setStyle(new QCleanlooksStyle());

    and get the linker error:
    undefined reference to `QCleanlooksStyle::QCleanlooksStyle()'

    What is wrong?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Did you build your plugin statically ? QTPLUGIN is only needed in this case

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

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hubipet
        wrote on last edited by
        #3

        Hi , thanks for answering

        No I linked it dynamically. After compilation and installation I found in my Qt installation a new folder
        /$HOME/Qt5.2.1/5.2.1/gcc_64/plugins/styles/
        with three libs
        libqcleanlooksstyle.so
        libqmotifstyle.so
        libqplastiquestyle.so

        I'd like to carry on using cleanlooksstyle as I did with Qt 4.7.
        but get always the error message.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          IIRC, you would need to use "this version":http://qt-project.org/doc/qt-5/qapplication.html#setStyle-2 of setStyle

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

          1 Reply Last reply
          0
          • H Offline
            H Offline
            hubipet
            wrote on last edited by
            #5

            Well that works fine now when linking dynamically.
            After that I linked the plugins statically and tried again with static linking to my project.
            I have now additional the libs
            libqcleanlooksstyle.a
            libqmotifstyle.a
            libqplastiquestyle.a

            Now qmake says:
            Project WARNING: Plugin class name could not be determined for qcleanlooksstyle plugin.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Did you setup your project to use static plugins ?

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

              1 Reply Last reply
              0
              • H Offline
                H Offline
                hubipet
                wrote on last edited by
                #7

                I think I have. I compiled a static version of Qt for testing purposes and start it on second computer without any Qt installation and it works.
                I have to import mysql plugin in the static version and it works.
                Is it possible that Qtcreator can't find the new folder "styles" because it is not in any "...PATH" variable?
                If it is where can i add it?

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  hubipet
                  wrote on last edited by
                  #8

                  I looked around in the modules folder of my static Qt and found several .pri files. I found qt_plugin_qcleanlooksstyle.pri with the following content

                  QT_PLUGIN.qcleanlooksstyle.TYPE = styles
                  QT_PLUGIN.qcleanlooksstyle.CLASS_NAME =

                  After that I opened the .pri file of a working plugin qt_plugin_qsqlmysql.pri

                  QT_PLUGIN.qsqlmysql.TYPE = sqldrivers
                  QT_PLUGIN.qsqlmysql.CLASS_NAME = QMYSQLDriverPlugin

                  It seemed, that in the style pri file the class name is misssing. So I added the class name to the file.

                  QT_PLUGIN.qcleanlooksstyle.TYPE = styles
                  QT_PLUGIN.qcleanlooksstyle.CLASS_NAME =QCleanlooksStyle

                  qmake was satisfied with this solution, BUT at link time another error occured :
                  undefined reference to `qt_static_plugin_QCleanlooksStyle()

                  Something goes wrong ????

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    It looks like the static plugin is not found, are you sure you have it at the right place ?

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

                    1 Reply Last reply
                    0
                    • H Offline
                      H Offline
                      hubipet
                      wrote on last edited by
                      #10

                      The place seems to be ok. I rebuild the plugins and added the class name in the modules file ( see post above ). qmake finds the plugin now.
                      BUT:
                      @g++ -Wl,-O1 -o DockWidgets main.o MainWindow.o dockwidgets_plugin_import.o moc_MainWindow.o -L/home/jaensch/QtStatic5.2.1/lib -L/home/jaensch/QtStatic5.2.1/plugins/styles -lqcleanlooksstyle -lQt5Widgets -lgobject-2.0 -L/home/jaensch/QtStatic5.2.1/plugins/sqldrivers -lqsqlmysql -lmysqlclient_r -lssl -lcrypto -lqsqlite -lQt5Sql -L/home/jaensch/QtStatic5.2.1/plugins/platforms -lqxcb -lX11-xcb -lXi -lSM -lICE -ldbus-1 -lxcb -L/home/jaensch/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/platforms/xcb/xcb-static -lxcb-static -L/home/jaensch/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/lib -lxkbcommon -lQt5PlatformSupport -lfontconfig -lfreetype -lXrender -lXext -lX11 -lQt5DBus -lQt5Gui -ljpeg -lpng -lEGL -lQt5Core -lz -licui18n -licuuc -lpcre16 -lm -ldl -lgthread-2.0 -pthread -lglib-2.0 -lrt -lGL -lpthread
                      /home/jaensch/QtStatic5.2.1/lib/libQt5Widgets.a(qstylehelper.o): In function QStyleHelper::uniqueName(QString const&, QStyleOption const*, QSize const&)': qstylehelper.cpp:(.text+0x190): multiple definition of QStyleHelper::uniqueName(QString const&, QStyleOption const*, QSize const&)'
                      /home/jaensch/QtStatic5.2.1/plugins/styles/libqcleanlooksstyle.a(qstylehelper.o):qstylehelper.cpp:(.text+0x190): first defined here
                      /home/jaensch/QtStatic5.2.1/lib/libQt5Widgets.a(qstylehelper.o): In function QStyleHelper::calcBigLineSize(int)': qstylehelper.cpp:(.text+0xdf0): multiple definition of QStyleHelper::calcBigLineSize(int)'
                      /home/jaensch/QtStatic5.2.1/plugins/styles/libqcleanlooksstyle.a(qstylehelper.o):qstylehelper.cpp:(.text+0xd10): first defined here
                      /home/jaensch/QtStatic5.2.1/lib/libQt5Widgets.a(qstylehelper.o): In function QStyleHelper::angle(QPointF const&, QPointF const&)': qstylehelper.cpp:(.text+0xe20): multiple definition of QStyleHelper::angle(QPointF const&, QPointF const&)'
                      /home/jaensch/QtStatic5.2.1/plugins/styles/libqcleanlooksstyle.a(qstylehelper.o):qstylehelper.cpp:(.text+0xd40): first defined here
                      /home/jaensch/QtStatic5.2.1/lib/libQt5Widgets.a(qstylehelper.o): In function QStyleHelper::drawBorderPixmap(QPixmap const&, QPainter*, QRect const&, int, int, int, int)': qstylehelper.cpp:(.text+0xf10): multiple definition of QStyleHelper::drawBorderPixmap(QPixmap const&, QPainter*, QRect const&, int, int, int, int)'
                      /home/jaensch/QtStatic5.2.1/plugins/styles/libqcleanlooksstyle.a(qstylehelper.o):qstylehelper.cpp:(.text+0xe30): first defined here
                      /home/jaensch/QtStatic5.2.1/lib/libQt5Widgets.a(qstylehelper.o): In function QStyleHelper::calcLines(QStyleOptionSlider const*)': qstylehelper.cpp:(.text+0x1560): multiple definition of QStyleHelper::calcLines(QStyleOptionSlider const*)'
                      /home/jaensch/QtStatic5.2.1/plugins/styles/libqcleanlooksstyle.a(qstylehelper.o):qstylehelper.cpp:(.text+0x1480): first defined here
                      /home/jaensch/QtStatic5.2.1/lib/libQt5Widgets.a(qstylehelper.o): In function QStyleHelper::drawDial(QStyleOptionSlider const*, QPainter*)': qstylehelper.cpp:(.text+0x1aa0): multiple definition of QStyleHelper::drawDial(QStyleOptionSlider const*, QPainter*)'
                      /home/jaensch/QtStatic5.2.1/plugins/styles/libqcleanlooksstyle.a(qstylehelper.o):qstylehelper.cpp:(.text+0x19c0): first defined here
                      collect2: error: ld returned 1 exit status
                      make: *** [DockWidgets] Error 1
                      08:22:26: The process "/usr/bin/make" exited with code 2.
                      Error while building/deploying project DockWidgets (kit: Static Desktop Qt 5.2.1 GCC 64bit)
                      When executing step 'Make'
                      08:22:26: Elapsed time: 00:02.@

                      ????

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        The static plugins are built in Qt so your use case is special. What you can do since you already build Qt yourself is to integrate it to Qt

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

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved