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

List:       atlantik-devel
Subject:    [atlantik-devel] Re: [Issue N14793]  Unexpected behavior in QButton::setPixmap
From:       qt-bugs () trolltech ! com
Date:       2003-01-21 15:09:45
[Download RAW message or body]

Hi Rob,

On Tuesday, 21. Jan 2003 11:12 Rob Kaper wrote:

> Calling QButton::setPixmap() multiple times on the same object has
> some unexpected results. The button will show both images and gains
> height, instead of replacing the previous pixmap with the new one.
>
> Reproducable on several platforms and configurations. I can provide
> the specifics for mine later today (workstation is off-line at the
> moment, no wake-on-LAN).

I can't reproduce this problem here, can you try the following example
and see if it reproduces the problem for you?  Thanks.

#include <qapplication.h>
#include <qpushbutton.h>

const char *test1_xpm[] = {
    "12 8 2 1",
	". c None",
	"c c #ff0000",
	".........ccc",
	"........ccc.",
	".......ccc..",
	"ccc...ccc...",
	".ccc.ccc....",
	"..ccccc.....",
	"...ccc......",
	"....c.......",
};

const char *test2_xpm[] = {
    "12 8 2 1",
	". c None",
	"c c #ff0000",
	"ccc......ccc",
	".ccc....ccc.",
	"..ccc..ccc..",
	"....cc.cc...",
	".....ccc....",
	"....cc.cc...",
	"...ccc.ccc..",
	"..ccc...ccc.",
};

int main( int argc, char **argv )
{
    QApplication a( argc, argv );
    QPushButton testWidget( 0 );
    a.setMainWidget( &testWidget );
    testWidget.show();
    QPixmap p(test1_xpm);
    testWidget.setPixmap( p );
    QPixmap p2( test2_xpm );
    for ( int b = 0; b<5; b++ )
	testWidget.setPixmap( p2 );
    return a.exec();
}


If it doesn't reproduce your problem then can you modify the example so
it reproduces the problem for you?  Thanks.

Have a nice day!

Andy
--
Technicial Support Technician
Trolltech AS, Waldemar Thranes gate 98, NO-0175 Oslo, Norway

_______________________________________________
atlantik-devel mailing list
atlantik-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/atlantik-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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