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. Preview forms before saving into database
Forum Updated to NodeBB v4.3 + New Features

Preview forms before saving into database

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 586 Views 2 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.
  • L Offline
    L Offline
    LT-K101
    wrote on last edited by
    #1

    Hi, I have two windows . I want to preview the entry made before saving. Any documentation or library that could make this possible? Thanks in advance

    jsulmJ 1 Reply Last reply
    0
    • L LT-K101

      Hi, I have two windows . I want to preview the entry made before saving. Any documentation or library that could make this possible? Thanks in advance

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @LT-K101 said in Preview forms before saving into database:

      I want to preview the entry made before saving

      Please explain better: what kind of preview? PDF?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      L 1 Reply Last reply
      1
      • jsulmJ jsulm

        @LT-K101 said in Preview forms before saving into database:

        I want to preview the entry made before saving

        Please explain better: what kind of preview? PDF?

        L Offline
        L Offline
        LT-K101
        wrote on last edited by
        #3

        @jsulm I would like to preview all entry I have made before i click on the submit Button and if possible print all entries as it is. Below is the image of my window.

        Screenshot 2021-11-10 134215.png

        jsulmJ 1 Reply Last reply
        0
        • L LT-K101

          @jsulm I would like to preview all entry I have made before i click on the submit Button and if possible print all entries as it is. Below is the image of my window.

          Screenshot 2021-11-10 134215.png

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @LT-K101 I still don't understand. In what way "preview"?
          The entries you made are already shown in the UI or not?

          "and if possible print all entries as it is" - print on a printer?

          Please explain better...

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          L 1 Reply Last reply
          0
          • jsulmJ jsulm

            @LT-K101 I still don't understand. In what way "preview"?
            The entries you made are already shown in the UI or not?

            "and if possible print all entries as it is" - print on a printer?

            Please explain better...

            L Offline
            L Offline
            LT-K101
            wrote on last edited by
            #5

            @jsulm You're right . All entries are already in UI and I would want to print on a printer but before I print, I should see what I'm about to print.

            artwawA 1 Reply Last reply
            0
            • L LT-K101

              @jsulm You're right . All entries are already in UI and I would want to print on a printer but before I print, I should see what I'm about to print.

              artwawA Offline
              artwawA Offline
              artwaw
              wrote on last edited by artwaw
              #6

              @LT-K101 Then, well, print? The easiest way for you to go about, I think, would be:

              • gather everything in the textual form in one QString;
              • use QTextEdit on QDialog to display to data from the QString using QTextDocument and allow the user to accept/decline;
              • if user accepts, create QPrinter and use QTextDocument::print().

              All the classes are well documented. Of course, you can fiddle around with rich text (rich text in Qt is well documented too), printer selection and options and what not.

              EDIT: since it might be unclear - the QTextDocument is not necessary here but using it saves all the work with rendering text, as the print() method takes care of laying out the text, page breaks, etc.

              For more information please re-read.

              Kind Regards,
              Artur

              L 1 Reply Last reply
              0
              • artwawA artwaw

                @LT-K101 Then, well, print? The easiest way for you to go about, I think, would be:

                • gather everything in the textual form in one QString;
                • use QTextEdit on QDialog to display to data from the QString using QTextDocument and allow the user to accept/decline;
                • if user accepts, create QPrinter and use QTextDocument::print().

                All the classes are well documented. Of course, you can fiddle around with rich text (rich text in Qt is well documented too), printer selection and options and what not.

                EDIT: since it might be unclear - the QTextDocument is not necessary here but using it saves all the work with rendering text, as the print() method takes care of laying out the text, page breaks, etc.

                L Offline
                L Offline
                LT-K101
                wrote on last edited by
                #7

                @artwaw Thanks for your response. I will try my hands on it.

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

                  Hi,

                  QPrintPreviewDialog can be used before you start inking paper for your tests.

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

                  L 1 Reply Last reply
                  1
                  • SGaistS SGaist

                    Hi,

                    QPrintPreviewDialog can be used before you start inking paper for your tests.

                    L Offline
                    L Offline
                    LT-K101
                    wrote on last edited by
                    #9

                    @SGaist thanks

                    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