PDA

View Full Version : accessing gui elements from parent



chemstar
20th May 2006, 21:03
Hi,

i`m using qt4 and have defined my gui interface with the designer. the already existent qtablewidget wasn`t good enough for me and i have created subclass of this. i add this in the with the uic generated header. now i need to access other - defined in the ui header file - gui elements.

when i subclass my tablewidget from the ui-header to i get an error. i think because of the added subclassed table.

how can i handle this?

should i rewrite my program without using the autom. generated ui_xxx file or is there any other solution?

jpn
20th May 2006, 21:16
Did you notice the option "Promote to Custom Widget" in Designer?

chemstar
21st May 2006, 11:03
i`ve looked this possibility. it create the same what i have created manually. only a header file and the pointer are created, nothing else.

does it set some other flags or settings for the compiler?

jpn
21st May 2006, 11:22
I don't think I understand the problem here..

Just a side note: you really shouldn't modify the generated ui_xxx.h file, because it'll be regenerated and overwritten by uic whenever the .ui file changes.

Designer is limited to the standard Qt widgets. You can use the widget promotion in case you want to place your QTableWidget derivate in the form. You don't instantiate and/or subclass your own table widget from the one in the form. The intention is to use it directly, as the widget has already been instantiated during the setupUi() call.