uic generates the ui_stuff.h file from your stuff.ui file.
The name of the variable holding a pointer to your custom widget is set by you in Designer and carried over into generated UI code. In Designer:
untitled.jpg
and in the generated code is the class that the ui pointer points to an instance of:
#include <QtGui/QButtonGroup>
#include <QtGui/QFrame>
#include <QtGui/QHBoxLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_Form
{
public:
QFrame *myCustomFrame;
// <<<<< here
{
...
// <<<< and here
myCustomFrame
= new QFrame(Form
);
myCustomFrame
->setObjectName
(QString::fromUtf8("myCustomFrame"));
myCustomFrame
->setFrameShape
(QFrame::Box);
...
} // setupUi
...
};
...
#endif // UI_UNTITLED_H
#include <QtGui/QButtonGroup>
#include <QtGui/QFrame>
#include <QtGui/QHBoxLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_Form
{
public:
QHBoxLayout *horizontalLayout;
QFrame *myCustomFrame; // <<<<< here
void setupUi(QWidget *Form)
{
...
// <<<< and here
myCustomFrame = new QFrame(Form);
myCustomFrame->setObjectName(QString::fromUtf8("myCustomFrame"));
myCustomFrame->setFrameShape(QFrame::Box);
...
} // setupUi
...
};
...
#endif // UI_UNTITLED_H
To copy to clipboard, switch view to plain text mode
so in your code you can access it through the ui pointer thus:
ui->myCustomFrame;
ui->myCustomFrame;
To copy to clipboard, switch view to plain text mode
Bookmarks