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. printer pdfformat cancel closes print preview window.
Qt 6.11 is out! See what's new in the release blog

printer pdfformat cancel closes print preview window.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.1k 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.
  • R Offline
    R Offline
    rafael
    wrote on last edited by
    #1

    I have a print preview dialog when i click on the print button it opens a dialog box and i can enter the file name of the pdf file. but when i press cancel it closes the dialog box and print preview window is this designed this way or a bug?

    QPrinter printer( QPrinter::HighResolution );
           printer.setOutputFormat(QPrinter::PdfFormat);
           printer.setOrientation( QPrinter::Portrait);
           printer.setPageMargins(QMarginsF(12.5, 12.5, 12.5, 12.5), QPageLayout::Millimeter);
    
           QPrintPreviewDialog  preview( &printer, this );
           connect( &preview, SIGNAL(paintRequested(QPrinter*)), SLOT(displayonly(QPrinter*)) );
           connect( &preview, SIGNAL(destroyed(QObject*)), SLOT(Change()));
           preview.exec();
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What does the Change slot do ?

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

      R 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        What does the Change slot do ?

        R Offline
        R Offline
        rafael
        wrote on last edited by
        #3

        @SGaist i have a tab widget and it just switches to it.

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

          Can you show the complete code you are using, including the call to your custom dialog to get the file path ?

          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

          • Login

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