Html[solved]
-
Have a look at
"Qdesktopservices":http://qt-project.org/doc/qt-5.0/qtgui/qdesktopservices.htmlIf your button is in MainWindow, use "this" as the third argument and
Connect to your slot (4th argument) btw, it is possible to connect using just 3 arguments
@
void MainWindow::yourSlot()
{
QDesktopServices::openUrl(QUrl(tr("qt-project.org")));
}
@Happy coding
-
@void MainWindow::on_pushButton_clicked()
{
QString link ="C:\Users\kouki\Desktop\versement.html";
QDesktopServices::openUrl(QUrl(link));
}@
thi is my code but there is an error (ShellExecute 'c:UserskoukiDesktopersement.html' failed (error 2).) and the html file does'nt open -
Hi,
Please don't use full uppercased sentences. It's considered as shouting and rude.
What JKSH suggested is to replace all backslashes in your path by forward slashes.
-
Please, turn off caps lock on your keyboard
-
Thanks for clarifying, SGaist.
Just in case, write:
@
QString link ="C:/Users/kouki/Desktop/versement.html";
@ -
You're welcome !
Maybe I can, but you should open a new thread for your new question and mark this one as solved by prepending [solved] to the title.
-
help me please i want to write in the body of this html file from qt so it means that i want to write in a textedit and by cliking on a button the html will be opned and the text that i wrote will be appear in this file i hope that you interstand what i mean because i know that's my English is very bad