Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Spanish
  4. QPdfWriter
Forum Update on Monday, May 27th 2025

QPdfWriter

Scheduled Pinned Locked Moved Solved Spanish
2 Posts 2 Posters 507 Views
  • 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.
  • C Offline
    C Offline
    Casino
    wrote on last edited by
    #1

    Pasa lo siguiente: ejecuto el proyecto y me crea el archivo pdf, pero cuando hago y ejecuto la aplicación, el archivo pdf no se crea
    este es mi código
    #include "QPdfWriter"
    #include "QPainter"

    void MainWindow::on_actionImprimir_triggered()
    {
    int i, h;

        QPdfWriter pdf("ruleta.pdf");
    
        QPainter painter(&pdf);
    
        painter.setPen(Qt::black);
        painter.setFont(QFont("Times", 18));
        painter.drawText(3000,600,"TORNEO DE RULETA");
        painter.setFont(QFont("Times", 11));
        painter.drawText(1000,1300, "NOMBRE");
        painter.drawText(4000,1300, "MONTO");
        painter.drawText(7000,1300,"RECOMPRA");
        painter.setFont(QFont("Times", 10));
    
        h = 1700;
        i = 0;
    
        do{
           painter.drawText(1000,h,ui->Jugadores->item(i,0)->text());
           painter.drawText(4000,h,ui->Jugadores->item(i,1)->text());
           painter.drawText(7000,h,ui->Jugadores->item(i,2)->text());
           i++;
           h = h + 400;
        }while (i <= 9);
    
        painter.end();
    

    }
    Alguna solución????Gracias

    eyllanescE 1 Reply Last reply
    0
    • C Casino

      Pasa lo siguiente: ejecuto el proyecto y me crea el archivo pdf, pero cuando hago y ejecuto la aplicación, el archivo pdf no se crea
      este es mi código
      #include "QPdfWriter"
      #include "QPainter"

      void MainWindow::on_actionImprimir_triggered()
      {
      int i, h;

          QPdfWriter pdf("ruleta.pdf");
      
          QPainter painter(&pdf);
      
          painter.setPen(Qt::black);
          painter.setFont(QFont("Times", 18));
          painter.drawText(3000,600,"TORNEO DE RULETA");
          painter.setFont(QFont("Times", 11));
          painter.drawText(1000,1300, "NOMBRE");
          painter.drawText(4000,1300, "MONTO");
          painter.drawText(7000,1300,"RECOMPRA");
          painter.setFont(QFont("Times", 10));
      
          h = 1700;
          i = 0;
      
          do{
             painter.drawText(1000,h,ui->Jugadores->item(i,0)->text());
             painter.drawText(4000,h,ui->Jugadores->item(i,1)->text());
             painter.drawText(7000,h,ui->Jugadores->item(i,2)->text());
             i++;
             h = h + 400;
          }while (i <= 9);
      
          painter.end();
      

      }
      Alguna solución????Gracias

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @Casino No entiendo tu frase: ejecuto el proyecto y me crea el archivo pdf, pero cuando hago y ejecuto la aplicación, el archivo pdf no se crea

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      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