Exécuter notepad.exe depuis un bouton
Bonjour,
Je suis sur QGIS et je cherche à intégrer un widget QML .
il s'agit d'un bouton permettant d'ouvrir notepad.
J'ai compris qu'il fallait faire appel à QProcess.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
import QtQuick 2.0
import QtQuick.Controls 1.0
from PySide import QtCore
Rectangle {
width: 80
height: 22
Button {
text: "Notepad"
onClicked:QString path = "C:\WINDOWS\system32/notepad.exe";
QStringList args = QStringList()<<"arg1"<<"arg2";
QtCore.QProcess::startDetached(path, args);
}
} |
ce dessus le code exploratoire. en effet je me doute que l'événement o,clicked ne fonctionne pas.
Peut être avez vous idée?