radareorg / iaito

Official QT frontend of radare2
GNU General Public License v3.0
968 stars 83 forks source link

8b48ce96e1ff74c27381817d2b49f86b1e685cf7 broke linux build #152

Closed jjdredd closed 5 months ago

jjdredd commented 7 months ago

https://github.com/radareorg/iaito/commit/8b48ce96e1ff74c27381817d2b49f86b1e685cf7

trufae commented 7 months ago

why does it build fine in flatpak and github if its broken?

jjdredd commented 7 months ago

could be because of the qt version. I use 6.5, what does flatpak and github use?

trufae commented 7 months ago

Flatpak uses qt5

jjdredd commented 7 months ago

Looks like zero isn't even in the enum:

https://doc.qt.io/qt-6/qfiledialog.html#Option-enum https://github.com/qt/qtbase/blob/dev/src/widgets/dialogs/qfiledialog.h#L47

So I don't know how Qt interprets the zero value.

Same for Qt5 https://github.com/qt/qtbase/blob/5.15/src/widgets/dialogs/qfiledialog.h#L90

trufae commented 7 months ago

These options are suposed to be used as flags or bit options. Note the values dont overlap their bits. So imho 0 should be a valid value to be used or maybe im missinh sthg

trufae commented 6 months ago

is this still a problem?

jjdredd commented 5 months ago

is this still a problem?

Yes,

../src/dialogs/NewFileDialog.cpp: In member function ‘void NewFileDialog::on_selectFileButton_clicked()’:
../src/core/Iaito.h:37:27: error: invalid conversion from ‘int’ to ‘QFileDialog::Option’ [-fpermissive]
   37 | #define QFILEDIALOG_FLAGS 0
      |                           ^
      |                           |
      |                           int
../src/dialogs/NewFileDialog.cpp:93:99: note: in expansion of macro ‘QFILEDIALOG_FLAGS’
   93 |     auto res = QFileDialog::getOpenFileName(nullptr, tr("Select file"), currentDir, QString(), 0, QFILEDIALOG_FLAGS);
      |                                                                                                   ^~~~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/qglobal.h:51,
                 from /usr/include/qt6/QtGui/qtguiglobal.h:7,
                 from /usr/include/qt6/QtWidgets/qtwidgetsglobal.h:7,
                 from /usr/include/qt6/QtWidgets/qdialog.h:7,
                 from /usr/include/qt6/QtWidgets/QDialog:1,
                 from ../src/dialogs/InitialOptionsDialog.h:4:
/usr/include/qt6/QtCore/qflags.h:74:45: note:   initializing argument 1 of ‘constexpr QFlags<T>::QFlags(Enum) [with Enum = QFileDialog::Option]’
   74 |     constexpr inline Q_IMPLICIT QFlags(Enum flags) noexcept : i(Int(flags)) {}
      |                                        ~~~~~^~~~~
../src/common/TempConfig.cpp: In destructor ‘TempConfig::~TempConfig()’:
../src/common/TempConfig.cpp:10:31: warning: ‘QVariant::Type QVariant::type() const’ is deprecated: Use typeId() or metaType(). [-Wdeprecated-declarations]
   10 |         switch (i.value().type()) {
      |                 ~~~~~~~~~~~~~~^~
In file included from /usr/include/qt6/QtGui/qaction.h:13,
                 from /usr/include/qt6/QtWidgets/qwidget.h:12,
                 from /usr/include/qt6/QtWidgets/qmenu.h:8,
                 from /usr/include/qt6/QtWidgets/QMenu:1,
                 from ../src/core/Iaito.h:12,
                 from ../src/common/TempConfig.cpp:4:
/usr/include/qt6/QtCore/qvariant.h:428:10: note: declared here
  428 |     Type type() const
      |          ^~~~
make[1]: *** [Makefile:4203: NewFileDialog.o] Error 1

$ qmake6 --version
QMake version 3.1
Using Qt version 6.6.1 in /usr/lib64

$ gcc --version
gcc (Gentoo 13.2.1_p20240113-r1 p12) 13.2.1 20240113