While creating custom ToolBar, what should be the "Type Information"
I'm creating a custom toolbar with my custom stylesheet, etc. I'll be placing some buttons & a logo on this toolbar.
While creating a new toolbar class, I've given the following details as mentioned below.
Quote:
Class name: CToolbar
Base class: QToolBar
Type Information: ??
what should I select here. QObject or QWidget or any other? Why do we need "Type Information" if we are mentioning "Base Class"?
So kindly help me understand this. Thank you.
Re: While creating custom ToolBar, what should be the "Type Information"
You shouldn't be subclassing QToolBar at all. It doesn't have any virtual methods that you can reimplement.
But to answer your question -- in this case you should choose QWidget because QToolBar contains QWidget in its inheritance tree.
Re: While creating custom ToolBar, what should be the "Type Information"
Thank you for replying.
My intention to subclass the QToolBar is that I can have a separate copy of this class with all the custom styling that I've applied. So that can create a object of this in the QMainWindow and add it. Any further changes related to styling or adding/deleting widgets, I can do it in my custom toolbar class so I need not touch QMainWindow.
Is my idea valid ?
Re: While creating custom ToolBar, what should be the "Type Information"