[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-java
Subject:    Re: [Kde-java] Javalib on Windows
From:       Richard Dale <Richard_Dale () tipitina ! demon ! co ! uk>
Date:       2001-08-23 13:59:38
[Download RAW message or body]

On Wed, 22 Aug 2001, jansdal@it.dk wrote:
> 2. When I run the ScribbleWindow program I get an 
> assertion:
> ASSERT: "src_dc && dst_dc" in C:\Home\andy\qt\2.3\src\
> kernel\qpaintdevice_win.cpp (311)
> I have no ideas what this problem is about since I don't 
> have the source code for qpaintdevice_win.cpp.
I've think I've tracked down what's causing this. It isn't a bug in the Qt Java
bindings, but a bug in the Qt Scribble app:

protected void resizeEvent(QResizeEvent event) {
    QPixmap save = new QPixmap( _buffer );
    if (_buffer.isNull()) {
        System.out.println("_buffer is null");
    } else {
        System.out.println("_buffer is not null");
    }
    if (save.isNull()) {
        System.out.println("save is null");
    } else {
        System.out.println("save is not null");
    }
    _buffer.resize( event.size() );
    _buffer.fill( white() );
    QPaintDevice.bitBlt( _buffer, 0, 0, save );
}

When the event handler is called _buffer.isNull() is true, as the buffer has
just been allocated, but not yet written to. A copy of _buffer is taken, and
placed in save, which is null. Then the _buffer.resize() and _buffer.fill()
calls update the contents of _buffer, and it is then non-null. But when save is
passed to bitBlt(), it is still null.

If you pass a null QPixmap to bitBlt():
	- On Linux nothings happens, it is silently ignored
	- On Windows there is an assertion failure as above
	- On Mac OS X, the scribble app crashes with a seg fault

-- Richard
	
_______________________________________________
Kde-java mailing list
Kde-java@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-java

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic