rockowitz / ddcui

Graphical user interface for ddcutil - control monitor settings
http://www.ddcutil.com
GNU General Public License v2.0
147 stars 2 forks source link

feature_value_widgets/value_special_widget_x62.cpp: Add missing () #37

Closed AndrewAmmerlaan closed 2 years ago

AndrewAmmerlaan commented 2 years ago

This fixes:

FAILED: CMakeFiles/ddcui.dir/src/feature_value_widgets/value_special_widget_x62.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -I/var/tmp/portage/app-misc/ddcui-0.2.1/work/ddcui-0.2.1_build -I/var/tmp/portage/app-misc/ddcui-0.2.1/work/ddcui-0.2.1 -I/var/tmp/portage/app-misc/ddcui-0.2.1/work/ddcui-0.2.1_build/ddcui_autogen/include -I/var/tmp/portage/app-misc/ddcui-0.2.1/work/ddcui-0.2.1/src -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtHelp -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtSql -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -fPIC -std=gnu++11 -MD -MT CMakeFiles/ddcui.dir/src/feature_value_widgets/value_special_widget_x62.cpp.o -MF CMakeFiles/ddcui.dir/src/feature_value_widgets/value_special_widget_x62.cpp.o.d -o CMakeFiles/ddcui.dir/src/feature_value_widgets/value_special_widget_x62.cpp.o -c /var/tmp/portage/app-misc/ddcui-0.2.1/work/ddcui-0.2.1/src/feature_value_widgets/value_special_widget_x62.cpp
In file included from /usr/include/qt5/QtCore/qglobal.h:50,
from /usr/include/qt5/QtGui/qtguiglobal.h:43,
from /usr/include/qt5/QtWidgets/qtwidgetsglobal.h:43,
from /usr/include/qt5/QtWidgets/qwidget.h:43,
from /usr/include/qt5/QtWidgets/QWidget:1,
from /var/tmp/portage/app-misc/ddcui-0.2.1/work/ddcui-0.2.1/src/core_widgets/enhanced_slider.h:10,
from /var/tmp/portage/app-misc/ddcui-0.2.1/work/ddcui-0.2.1/src/feature_value_widgets/value_special_widget_x62.cpp:9:
/var/tmp/portage/app-misc/ddcui-0.2.1/work/ddcui-0.2.1/src/feature_value_widgets/value_special_widget_x62.cpp: In member function ‘void ValueSpecialWidgetX62::combobox_activated(int)’:
/var/tmp/portage/app-misc/ddcui-0.2.1/work/ddcui-0.2.1/src/feature_value_widgets/value_special_widget_x62.cpp:188:16: error: invalid use of member function ‘int QComboBox::currentIndex() const’ (did you forget the ‘()’ ?)
188 |    assert(_cb->currentIndex == index);
|           ~~~~~^~~~~~~~~~~~

Signed-off-by: Andrew Ammerlaan andrewammerlaan@gentoo.org

rockowitz commented 2 years ago

Hi Andrew,

What compiler option are you using that caught this error? (Obviously I didn't.)

Thanks, Sanford

rockowitz commented 2 years ago

Applied to branch 0.2.2-dev. Thank you.

AndrewAmmerlaan commented 2 years ago

What compiler option are you using that caught this error? (Obviously I didn't.)

This is gcc-11.2.1 with CXXFLAGS=CFLAGS="-march=native -O2 -pipe -frecord-gcc-switches" and LDFLAGS="${LDFLAGS} -Wl,--defsym=__gentoo_check_ldflags__=0". Where native translates to -march=skylake -mabm

rockowitz commented 2 years ago

On further examination, it turns out that the compiler warning is in fact bogus. current_index() is a method of Qt class QComboBox, but current_index is also a property.

I've been unable to find a compiler switch that controls the error message. Do you know what it is?

AndrewAmmerlaan commented 2 years ago

On further examination, it turns out that the compiler warning is in fact bogus. current_index() is a method of Qt class QComboBox, but current_index is also a property.

I've been unable to find a compiler switch that controls the error message. Do you know what it is?

Not sure, perhaps this only happens for certain Qt versions, I'm running 5.15.2 at the moment.