Results 1 to 1 of 1

Thread: Printing a QTable

  1. #1
    Join Date
    Apr 2008
    Posts
    1
    Qt products
    Qt3
    Platforms
    Windows

    Default Printing a QTable

    Hi,
    I am trying print a Qtable. Using the grabwidget way seems inadequate as the image is very small and If the table has scrollbars then the image includes the scrollbars and shows only the visible table area. Looks like it works similar to printscreen.
    Is there any other way to print a QTable?
    Any Suggestions will be appreciated.

    current code:
    Qt Code:
    1. QPrinter aprinter( QPrinter::HighResolution );
    2. aprinter.setFullPage( TRUE );
    3. if(aprinter.setup(this)
    4. {
    5. QTable* thetable = theApp->theTable;
    6. QPixmap pixmap = QPixmap::grabWidget(thetable);
    7. p.begin(&aprinter);
    8. p.drawPixmap(0,0,pixmap);
    9. p.end();
    10. }
    To copy to clipboard, switch view to plain text mode 

    Thanks,
    Last edited by jpn; 3rd April 2008 at 06:29. Reason: missing [code] tags

Similar Threads

  1. Searching a QTable
    By nategoofs in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 22:15
  2. Printing problem in windows
    By joseph in forum Qt Programming
    Replies: 6
    Last Post: 12th July 2007, 08:04
  3. Replies: 0
    Last Post: 28th June 2006, 20:49
  4. Problem with QTable
    By zlatko in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2006, 10:00
  5. QTable..Vs.. QListView
    By :db:sStrong in forum Qt Programming
    Replies: 1
    Last Post: 15th February 2006, 21:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.