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

Qt Code:
  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
  2. ../src/_commonWidgets/dynamicSlider.cpp: In member function 'void DynamicSlider::setPrefix(QString)':
  3. ../src/_commonWidgets/dynamicSlider.cpp:54:27: error: call of overloaded 'QString(NULL)' is ambiguous
  4. /usr/include/qt4/QtCore/qstring.h:428:43: note: candidates are: QString::QString(const QByteArray&)
  5. /usr/include/qt4/QtCore/qstring.h:426:43: note: QString::QString(const char*)
  6. /usr/include/qt4/QtCore/qstring.h:727:8: note: QString::QString(const QString&)
  7. /usr/include/qt4/QtCore/qstring.h:106:5: note: QString::QString(QChar)
  8. /usr/include/qt4/QtCore/qstring.h:105:14: note: QString::QString(const QChar*)
  9. ../src/_commonWidgets/dynamicSlider.cpp: In member function 'void DynamicSlider::setSuffix(QString)':
  10. ../src/_commonWidgets/dynamicSlider.cpp:68:27: error: call of overloaded 'QString(NULL)' is ambiguous
  11. /usr/include/qt4/QtCore/qstring.h:428:43: note: candidates are: QString::QString(const QByteArray&)
  12. /usr/include/qt4/QtCore/qstring.h:426:43: note: QString::QString(const char*)
  13. /usr/include/qt4/QtCore/qstring.h:727:8: note: QString::QString(const QString&)
  14. /usr/include/qt4/QtCore/qstring.h:106:5: note: QString::QString(QChar)
  15. /usr/include/qt4/QtCore/qstring.h:105:14: note: QString::QString(const QChar*)
  16. make: *** [tmp/dynamicSlider.o] Error 1
To copy to clipboard, switch view to plain text mode 


where the file looks like this:

Qt Code:
  1. void DynamicSlider::setPrefix( QString val )
  2. {
  3. prefix1 = val;
  4. prefix2 = QString( NULL );
  5. updateTooltipLabel();
  6. }
  7. //==========================================
  8. void DynamicSlider::setPrefixes( QString v1, QString v2 )
  9. {
  10. prefix1 = v1;
  11. prefix2 = v2;
  12. updateTooltipLabel();
  13. }
  14. //==========================================
  15. void DynamicSlider::setSuffix( QString val )
  16. {
  17. suffix1 = val;
  18. suffix2 = QString( NULL );
  19. updateTooltipLabel();
  20. }
To copy to clipboard, switch view to plain text mode 

and .h

Qt Code:
  1. ///set two prefix values, one for when the value is positive and one for when the value is negative.
  2. void setPrefixes( QString prefix1, QString prefix2 );
  3.  
  4. ///set the suffix that is displayed after the current slider value
  5. void setSuffix( QString val );
  6.  
  7. ///set two suffix values, one for when the value is positive and one for when the value is negative.
  8. 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