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
-
thank you eddy i will try
-
@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 -
[quote author="yakine" date="1395351393"]
@
QString link ="C:\Users\kouki\Desktop\versement.html";
@
[/quote]Hi,Qt uses '/' as the path separator on all platforms.
EDIT: Write
@QString link ="C:/Users/kouki/Desktop/versement.html";@ -
WHAT I SUPPOSED TO DO PLEASE TELL ME
-
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.
-
I WANT TO OPEN AN HTML FILE THAT I CREATE AND I SAVED ON MY DESKTOP
-
OK THANK YOU AM SORRY BUT AN NOT A GOOD SPEAKER IN ENGLISH OK SORRY
-
Please, turn off caps lock on your keyboard
-
Thanks for clarifying, SGaist.
Just in case, write:
@
QString link ="C:/Users/kouki/Desktop/versement.html";
@ -
THANK YOU A LOT JKSH (finally it's work)and SGaist am really sorry for my sentences i have an other question if you can help me please
-
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
-
ok i will do