Results 1 to 16 of 16

Thread: in porting Qt3 to Qt4, problem with bitBlt

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #15
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: in porting Qt3 to Qt4, problem with bitBlt

    I think it should be something like

    Qt Code:
    1. DrawingFunctions::paintEvent( QPaintEvent* event)
    2. {
    3. QPainter painter(this);
    4. painter.drawLine( xs, ys, xe, ye );
    5. }
    To copy to clipboard, switch view to plain text mode 

    The points are calculated somewhere else and on every piantEvent the line is drawn. If you are not able to see the line then check if the co-ordiantes are negative or beyond the widget's size.

    I think the buffer part i.e.

    Qt Code:
    1. QPainter p( drawings ); /// set drawing pixmap
    2. QPainter b( buffer ) ;
    To copy to clipboard, switch view to plain text mode 

    is not needed since from Qt 4.0, QWidget automatically double-buffers its painting, so there's no need to write double-buffering code in paintEvent() to avoid flicker.

    I think you can first try out painting examples that come with Qt to get a better picture of the whole thing.

  2. The following user says thank you to munna for this useful post:

    impeteperry (23rd June 2006)

Similar Threads

  1. Problem in porting Main window on linux
    By jyoti kumar in forum Qt Tools
    Replies: 2
    Last Post: 2nd June 2006, 08:35
  2. problem of porting from windows to linux
    By jyoti kumar in forum Qt Programming
    Replies: 4
    Last Post: 22nd May 2006, 08:42
  3. Porting problem from Qt3 to Qt4
    By Krishnacins in forum Qt Programming
    Replies: 2
    Last Post: 19th May 2006, 14:29
  4. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  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.