tlerner
17th October 2009, 01:26
Setup: Qt 4.4.3, using visual studio 2005
I have an app ui file (which is empty) and I want to add another centralWidget UI file on top of it (so when I maximize I can have a black background in my app ui and my centralWidget UI can be center screen. I am trying to use setCentralWidget() for this. If I explained things correctly, is this the path I want to follow? I cant even get a button to display in the central widget:
QApp::QApp(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
CentralWidget cw;
QPushButton b;
b.setGeometry(20,20,20,20);
b.setEnabled(true);//.show();
setCentralWidget( &b );
}
Any help is appreciated. Thank you!
I have an app ui file (which is empty) and I want to add another centralWidget UI file on top of it (so when I maximize I can have a black background in my app ui and my centralWidget UI can be center screen. I am trying to use setCentralWidget() for this. If I explained things correctly, is this the path I want to follow? I cant even get a button to display in the central widget:
QApp::QApp(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
CentralWidget cw;
QPushButton b;
b.setGeometry(20,20,20,20);
b.setEnabled(true);//.show();
setCentralWidget( &b );
}
Any help is appreciated. Thank you!