Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] undefined reference to QWidget::styleChange

[solved] undefined reference to QWidget::styleChange

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 7.3k 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.
  • J Offline
    J Offline
    jorgemj
    wrote on last edited by
    #1

    I know that this problem was reported in the past and some solutions were proposed but none of them work for me.
    My enviroment is:
    Qt5.3 for raspberry cross compiled, from the git repository
    Linaro cross compiler.

    I have a library that has a dialog with some widgets, buttoms, frames, etc.
    The library itself compiles fine also for desktop and RPi.

    When the app that uses the library is compiled to desktop system there is no problem but when it is compiled for RPi system I get messages of undefined reference to several methods of QWidget:

    ../libQConfigDialog.so: undefined reference to QWidget::styleChange(QStyle&)' ../libQConfigDialog.so: undefined reference to QWidget::windowActivationChange(bool)'
    ../libQConfigDialog.so: undefined reference to QWidget::fontChange(QFont const&)' ../libQConfigDialog.so: undefined reference to QWidget::enabledChange(bool)'
    ../libQConfigDialog.so: undefined reference to QWidget::paletteChange(QPalette const&)' ../libQConfigDialog.so: undefined reference to QWidget::languageChange()'

    The main program has also some dialogs and when this library is removed it compiles and works fine in the RPi.

    The .pro of the library is:

    @
    TEMPLATE = lib
    TARGET = QConfigDialog
    QT += core
    gui
    widgets

    HEADERS += treemodel.h
    treeitem.h
    qconfigdialog.h
    SOURCES += treemodel.cpp
    treeitem.cpp
    qconfigdialog.cpp
    FORMS += qconfigdialog.ui
    RESOURCES +=
    INCLUDEPATH +=
    @

    And the .pro of the app is:

    @
    QT += core gui widgets

    TARGET = QtAppSample
    TEMPLATE = app

    SOURCES += main.cpp
    QtAppSampleDlg.cpp

    HEADERS += QtAppSampleDlg.h

    FORMS += qtappsampledlg.ui

    LIBS += -L../
    -lQConfigDialog
    @

    Has anyone an idea about what is happening?

    Thanks.
    Jorge

    [edit: Added missing coding tags @ SGaist]

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

      Hi and welcome to devnet,

      All the functions missing are coming from Qt 3. Are you building an old application ? In any case have a look at the "Porting to Qt 4" chapter of Qt's documentation

      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
      • J Offline
        J Offline
        jorgemj
        wrote on last edited by
        #3

        Thanks for your response,

        I'll review that. The library was developed with Qt4 but what I don't understand is why the errors appears because I don't do any call to this methods and they aren't present in the moc file so should I suppose that is an internal dependance in the Qt?

        I'm thinking in generate again the dialog whit the last version of Qtcreator, the original was developed with Qtcreatod 2.8

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

          If the library was built with a Qt 4 version compiled with qt3-support enabled then it's normal that you get these missing symbol if you try to link to a different version.

          Anyway, since you are using Qt 5, you should rebuild this library. The Qt Creator version doesn't matter

          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
          • J Offline
            J Offline
            jorgemj
            wrote on last edited by
            #5

            I finally solved it creating a new project with qtcreator, copying the logic code and redesigning the interface.
            The main difference I found rewriting the interface was that I previously acceded to the widgets with ui.whateverwidget and now I have to put ui->whateverwidget.

            Thanks for your help.

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

              ui. vs ui-> is an implementation detail that should have no influence on the problem you had.

              Anyway, nice you found a solution.

              Since it's working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

              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