viktorgino / headunit-desktop

HeadUnit Desktop is a car PC software built with Qt 5 and QML
https://github.com/viktorgino/headunit-desktop/wiki
GNU General Public License v3.0
285 stars 64 forks source link

Undeclared QMutableListIterator #73

Closed aselafernando closed 1 year ago

aselafernando commented 1 year ago

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..

viktorgino commented 1 year ago

Hi @aselafernando

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

aselafernando commented 1 year ago

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
aselafernando commented 1 year ago

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
viktorgino commented 1 year ago

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

aselafernando commented 1 year ago

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