On Wednesday 13 July 2011 (12:47:23) Christopher Reichert wrote: > > In the first tab I see two issues: > > The first is, that the LineEdit for the directory is a little to short. > > I > > think, it would be nicer to be as long as the surrounding GroupBox. > > The second is, that the space before and after the QLabel "Additional > > options passed to tar:" is huge. That should be a lot smaller and the > > big gab should be below the subsequent LineEdit at the bottom. > > The same issue is on the second tab with the QLabel named "Output". > > > > My question now: What is the best way of solving these issues? > > > > I guess, I do not have to mention, that hard coding width and height of > > the objects is not an option. > > As far as I can tell you need to set the size policy for the widgets > that you wish to be longer (or shorter). > http://doc.qt.nokia.com/latest/qwidget.html#sizePolicy-prop
Thank you for this hint. Applying it as follows to a QLabel works fine: initRunOutputLabel = new QLabel(i18nc("", "Output:"), initRun); QSizePolicy *vexp = new QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); initRunOutputLabel->setSizePolicy(vexp->horizontalPolicy(), vexp- >verticalPolicy()); However, applying it to the KUrlRequester, does not work: selectDestinationDir = new KUrlRequester(destinationDirGroup); selectDestinationDir->setMode(KFile::Directory); QSizePolicy *hexp = new QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); hexp->setHorizontalStretch(1); hexp->setVerticalStretch(1); selectDestinationDir->setSizePolicy(hexp->horizontalPolicy(), hexp- >verticalPolicy()); selectDestinationDir->sizePolicy().setHorizontalStretch(hexp- >horizontalStretch()); It is still not as wide as I wish. The solution proposed by David works fine as well. Thank you for that. Cheers Torbjoern
signature.asc
Description: This is a digitally signed message part.
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<