Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Print Widget on Qt Creator
Forum Updated to NodeBB v4.3 + New Features

Print Widget on Qt Creator

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 2.3k 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.
  • F Offline
    F Offline
    FredjBahloul
    wrote on last edited by
    #1

    Hi,
    I want to know is there any code to use on Qt to print my widget application because i tried many solutions but no one worked with me.
    And Thanks.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      marstay
      wrote on last edited by
      #2

      Pleasse explain a little bit more what do you want exactly. For example there is a library called haruPdf that might help you to print your app as pdf but I don't know if this is what you want.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        FredjBahloul
        wrote on last edited by
        #3

        Thank u marstay i finally fix my problem using QPrinter and QPrinterDialog :)
        here is the code :
        QPrinter *printer = new QPrinter;
        QPrintDialog *printDialog = new QPrintDialog(printer, this);
        if (printDialog->exec() == QDialog::Accepted) {
        QPainter p(printer);
        QPixmap pm = QPixmap::grabWidget(this);
        p.drawPixmap(0, 0, pm);
        }

        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