thanks you, but i dont fully understand, my english is sad :s
i have make this :
QString MainWindow
::on_Browse_clicked() {
QMessageBox::information(this,
"Tipie launcher",
"Vous avez sélectionné :\n" + fichier
);
QDir dir
= fileInfo.
dir();
// Dossier du fichier QString dirPath
= fileInfo.
filePath();
// Path vers le fichier QString fileName
= fileInfo.
fileName();
// Nom du fichier (sans le path) ui->lineEdit->setText(dirPath);
localtiondebol = dirPath;
return localtiondebol;
}
QString MainWindow::on_Browse_clicked()
{
QString localtiondebol;
QString fichier = QFileDialog::getOpenFileName(this, "Ouvrir un fichier", QString(), "Exe (*.exe)");
QMessageBox::information(this, "Tipie launcher", "Vous avez sélectionné :\n" + fichier);
QFileInfo fileInfo(fichier);
QDir dir = fileInfo.dir(); // Dossier du fichier
QString dirPath = fileInfo.filePath(); // Path vers le fichier
QString fileName = fileInfo.fileName(); // Nom du fichier (sans le path)
ui->lineEdit->setText(dirPath);
localtiondebol = dirPath;
return localtiondebol;
}
To copy to clipboard, switch view to plain text mode
my variable localtiondebol = the acess at the .exe, but i dont know how i can use "locationdebol" variable in my other function :
void MainWindow::on_start_clicked()
{
localtiondebol = on_Browse_clicked();
ui->lineEdit_3->setText(localtiondebol);
}
void MainWindow::on_start_clicked()
{
QString localtiondebol;
localtiondebol = on_Browse_clicked();
ui->lineEdit_3->setText(localtiondebol);
QDesktopServices::openUrl(QUrl(localtiondebol,QUrl::TolerantMode));
}
To copy to clipboard, switch view to plain text mode
i have try this
localtiondebol = on_Browse_clicked();
localtiondebol = on_Browse_clicked();
To copy to clipboard, switch view to plain text mode
but its dont work
Bookmarks