Not sure if I'm even asking this question correctly because I'm new to C++ and Qt. But, say I have a subclass of QWidget:
class childofqwidget : public QWidget
Can I pass a pointer to an object of subclass to the setCentralWidget member function of QMainWindow? Something like this:
mainlayout = new childofqwidget;
setCentralWidget(mainlayout);
The reason I'm asking is because I've made a subclass of QWidget which has a layout with a textbox and some buttons. I'd like to insert this as the central widget of the QMainWindow object. Is this possible? If not is there a better way I should do this?
childofwidgetshould be namedChildOfWidget. Variables and method names should begin with a lower letter and capital letter for every new word:mainlayoutshould be namedmainLayout. (This is the Qt naming convention.) - leemes