PDA

View Full Version : Porting problem from Qt3 to Qt4



Krishnacins
19th May 2006, 14:23
Hi,
I'm using below function for playing .wav file......
This program is working with Qt3 (fedora c2)but its not working with Qt4 (fedora c2)

StartAlarm()
{
Q3Process *AlarmProcess;
AlarmProcess = new Q3Process (this);
AlarmProcess->setArguments("playwave"); // the player
if(rcCheckSound->isChecked() == 1)
AlarmProcess->addArgument(leFile->text() );
else
AlarmProcess->addArgument("1.wav");
AlarmProcess->start();
}

Its giving this ERROR with Qt4::

error: no matching function for call to `Q3Process::
setArguments(const char[10])'
/usr/local/Trolltech/Qt-4.1.2/include/Qt3Support/q3process.h:50: error: candidates
are: virtual void Q3Process::setArguments(const QStringList&)

Plz help me i didnt do much work with qt.....

Thanks
Krishna

jpn
19th May 2006, 14:27
Try:

#include <QStringList>
AlarmProcess->setArguments(QStringList() << "playwave"); // the player

mcosta
19th May 2006, 14:29
Hi,

This program is working with Qt3 (fedora c2)but its not working with Qt4 (fedora c2)

StartAlarm()
{
Q3Process *AlarmProcess;
AlarmProcess = new Q3Process (this);
AlarmProcess->setArguments("playwave"); // the player
if(rcCheckSound->isChecked() == 1)
AlarmProcess->addArgument(leFile->text() );
else
AlarmProcess->addArgument("1.wav");
AlarmProcess->start();
}

Plz help me i didnt do much work with qt.....

Thanks
Krishna

????????????????????

Q3Process, like QProcess in Qt3.x don't have a member



setArguments(const QString&)


but have



setArguments(const QStringList&)
addArgument(const QString&)




This code really compile and work with QT3?????