View Full Version : Info passing/QWidgetFactory

3rd March 2006, 00:07
I need to pass text into a custom dialog box. The only way I found to do this was to set it up using QWidgetFactory and a receiver class. After I did this I realized that since QWidgetFactory instantiates my custom dialog box from the .ui file none of my functions and slots are useable. In the QWidgetFactory page it says that if I want to use my custom slots that I, "must create a class derived from QObject, which implements all these slots."

Can someone clue me in on how to do this and integrate it into the scheme I mentioned above or clue me into an easier way to pass information into my custom dialog from the calling function?

Thank you for your time.

3rd March 2006, 00:25
There is no need to use QWidgetFactory, unless you want to load your .ui files in the runtime.

Each .ui file represents a class. You can either use it directly, then you will have to declare some method (like setText()) using "Object Explorer" in Qt Designer and implement it in .ui.h file, or you can use the subclassing approach (http://doc.trolltech.com/3.3/designer-manual-6.html).