Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid use of incomplete type ‘class QActionGroup’ #45

Open
dmaglio opened this issue Jan 24, 2023 · 3 comments
Open

invalid use of incomplete type ‘class QActionGroup’ #45

dmaglio opened this issue Jan 24, 2023 · 3 comments

Comments

@dmaglio
Copy link

dmaglio commented Jan 24, 2023

i try to compile in F37 and this is the error:

g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../onedrive_tray -I. -I../../onedrive_tray -I/usr/include/qt6 -I/usr/include/qt6/QtWidgets -I/usr/include/qt6/QtGui -I/usr/include/qt6/QtCore -I. -I/usr/lib64/qt6/mkspecs/linux-g++ -o window.o ../window.cpp
../window.cpp: In member function ‘void Window::createActions()’:
../window.cpp:474:43: error: invalid use of incomplete type ‘class QActionGroup’
  474 |     iconColorGroup = new QActionGroup(this);
      |                                           ^
In file included from /usr/include/qt6/QtWidgets/qwidget.h:11,
                 from /usr/include/qt6/QtWidgets/qframe.h:8,
                 from /usr/include/qt6/QtWidgets/qabstractscrollarea.h:8,
                 from /usr/include/qt6/QtWidgets/qtextedit.h:8,
                 from /usr/include/qt6/QtWidgets/qplaintextedit.h:8,
                 from /usr/include/qt6/QtWidgets/QPlainTextEdit:1,
                 from ../window.h:5,
                 from ../window.cpp:1:
/usr/include/qt6/QtGui/qaction.h:21:7: note: forward declaration of ‘class QActionGroup’
   21 | class QActionGroup;
      |       ^~~~~~~~~~~~
../window.cpp:490:23: error: invalid use of incomplete type ‘class QActionGroup’
  490 |         iconColorGroup->addAction(iconColorAction);
      |                       ^~
/usr/include/qt6/QtGui/qaction.h:21:7: note: forward declaration of ‘class QActionGroup’
   21 | class QActionGroup;
      |       ^~~~~~~~~~~~
../window.cpp:497:19: error: invalid use of incomplete type ‘class QActionGroup’
  497 |     iconColorGroup->addAction(moreColorsAction);
      |                   ^~
/usr/include/qt6/QtGui/qaction.h:21:7: note: forward declaration of ‘class QActionGroup’
   21 | class QActionGroup;
      |       ^~~~~~~~~~~~
../window.cpp: In member function ‘void Window::createTrayIcon()’:
../window.cpp:532:44: error: invalid use of incomplete type ‘class QActionGroup’
  532 |     submenuColor->addActions(iconColorGroup->actions());
      |                                            ^~
/usr/include/qt6/QtGui/qaction.h:21:7: note: forward declaration of ‘class QActionGroup’
   21 | class QActionGroup;
      |       ^~~~~~~~~~~~
make: *** [Makefile:402: window.o] Errore 1
@ga2k
Copy link

ga2k commented May 20, 2023

This happens if you try to use qmake from Qt6. You don't get this error if you use Qt5

@ttntm
Copy link

ttntm commented Oct 19, 2023

This happens if you try to use qmake from Qt6. You don't get this error if you use Qt5

Yes, that's it.

@dmaglio make sure you install the package qt5-qtbase-devel and use qmake-qt5 instead of just qmake.

Context: just did the same on Fedora 38.

@SamD2021
Copy link

SamD2021 commented Mar 4, 2024

I had the same error a bit ago and adding the following to window.cpp fixed it.

#include <QActionGroup>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants