viktorgino/headunit-desktop

Undeclared QMutableListIterator

aselafernando opened this issue · 5 comments

When Compiling the following error is experienced with the master branch on Debian 11 x64

../../app/panelitemsmodel.cpp: In member function ‘void PanelItemsModel::setPluginList(PluginList*)’:
../../app/panelitemsmodel.cpp:58:23: warning: unused variable ‘plugin’ [-Wunused-variable]
   58 |         PluginObject *plugin = m_pluginList->at(i);
      |                       ^~~~~~
../../app/panelitemsmodel.cpp: In member function ‘void PanelItemsModel::removeUnusedItems()’:
../../app/panelitemsmodel.cpp:94:5: error: ‘QMutableListIterator’ was not declared in this scope
   94 |     QMutableListIterator<PanelItem> i(m_modelItems);
      |     ^~~~~~~~~~~~~~~~~~~~
../../app/panelitemsmodel.cpp:94:35: error: expected primary-expression before ‘>’ token
   94 |     QMutableListIterator<PanelItem> i(m_modelItems);
      |                                   ^
../../app/panelitemsmodel.cpp:94:37: error: ‘i’ was not declared in this scope
   94 |     QMutableListIterator<PanelItem> i(m_modelItems);
      |                                     ^
make[1]: *** [Makefile:630: .obj/panelitemsmodel.o] Error 1
make[1]: Leaving directory '/home/asela/testing/headunit-desktop/build/app'
make: *** [Makefile:61: sub-app-make_first] Error 2

I tried adding #include <QMutableListIterator> into app/panelitemsmodel.h however that made no difference..

Hi @aselafernando

What version of Qt are you using? I haven't yet come across this issue, but will try to replicate it.

Output of qmake --version

QMake version 3.1
Using Qt version 5.15.2 in /usr/lib/x86_64-linux-gnu

Can replicate using these steps:

git clone --recursive https://github.com/viktorgino/headunit-desktop.git
cd headunit-desktop
protoc --proto_path=modules/android-auto/headunit/hu/ --cpp_out=modules/android-auto/headunit/hu/generated.x64/ modules/android-auto/headunit/hu/hu.proto
mkdir build && cd build
qmake PREFIX=/opt/hud/ ../headunit-desktop.pro
make -j30

I just compiled direct on the raspberry pi 4 and it does not produce the above error, it's only when compiling for x64

qmake --version
QMake version 3.1
Using Qt version 5.15.2 in /usr/lib/aarch64-linux-gnu

That's rather odd. I never had issues on Raspbian or Manjaro. Will have to give building on Debian a go

I re-created my development VM and the issue went away, must've been some issue with the QT5 installation on that Debian VM!