PDA

View Full Version : Designer and view factory



Rockem
19th July 2009, 10:12
Hello all,

In my code usually for lets say some dialog I will have:
controller class - handles logic
view class - display view
view factory - will handle creating of view classes

the problem is that if I use designer I can't use my view factory as it just
initiate the view class

is there work around for that ?
thanx
Eli

wysota
19th July 2009, 21:42
Designer doesn't initiate anything. It creates a class you need to use in some other class that inherits QWidget. So when you subclass you have full control over what is going on and you can design the class any way you see fit as long as you eventually call setupUi() on the object generated by Designer.

Rockem
22nd July 2009, 09:48
My problem is when I place my own widget in the designer
so the generated ui file will contain

MyOwnWidet *a = new MyOwnWidget();

while I want the all of my gui component will come from the factory
and will not be initiated that way.

thanx

wysota
22nd July 2009, 11:22
In that case Designer can't help you, you need to write your code manually or modify the file created by uic but every time you change something in the ui file, you'll have to redo all the modifications.