hello
I have this little cool application, reveal, which is a exif metadata viewer. It is from 2006, coded with qt4. Apart from some minor adjustments, it compiles until
g++ -c -pipe -O2 -O2 -I/usr/include -D_REENTRANT -Wall -W -DBIN_DIR=\""/usr/bin\"" -DRESOURCE_DIR=\""/usr/share/Reveal\"" -DTARGET=\""Reveal\"" -DNEEDED_TRANSLATIONS=\""Reveal commonDialogs generalTools qt\"" -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4 -Itmp -o tmp/dynamicSlider.o ../src/_commonWidgets/dynamicSlider.cpp
../src/_commonWidgets/dynamicSlider.cpp: In member function 'void DynamicSlider::setPrefix(QString)':
../src/_commonWidgets/dynamicSlider.cpp:54:27: error: call of overloaded 'QString(NULL)' is ambiguous
/usr
/include
/qt4
/QtCore
/qstring.
h:428:43: note
: candidates are
: QString::QString(const QByteArray
&) /usr
/include
/qt4
/QtCore
/qstring.
h:426:43: note
: QString::QString(const char*) /usr
/include
/qt4
/QtCore
/qstring.
h:727:8: note
: QString::QString(const QString
&) ../src/_commonWidgets/dynamicSlider.cpp: In member function 'void DynamicSlider::setSuffix(QString)':
../src/_commonWidgets/dynamicSlider.cpp:68:27: error: call of overloaded 'QString(NULL)' is ambiguous
/usr
/include
/qt4
/QtCore
/qstring.
h:428:43: note
: candidates are
: QString::QString(const QByteArray
&) /usr
/include
/qt4
/QtCore
/qstring.
h:426:43: note
: QString::QString(const char*) /usr
/include
/qt4
/QtCore
/qstring.
h:727:8: note
: QString::QString(const QString
&) make: *** [tmp/dynamicSlider.o] Error 1
g++ -c -pipe -O2 -O2 -I/usr/include -D_REENTRANT -Wall -W -DBIN_DIR=\""/usr/bin\"" -DRESOURCE_DIR=\""/usr/share/Reveal\"" -DTARGET=\""Reveal\"" -DNEEDED_TRANSLATIONS=\""Reveal commonDialogs generalTools qt\"" -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4 -Itmp -o tmp/dynamicSlider.o ../src/_commonWidgets/dynamicSlider.cpp
../src/_commonWidgets/dynamicSlider.cpp: In member function 'void DynamicSlider::setPrefix(QString)':
../src/_commonWidgets/dynamicSlider.cpp:54:27: error: call of overloaded 'QString(NULL)' is ambiguous
/usr/include/qt4/QtCore/qstring.h:428:43: note: candidates are: QString::QString(const QByteArray&)
/usr/include/qt4/QtCore/qstring.h:426:43: note: QString::QString(const char*)
/usr/include/qt4/QtCore/qstring.h:727:8: note: QString::QString(const QString&)
/usr/include/qt4/QtCore/qstring.h:106:5: note: QString::QString(QChar)
/usr/include/qt4/QtCore/qstring.h:105:14: note: QString::QString(const QChar*)
../src/_commonWidgets/dynamicSlider.cpp: In member function 'void DynamicSlider::setSuffix(QString)':
../src/_commonWidgets/dynamicSlider.cpp:68:27: error: call of overloaded 'QString(NULL)' is ambiguous
/usr/include/qt4/QtCore/qstring.h:428:43: note: candidates are: QString::QString(const QByteArray&)
/usr/include/qt4/QtCore/qstring.h:426:43: note: QString::QString(const char*)
/usr/include/qt4/QtCore/qstring.h:727:8: note: QString::QString(const QString&)
/usr/include/qt4/QtCore/qstring.h:106:5: note: QString::QString(QChar)
/usr/include/qt4/QtCore/qstring.h:105:14: note: QString::QString(const QChar*)
make: *** [tmp/dynamicSlider.o] Error 1
To copy to clipboard, switch view to plain text mode
where the file looks like this:
void DynamicSlider
::setPrefix( QString val
) {
prefix1 = val;
updateTooltipLabel();
}
//==========================================
{
prefix1 = v1;
prefix2 = v2;
updateTooltipLabel();
}
//==========================================
void DynamicSlider
::setSuffix( QString val
) {
suffix1 = val;
updateTooltipLabel();
}
void DynamicSlider::setPrefix( QString val )
{
prefix1 = val;
prefix2 = QString( NULL );
updateTooltipLabel();
}
//==========================================
void DynamicSlider::setPrefixes( QString v1, QString v2 )
{
prefix1 = v1;
prefix2 = v2;
updateTooltipLabel();
}
//==========================================
void DynamicSlider::setSuffix( QString val )
{
suffix1 = val;
suffix2 = QString( NULL );
updateTooltipLabel();
}
To copy to clipboard, switch view to plain text mode
and .h
///set two prefix values, one for when the value is positive and one for when the value is negative.
///set the suffix that is displayed after the current slider value
///set two suffix values, one for when the value is positive and one for when the value is negative.
///set two prefix values, one for when the value is positive and one for when the value is negative.
void setPrefixes( QString prefix1, QString prefix2 );
///set the suffix that is displayed after the current slider value
void setSuffix( QString val );
///set two suffix values, one for when the value is positive and one for when the value is negative.
void setSuffixes( QString suffix1, QString suffix2 );
To copy to clipboard, switch view to plain text mode
Now, with qt4.7, when I delete the NULL, it compiles through and runs.
With qt 4.8, I get a segmentation fault, gdb tells it faults in Qstring::fromLocal8Bit(char const*, int) ()
I am not familiar with qt, could somebody help me out?
thx in advance
Bookmarks