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. QPrintDialog preview on Windows
Forum Updated to NodeBB v4.3 + New Features

QPrintDialog preview on Windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 2.1k 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.
  • Z Offline
    Z Offline
    ZNohre
    wrote on last edited by
    #1

    Is there a way to have a document generate a preview in the native Windows print dialog?

    I'm printing some basic text/table reports from an SQL database via the QTextDocument method found on this thread: https://forum.qt.io/topic/91015/export-qtableview-to-pdf

    3bd82772-31a5-470d-8c77-7637446fe487-image.png

    Pl45m4P 1 Reply Last reply
    0
    • Z ZNohre

      Is there a way to have a document generate a preview in the native Windows print dialog?

      I'm printing some basic text/table reports from an SQL database via the QTextDocument method found on this thread: https://forum.qt.io/topic/91015/export-qtableview-to-pdf

      3bd82772-31a5-470d-8c77-7637446fe487-image.png

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @ZNohre

      Maybe this helps:

      • https://doc.qt.io/qt-6/qprintpreviewdialog.html

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      Z 1 Reply Last reply
      0
      • Pl45m4P Pl45m4

        @ZNohre

        Maybe this helps:

        • https://doc.qt.io/qt-6/qprintpreviewdialog.html
        Z Offline
        Z Offline
        ZNohre
        wrote on last edited by ZNohre
        #3

        @Pl45m4 Thanks for the reply.

        QPrintPreviewDialog seems redundant based on my testing. For example, the page orientation selected on the preview dialog does not get passed to to the native Windows print dialog. The "print" toolbar button also brings up the native Windows print dialog with preview anyway. Because of this, I was hoping there was a Windows API that someone else had found similar to the paintRequested signal of QPrintPreviewDialog that would allow the preview to be directly shown on the QPrintDialog.

        https://doc.qt.io/qt-6/qprintpreviewdialog.html#paintRequested

        b424b96e-3295-41f6-8e74-c1b3887651c7-image.png

        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