how to destroy the QQuickview and call a process in pi
-
hi all...one doubt how to destroy the Qquickview and call a process
-
void fn()
{
view->destroy();
QProcess *myProcess = new QProcess();
myProcess->start(".exe");
}above is the code...view is not destroying
-
@karti-gesar
As per this http://doc.qt.io/qt-5/qquickview.html#QQuickView-1
You should delete a engine before you delete view ? -
hmm
// create
QQuickView * myvar= new QQuickView();
//destroy
delete myvar;//
myProcess->start(".exe"); ???myProcess->start("/full/path/to/thefile.exe");
Please see
http://stackoverflow.com/questions/2622864/start-a-process-using-qprocess
Also, note how to pass parameters and that " " spaces must be handled on windows. -
when i put like this
void fn()
{
view.destroy();
}
this works fine background operation also deleteing..
but how to call process .. -
- "but how to call process .."
QProcess *process = new QProcess(this);
QString program = "explorer.exe"; // the program. for some programs. FULL PATH must be used
QString folder = "C:\"; // parameters
process->start(program, QStringList() << folder);// Note
at some point u need to do
delete process ; -
if i used that view is not destroying
-
use QQuickview to call a qml.....have a image in a qml ....if u press any key in qml i.e.,in image ..that view should be destroyed...you want to display a dialog in qt with a button..for that qprocess is used to call...dialog .exe
suppose when a dialog is opened..if you clicked the button again you want to call the qml i.e.,that image in qml..like that viceversa
-
- if i used that view is not destroying
Well you can use
http://doc.qt.io/qt-5/qprocess.html#startDetached
to have it not block.
-
i will try it
-
using destructor i deleted the process
-
Ok. should be fine then.