Re: QDialog dynamic size.
Re: QDialog dynamic size.
Wysota,
i saw this, but the problem is, the dialog i'm talking about is constructing the layout in from the .ui, and i dont know how to access (get a ptr) to the layout object to do the size constraint...
From my code (A class which herits from the generated CPP), maybe i can use findChildren<QVerticalLayout*> which theorically will return only one item in list (Since there is only one layout over my whole QDialog)?
The thing is, i have ideas, but i'm not sure if it's "clean" and bug free...
Thank you a lot for pointing this article anyway :)
Pierre.
[EDIT:] The layout pointer which is generated in the CPP file is named "vboxLayout" and is public. So my new question is, is this name "vboxLayout" some "nomenclature" which i can be 100% sure will have the same name in future version of QT?
Re: QDialog dynamic size.
Quote:
Originally Posted by
hickscorp
Wysota,
i saw this, but the problem is, the dialog i'm talking about is constructing the layout in from the .ui, and i dont know how to access (get a ptr) to the layout object to do the size constraint...
From my code (A class which herits from the generated CPP), maybe i can use findChildren<QVerticalLayout*> which theorically will return only one item in list (Since there is only one layout over my whole QDialog)?
The thing is, i have ideas, but i'm not sure if it's "clean" and bug free...
Thank you a lot for pointing this article anyway :)
findChildren is bug free ... this is a super access function ... i have generated Ui file direct
from db (self build on qt generate qtui, latex pdf forms, scribus forms phyton, && xml) and i have construct a class container to take db->fieldname qt->objektname db->data .... and i fill form from two table on 0.344 sec..
Code:
lineedit = editperson->findChildren<QLineEdit *>();
boxlist = editperson->findChildren<QComboBox *>();
doubnum = editperson->findChildren<QDoubleSpinBox *>();
numerlist = editperson->findChildren<QSpinBox *>();
datelist = editperson->findChildren<QDateTimeEdit *>();
/* table a start fill */
for (int i=0;i<lineedit.size();i++){
basedata->FillText(lineedit[i]);
}
for (int i=0;i<numerlist.size();i++) {
basedata->FillNumer(numerlist[i]);
}
for (int i=0;i<boxlist.size();i++) {
basedata->FillBox(boxlist[i]);
}
for (int i=0;i<datelist.size();i++) {
basedata->FillDate(datelist[i]);
}
/* table a stop */
next table from his id...
Re: QDialog dynamic size.
Quote:
Originally Posted by
hickscorp
i saw this, but the problem is, the dialog i'm talking about is constructing the layout in from the .ui, and i dont know how to access (get a ptr) to the layout object to do the size constraint...
Each object created from ui file is a member of the UI, so you can access it directly though the pointer.
Quote:
[EDIT:] The layout pointer which is generated in the CPP file is named "vboxLayout" and is public. So my new question is, is this name "vboxLayout" some "nomenclature" which i can be 100% sure will have the same name in future version of QT?
You already have the ui, so it's name won't change. All objects in ui files are assigned to a member of the generated class which is named after the objectName property. It's a global convention, so I'm pretty sure it'll stick. And if not, you can always access the object through its name.
BTW. It's Qt, not QT. The latter is Apple technology.
Re: QDialog dynamic size.
Oooh very good. Well it answer my question, i'll stick to using the pointer name i got from the CPP generated from the UI.
And about the Apple thing, i'm not surprised at all and glad to learn this came "from" them ^^
Thanks again!
Pierre.
Re: QDialog dynamic size.
You mean Quick Time? I think it's their primary software technology...