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. QtCreator plugin compilation error — invalid use of incomplete type 'class QAAction'
Forum Update on Monday, May 27th 2025

QtCreator plugin compilation error — invalid use of incomplete type 'class QAAction'

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 2.9k Views
  • 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.
  • C Offline
    C Offline
    CodeNoob
    wrote on 13 May 2016, 15:18 last edited by
    #1

    I am trying to compile (against qt 5.4.2) and I keep getting this error. Is there a version mismatch?

    I am frankly a bit surprised by how hard it is to install a plugin in QtCreator. I need to find the QtCreator source, plug-in source, point paths and everything (more difficult if you don't have admin and has to download everything by yourself) to the right version, compile myself, and install. While in many IDEs it's just a few mouse clicks. am I not doing this right?

    The plugin I am trying to install is this, in case anybody wonders:
    https://github.com/midi-pascal/qtcreator-tabbededitor-plugin

    ../qtcreator-tabbededitor-plugin/tabsforeditorswidget.cpp: In constructor 'TabbedEditor::Internal::TabsForEditorsWidget::TabsForEditorsWidget(QWidget*)':
    ../qtcreator-tabbededitor-plugin/tabsforeditorswidget.cpp:54:73: error: invalid use of incomplete type 'class QAction'
      QAction *prevTabAction = new QAction(tr("Switch to previous tab"), this);
                                                                             ^
    In file included from ../../../username/bin/Qt5.4.2/5.4/gcc_64/include/QtWidgets/QWidget:1:0,
                     from ../qtcreator-tabbededitor-plugin/tabsforeditorswidget.h:5,
                     from ../qtcreator-tabbededitor-plugin/tabsforeditorswidget.cpp:1:
    ../../../username/bin/Qt5.4.2/5.4/gcc_64/include/QtWidgets/qwidget.h:61:7: error: forward declaration of 'class QAction'
     class QAction;
    
    
    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 13 May 2016, 16:17 last edited by
      #2

      in tabsforeditorswidget.cpp add #include <QAction>

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CodeNoob
        wrote on 13 May 2016, 17:13 last edited by
        #3

        Thanks, now I am getting errors like
        cannot find -lCore
        cannot find -lTextEditor
        cannot find -lAggregation
        cannot find -lExtensionSystem
        cannot find -lUtils

        Where can I obtain those libraries?

        @VRonin said:

        #include <QAction>

        1 Reply Last reply
        0
        • V Offline
          V Offline
          VRonin
          wrote on 13 May 2016, 17:15 last edited by VRonin
          #4

          in your .pro file, do you have QT += core gui widgets ?

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          0
          • C Offline
            C Offline
            CodeNoob
            wrote on 13 May 2016, 17:27 last edited by
            #5

            Added it and still failed.

            # Qt Creator linking
            QTC_PLUGIN_NAME = TabbedEditor
            QTC_LIB_DEPENDS += \
                extensionsystem \
                utils
            QTC_PLUGIN_DEPENDS += \
                coreplugin \
                texteditor
            QT += core gui widgets
            
            ## set the QTC_SOURCE environment variable to override the setting here
            QTCREATOR_SOURCES = $$(QTC_SOURCE)
            isEmpty(QTCREATOR_SOURCES):error("Error. QTC_SOURCE variable must point to Qt Creator sources.")
            
            ## set the QTC_BUILD environment variable to override the setting here
            IDE_BUILD_TREE = $$(QTC_BUILD)
            isEmpty(IDE_BUILD_TREE):error("Error. QTC_BUILD variable must point to Qt Creator build directory.")
            
            include($$QTCREATOR_SOURCES/src/qtcreatorplugin.pri)
            
            ## uncomment to build plugin into user config directory
            ## <localappdata>/plugins/<ideversion>
            ##    where <localappdata> is e.g.
            ##    "%LOCALAPPDATA%\QtProject\qtcreator" on Windows Vista and later
            ##    "$XDG_DATA_HOME/data/QtProject/qtcreator" or "~/.local/share/data/QtProject/qtcreator" on Linux
            ##    "~/Library/Application Support/QtProject/Qt Creator" on Mac
            # USE_USER_DESTDIR = yes
            
            DEFINES += TABBEDEDITOR_LIBRARY
            
            # TabbedEditor files
            
            SOURCES += \
                tabbededitorplugin.cpp \
                tabsforeditorswidget.cpp
            
            HEADERS += \
                tabbededitorplugin.h \
                tabbededitorconstants.h \
                tabsforeditorswidget.h
            
            RESOURCES += \
                resources/res.qrc
            
            CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT
            

            @VRonin said:

            QT += core gui widgets

            1 Reply Last reply
            0

            1/5

            13 May 2016, 15:18

            • Login

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