How to create Custom Slot upon widgets in Qt4.
In Qt4 .ui.h is available or not? If available how a way I can access?
I am not getting a way in Qt4.
Plz. help.
How to create Custom Slot upon widgets in Qt4.
In Qt4 .ui.h is available or not? If available how a way I can access?
I am not getting a way in Qt4.
Plz. help.
Anurag Shukla
A man who never makes mistake is the man who never does anything! Theodre Rosvelt!
You can create a custom slot upon your widget by reading: http://doc.trolltech.com/4.3/designe...component.html.
Regards
Raccoon29 (8th September 2007)
Hi, I read it too, and I would pose a question about the custom slots:You can create a custom slot upon your widget by reading: http://doc.trolltech.com/4.3/designe...component.html.
so, how do I decide which type of inheritance is better use? I mean, which are the points to follow to decide? I didn't understand reading it...
Thanks
Greetings
--
raccoon29
"La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "
This is what docs have to say about these two approaches:
The Single Inheritance Approach
The main advantages of this approach are its simple use of inheritance to provide a QWidget-based interface, and its encapsulation of the user interface widget variables within the ui data member. We can use this method to define a number of user interfaces within the same widget, each of which is contained within its own namespace, and overlay (or "compose") them. This approach can be used to create individual tabs from existing forms, for example.
The Multiple Inheritance Approach
Subclassing using multiple inheritance gives us more direct access to the contents of the form, is slightly cleaner than the single inheritance approach, but does not conveniently support composition of multiple user interfaces.
One of the things that I personally do like in single inheritance approach is that it makes it slightly easier to read (unfamiliar) code. Designed UI components are referred via special UI object. This makes it clear where a certain variable is declared. In multiple inheritance approach member variables are declared in a separate auto generated header file. Of course, a simple naming convention would do the same trick in multiple inheritance approach too.
J-P Nurmi
Thank you for the answer,One of the things that I personally do like in single inheritance approach is that it makes it slightly easier to read (unfamiliar) code.
but isn't it going to be annoy to refer to the Ui object everytime you have to use a ui form component? I hope in your personal experience
--
raccoon29
"La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "
I don't believe its annoying.
As jpn pointed out it is more cleaner. You always know a certain widget is in the UI class.
Regards
Ok,
thank you all very much
--
raccoon29
"La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "
Bookmarks