Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Html[solved]
Forum Updated to NodeBB v4.3 + New Features

Html[solved]

Scheduled Pinned Locked Moved General and Desktop
16 Posts 4 Posters 3.7k 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.
  • Y Offline
    Y Offline
    yakine
    wrote on last edited by
    #1

    hello
    i want to open anhtml file wich i create by clicking on a qpushbutton but i d'ont know how ?
    i tried to use this :QObject::connect(bouton,signal(clicked()),?,?)
    but what can i make in the lasts arguments

    IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      yakine
      wrote on last edited by
      #2

      what slot can i use and what ptr

      IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

      1 Reply Last reply
      0
      • 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
        • Y Offline
          Y Offline
          yakine
          wrote on last edited by
          #4

          thank you eddy i will try

          IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

          1 Reply Last reply
          0
          • Y Offline
            Y Offline
            yakine
            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

            IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

            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
              • Y Offline
                Y Offline
                yakine
                wrote on last edited by
                #7

                WHAT I SUPPOSED TO DO PLEASE TELL ME

                IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

                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
                  • Y Offline
                    Y Offline
                    yakine
                    wrote on last edited by
                    #9

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

                    IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

                    1 Reply Last reply
                    0
                    • Y Offline
                      Y Offline
                      yakine
                      wrote on last edited by
                      #10

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

                      IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

                      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
                          • Y Offline
                            Y Offline
                            yakine
                            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

                            IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

                            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
                              • Y Offline
                                Y Offline
                                yakine
                                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

                                IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

                                1 Reply Last reply
                                0
                                • Y Offline
                                  Y Offline
                                  yakine
                                  wrote on last edited by
                                  #16

                                  ok i will do

                                  IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

                                  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 Extensions
                                  • Unsolved