Results 1 to 8 of 8

Thread: grabeWidget & QTabWidget problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2007
    Posts
    5
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Windows

    Question grabeWidget & QTabWidget problem

    Hello, guys,

    Very glad to be here. This is my first post.

    I recently have a problem with saving my application interface (some X-Y charts) to PNG files using QPixmap::grabWidget and QTabWidget. My chart is drawn on a QwtPlot object in the pages of a QTabWidget object. And I have 9 pages totally. I want each single page be saved automatically to a PNG file for later review (no button press, mouse click etc.). The files are saved, but some components of the chart are missing (looks like the chart is not done yet, so I put Sleep(500) in there). I tried grabWindow(), but since the pages of the QTabWidget are not visible at this moment of time, so I can not get what I want. I am using QT 3.3.6 and Qwt 4.2 and MSVS 2005.

    I attach some of my codes, hope someone can help me out. Thanks in advance.

    for(int i = 8; i>=0; i--)
    {
    s_tab_view->setCurrentPage(i); // s_tab_view: QTabView
    QPixmap peakPixmap;
    QString pixMapFileName = "C:\\pinPostDoc\\" + dateQString + "_" +
    s_tab_view->label(i).remove('&') + ".png";
    Sleep(500);
    peakPixmap = QPixmap::grabWidget(s_tab_view, 0, 0, -1, -1);
    beakPixmap.save(pixMapFileName, "PNG");
    }
    Last edited by conglu; 20th April 2007 at 18:01.

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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
  •  
Qt is a trademark of The Qt Company.