Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Html[solved]
Qt 6.12 LTS is out! See what's new in the release blog

Html[solved]

Scheduled Pinned Locked Moved General and Desktop
16 Posts 4 Posters 4.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • EddyE Offline
    EddyE Offline
    Eddy
    wrote on last edited by
    #3

    Have a look at
    "Qdesktopservices":http://qt-project.org/doc/qt-5.0/qtgui/qdesktopservices.html

    If 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

    Qt Certified Specialist
    www.edalsolutions.be

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #4

      thank you eddy i will try

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #5

        @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

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #6

          [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";@

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #7

            WHAT I SUPPOSED TO DO PLEASE TELL ME

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #8

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #9

                I WANT TO OPEN AN HTML FILE THAT I CREATE AND I SAVED ON MY DESKTOP

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #10

                  OK THANK YOU AM SORRY BUT AN NOT A GOOD SPEAKER IN ENGLISH OK SORRY

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #11

                    Please, turn off caps lock on your keyboard

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • JKSHJ Offline
                      JKSHJ Offline
                      JKSH
                      Moderators
                      wrote on last edited by
                      #12

                      Thanks for clarifying, SGaist.

                      Just in case, write:
                      @
                      QString link ="C:/Users/kouki/Desktop/versement.html";
                      @

                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                      1 Reply Last reply
                      0
                      • ? Offline
                        ? Offline
                        A Former User
                        wrote on last edited by
                        #13

                        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

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #14

                          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.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • ? Offline
                            ? Offline
                            A Former User
                            wrote on last edited by
                            #15

                            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

                            1 Reply Last reply
                            0
                            • ? Offline
                              ? Offline
                              A Former User
                              wrote on last edited by
                              #16

                              ok i will do

                              1 Reply Last reply
                              0

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt
                              • Unsolved