PDA

View Full Version : Qprocess question



connect_qt
9th December 2011, 17:20
I'm new to QT programming.

I'm creating an interface that consists of few buttons.
One of the button will used to call another program once event of clicked is activated.
I want to call program "Blender.exe", any sample/tutorial?

I tried this, but failed:
void MainWindow::on_pb_blender_clicked()
{
QString program = "C:/Program Files/Blender Foundation/Blender/time1.txt";
QProcess *myProcess = new QProcess(this);
myProcess->start(program);
}

This is the first problem.




Then after this button had been clicked, the program will start.
Now I want link a button inside my interface to a button inside the "Blender" program.
How could I do this? Is it possible?
Thanks

Spitfire
9th December 2011, 17:32
You're trying to open txt file, no wonder it doesn't do what you want :)

This is what you want:

QProcess* prc = new QProcess(this);
prc->start( "C:\\Windows\\system32\\notepad.exe" );

As to linking button from your app to button inside Blender app, AFAIK it's impossible.

ps. use [code] tags.