PDA

View Full Version : using native kde-dialogs



#andi#
9th August 2009, 14:33
I want to use native kde-dialogs, for example 'kdialog --getopenfilename $HOME'
or kprinter

The following code does not work:

QString fileName = QProcess::exectue("kdialog --getopenfilename $HOME");

error-message: invalid conversion from int to char......

How can I store the selected filename ?

Lykurg
9th August 2009, 15:28
You have to use something like that:

QProcess p;
p.start("kdialog", QStringList() << "--getopenfilename" << "$HOME");
p.waitForFinished();
qWarning() << p.readAllStandardOutput();
or better use the finished signal.

job
11th August 2009, 10:50
Or just link against kdelibs and use the API (http://api.kde.org/4.x-api/kdelibs-apidocs/kio/html/classKFileDialog.html).