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. Qt 5.3.2, QPrintDialog and Microsoft XPS Writer
Qt 6.11 is out! See what's new in the release blog

Qt 5.3.2, QPrintDialog and Microsoft XPS Writer

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 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.
  • D Offline
    D Offline
    dlodyakov
    wrote on last edited by
    #1

    Hi. I'm trying to print some page into some .xsp file. And I have error. I don't have normal printer. But when I'm tryig to print into some .pdf file with only Qt it works.

    @printer = new QPrinter();
    QPainter painter(printer);
    printer->setOutputFileName("C:\output.pdf");@

    But when I'm trying not to set file name and open XPS Writer, dialog where you can choose file name doesn't appear

    @QPrintDialog dlg(parent);

    if(dlg.exec() == QDialog::Accepted) {
    printer = dlg.printer();
    }
    else {
    return;
    }
    QPainter painter(printer);@

    And I have error here (C:\Qt\qt-5.3.2-openSSL\qt-everywhere-opensource-src-5.3.2\qtbase\src\gui\painting)
    @
    bool QPainterPrivate::attachPainterPrivate(QPainter *q, QPaintDevice *pdev)
    {
    Q_ASSERT(q);
    Q_ASSERT(pdev);

    QPainter *sp = pdev->sharedPainter();@
    

    Why is so? What shall I do? Show some Save To dialog? Or this is bug?

    Thank 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