QFormLayout and consistency in systemsettings kcm modules

Jacopo De Simoi wilderkde at gmail.com
Fri Jul 31 23:52:58 BST 2009

Hi everybody

I noticed that almost all kcm modules use QVBoxLayouts for laying out our beloved configuration widgets. the "almost" there is due to (at least) the following exceptions:

kdebase/workspace/kcontrol $ ack QFormLayout
35:#include <QFormLayout>
51:     QFormLayout *fl = new QFormLayout( box );
74:     fl = new QFormLayout( box );
107:    fl = new QFormLayout( box );

input/mouse.cpp     //---- Advanced tab
51:#include <QFormLayout>
201:    QFormLayout *lay = new QFormLayout(advancedTab);
322:  QFormLayout *form = new QFormLayout();

style/kcmstyle.cpp  //---- Fine Tuning tab
46:#include <QtGui/QFormLayout>
232:    QFormLayout* page2Layout = new QFormLayout( page2 );

fonts/fonts.cpp //----- Subpixel configuration
25:#include <QFormLayout>
231:  QFormLayout *layout=new QFormLayout(mw);

In fact if you pay attention, the layout in each of the preceding cases is slightly different from the other cases. In particular the vertical alignment of the label with respect to the widget on its right is messed up; the text fields do not align correctly, they are a few pixels off, it seems that the label and the widget are Top aligned...
At first I thought it was some issue with the qt-style I am hacking with, but the problem indeed is visible in all qt styles. 
Is there any clever flag to can pass the QFormLayout to make it align stuff consistenly with the other layouts? Otherwise, does anybody have any objections if I turn all QFormLayout to QVBoxLayout? luckily they are not that many and the other way it looks much better. 



More information about the kde-core-devel mailing list