Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
QT and bitBlt
Results 1 to 4 of 4

Thread: QT and bitBlt

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Posts
    280

    QT and bitBlt

    I'm trying to write a program via a tutorial (similar to this one)about QT and we are using the bitBlt function to paint the window events. *The resize event calls bitBlt:
    Code:
    bitBlt (&_buffer, 0, 0, &save);
    Where [tt]_buffer[/tt] and [tt]save[/tt] are QPixmaps that hold the information we want to draw on the screen.

    Then for the main paint event, we want to paint the buffer onto the window (a simple QWidget):
    Code:
    // inside the paintEvent:
    bitBlt (this, 0, 0, &_buffer);
    but I get an odd error from this line when I try to compile this"
    $ g++ -I$QTDIR/include -L$QTDIR/lib -lqt-mt -o qtscribble1 qtscribble1.cpp
    qtscribble1.cpp: In method `void ScribbleWindow:aintEvent (QPaintEvent *)':
    qtscribble1.cpp:77: no match for `int & QPixmap &'
    Any ideas on what the problem is? *It says there is no match, but

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Posts
    280

    Re: QT and bitBlt

    Woah, everyone! *I don't have time to keep up with all the replies!






    Anyway, I replaced that function:

    WAS:
    Code:
    void ScribbleWindow::paintEvent (QPaintEvent* event){
     * * *// copy the image from the buffer pixmap to the window
     * * *bitBlt (this, 0, 0 &_buffer );
    }
    IS:
    Code:
    void ScribbleWindow::paintEvent (QPaintEvent* event){
     * * *// copy the image from the buffer pixmap to the window
     * * *QPainter p;
     * * *p.begin (this);
     * * *p.drawPixmap (0, 0, _buffer);
     * * *p.end();
    }
    The second one works, but it is suppose to be much slower than the first one. * The really odd part is this function:
    Code:
    void ScribbleArea::slotClearArea (){
    
     * * *_buffer.fill (white);
     * * *bitBlt (this, 0, 0, &_buffer);
    }
    This function compiles and works just fine! *What is the difference between this and the one above that doesn't work?

  3. #3

    Re: QT and bitBlt

    In the first call to bitBlt, it says,
    bitBlt(this, 0, 0 &_buffer),
    the second one has a comma between 0 and &_buffer.

    Is this just a typo you made here? *It would certainly account for the odd compilation error, though.

  4. #4
    Senior Member
    Join Date
    Jul 2001
    Posts
    280

    Re: QT and bitBlt


    In the first call to bitBlt, it says,
    bitBlt(this, 0, 0 &_buffer),
    the second one has a comma between 0 and &_buffer.

    Is this just a typo you made here? *It would certainly account for the odd compilation error, though.
    <embarrassed>Yes, that was the problem. </embarrassed>

    Thanks. I was so hung up on the error message that I wasn't even looking at that

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
  •