Hi Florian, maybe there is a QLayout at work? It will always (re-)arrange its items to fit the layout's needs. Curt
________________________________ Von: [EMAIL PROTECTED] im Auftrag von Florian Hübner Gesendet: Mo 01.09.2008 14:53 An: [email protected] Betreff: [Qt-jambi-interest] QWidget.rect() problem Hi everyone, I have a problem with the size of a QWidget. Whenever its painted I try to set the correct size but for some reason it doesnt work. The following code: *********************************************************** protected void paintEvent(QPaintEvent e) { QPainter p = new QPainter(this); p.setRenderHint(QPainter.RenderHint.SmoothPixmapTransform); if (image_!=null) { System.out.println(image_.width()); System.out.println(image_.height()); System.out.println(rect().width()); System.out.println(rect().height()); rect().setWidth(image_.width()); rect().setHeight(image_.height()); System.out.println(rect().width()); System.out.println(rect().height()); } p.drawImage(rect(), image_); } ********************************************************** Delivers the following output: 992 907 365 364 365 364 For some reason it seems to ignore both set methods. Any ideas what could have went wrong? best regards Florian _______________________________________________ Qt-jambi-interest mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest _______________________________________________ Qt-jambi-interest mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
