PDA

View Full Version : Can't embed a widget with UI into the central area



thesock
21st November 2013, 18:30
To ease my task, I designed a widget in Qt Designer for my project. I made the appropitate header and source for the widget and included the headers in the main window source. But I get errors upon adding the widget to the grid layout of the central widget. The errors are announced by that the name of the UI pointer stays black and the point doesn't change to an arrow. I've integrated the main and the UI header of the widget. Here is the code (in Qt Creator view):
mainWindowUI->gridLayout->addWidget(widgetUI.widget);
Can you help me please?

derrickbj
21st November 2013, 20:36
There's not a lot of information to go on, but did you declare "widget" with new? as in
lineEdit = new QLineEdit(mainWindowUI);