Results 1 to 2 of 2

Thread: Export widget to bmp

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Posts
    28
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3

    Default Export widget to bmp

    Hi, i have a widget and i paint some items like line, picture, rect, ...
    Qt Code:
    1. class TCanvas : public QWidget
    2. {
    3. Q_OBJECT
    4.  
    5. protected:
    6. void paintEvent(QPaintEvent *event);
    7. }
    To copy to clipboard, switch view to plain text mode 
    i use painter to paint and i do not know how i can save what i drew.. somethink like :
    painter->saveToFile.. or widget->savetofile...
    please can you help me...

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Export widget to bmp

    do you need to save whole widget content?
    use QWidget::grabWidget and then use QPixmap::save with format=BMP.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. Remove widget from a QList
    By Eos Pengwern in forum Newbie
    Replies: 4
    Last Post: 16th October 2009, 21:25
  3. Playbutton functionality
    By uchennaanyanwu in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2008, 22:29
  4. How to Open & Close a Widget ?!!
    By Fatla in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2008, 20:39
  5. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35

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.