Dear visitor, welcome to KDE-Forum.org.
If this is your first visit here, please read the Help. It explains in detail how this page works.
To use all features of this page, you should consider registering.
Please use the registration form, to register here or read more information about the registration process.
If you are already registered, please login here.
proper resize of preferences dlg
i have an app with a preferences dialog. since i used the example code from kdevelop the preferences dlg itself is hardcoded (no ui file) and every page is its own ui file. the problem is that the preferences dlg doesnt resize to fit the pages content.... here's my code:
|
Source code
|
1
2
3
4
5
6
7
8
9
|
QFrame *frame;
frame = addPage(i18n("Main"), i18n("General Settings"), IconLoader.loadIcon((QString)"../../beastie.xpm", KIcon::NoGroup));
m_pageOne = new KPortsPrefPageOne(frame);
frame = addPage(i18n("Appearance"), i18n("Display-Settings"),IconLoader.loadIcon((QString)"looknfeel", KIcon::NoGroup));
frame->setFrameRect(frame->contentsRect());
m_pageTwo = new KPortsPrefPageTwo(frame);
|
i've tried stuff like setsizepolicy, but it wont help. only thing that has worked yet is setfixedsize but thats not a real solution!
thanks for help
"As long as there is private property and while money is the standard of all things, I do not think that a nation can be governed either justly or happily..." - Raphael Hythloday in Utopia by Thomas More, 15th Century
RE: proper resize of preferences dlg
Originally posted by soul_rebel
the problem is that the preferences dlg doesnt resize to fit the pages content...
Have you set any layouts for that dialog?
You could check if frame has a layout after it is returned by addPage and if yes, add your widget to the layout and if not, create a layout and add your widget.
However you should also have a look at the KConfigXT tutorial
http://developer.kde.org/documentation/t…/kconfigxt.html
Cheers,
_
Qt/KDE Developer
Debian User
thanks first of all
i tried setting a layout but without a result.... i inserted
|
Source code
|
1
2
|
QBoxLayout layout(this, QBoxLayout::LeftToRight);
layout.addWidget(frame);
|
into the constructor...
You could check if frame has a layout after it is returned by addPage
how would i do that? i know fopr sure that the two dialogs inserted have align in grid set by kdevelopdesigner...
"As long as there is private property and while money is the standard of all things, I do not think that a nation can be governed either justly or happily..." - Raphael Hythloday in Utopia by Thomas More, 15th Century
Originally posted by soul_rebel
thanks first of all
i tried setting a layout but without a result.... i inserted
|
Source code
|
1
2
|
QBoxLayout layout(this, QBoxLayout::LeftToRight);
layout.addWidget(frame);
|
into the constructor...
If you have it exactly like this the layout will be deleted at constructor end (created on stack)
You could check if frame has a layout after it is returned by addPage
how would i do that? i know fopr sure that the two dialogs inserted have align in grid set by kdevelopdesigner...
|
Source code
|
1
|
if (frame->layout() != 0)
|
Cheers,
_
Qt/KDE Developer
Debian User
i cant get it to work....
whatever i try either nothing happens or i get sigsev....
if someone knew the exact lines of code i would have to insert, i would be really grateful...
thanks
"As long as there is private property and while money is the standard of all things, I do not think that a nation can be governed either justly or happily..." - Raphael Hythloday in Utopia by Thomas More, 15th Century