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

List:       kde-devel
Subject:    Re: A small bug in almost every KDE app...
From:       Adriaan de Groot <adridg () cs ! kun ! nl>
Date:       2004-07-13 6:23:45
Message-ID: 200407130823.46124.adridg () cs ! kun ! nl
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 13 July 2004 06:23, Benjamin Meyer wrote:
> Spent the evening tracking down a ktron issue and found all sorts of fun
> side issues that probably effect most kde apps.  I wrote the full fun story
> here to let other developers know how to fix the problem in there own
> applications:
>
> http://www.kdedevelopers.org/node/view/511

Since the blog entry is rather long-winded, I'll post the summary here:

===
- -Remove hard coded resize() calls in the constructor or main, they should be 
removed in favor of letting the automatic resizing determine the default 
window size. 
 -Put the setupGUI() call after all widgets have been created and placed 
inside the main window (i.e. for 99% of apps setCentralWidget()) 
 -Widgets that inherit from QWidget (like game boards) should overload 
"virtual QSize sizeHint() const;" to specify a default size. 
 
 Finally to test to make sure it is working; simply delete the applications 
config file, launch the app, exit it, and if the config file exists it 
shouldn't contain the width/height entries if everything is working. 
===

Of these, the second (setupGUI()) is probably most important, since it allows 
the layout engine to take all the widgets and all the styles, font sizes, and 
whatnot into account for determining the default size (ie. the size that 
won't be saved to the config file if the app happens to retain that size). It 
may be tricky to apply this technique and Zack's delayed initialization at 
the same time.


- -- 
   "On top of that [watching KDE CVS] is interesting in a perverse 
    way, like watching sausage get made. By very smart people." - dkite
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFA83/ydqzuAf6io/4RAozcAJ9nvDIGJFhudliJTumL0wudIkXJrQCfQ+Zq
50tLxFwgefeSErxkntfhW7c=
=346s
-----END PGP SIGNATURE-----
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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