Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QPainter is not active error.works fine on desktop but gives error in embedded device.
Qt 6.11 is out! See what's new in the release blog

QPainter is not active error.works fine on desktop but gives error in embedded device.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 830 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.
  • Akshay SinghA Offline
    Akshay SinghA Offline
    Akshay Singh
    wrote on last edited by
    #1

    So I implemented this test code to print some text using ubuntu based desktop. It worked fine in there. But same code when Implemented in the machine , it gives an error that QPainter is not active. Pls help.

    QPrinter printer;
    
    //            printer.setOutputFormat(QPrinter::PdfFormat);
    //            printer.setOutputFileName("writable.pdf");
              QPainter painter;
               if (! painter.begin(&printer)) { // failed to open file
                   qWarning("failed to open file, is it writable?");
                   return 0;
               }
              painter.drawText(00, 80, "Testing the automaization of this printer");
    
               painter.drawText(00, 100, "Test 2");
               QString str="Pdf is ready============== to print";
    
               painter.drawText(40,80,str);
    
    
               painter.end();
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Please give more details about your desktop and embedded device.

      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