I made a custom widget called MovieTabPane, which eventually will be inside a QTabWidget. But I've been testing it using this:
MovieTabPane *m = new MovieTabPane();
m->show();
MovieTabPane *m = new MovieTabPane();
m->show();
To copy to clipboard, switch view to plain text mode
Which has worked fine. But now, I'm adding the QMainWindow, and trying to put the MovieTabPane on as the central widget with a QMenuBar. The entire window comes out empty except the menu bar and widget, which are cramped into the top left corner.
Here's the code:
ApplicationWindow()
{
// Create MenuBar and Connection Menu
mConnectionMenu
= new QMenu( tr
("&Connection"), mMenuBar
);
mMenuBar->addMenu( mConnectionMenu );
// Create Connect Action, and connect triggered() signal to message() <== temporary
mConnectAction
= new QAction( tr
("Co&nnect"), mConnectionMenu
);
connect( mConnectAction, SIGNAL( triggered() ), this, SLOT( message() ) );
// Create Custom Widget
mMovieTabPane = new MovieTabPane( this );
// Create Grid Layout and add mMovieTabPane
mGridLayout->addWidget( mMovieTabPane );
// Tell AppWindow to use mGridLayout
setLayout( mGridLayout );
// Scale
resize( 905, 495 );
// Show
show();
}
ApplicationWindow()
: QMainWindow()
{
// Create MenuBar and Connection Menu
mMenuBar = new QMenuBar( this );
mConnectionMenu = new QMenu( tr("&Connection"), mMenuBar );
mMenuBar->addMenu( mConnectionMenu );
// Create Connect Action, and connect triggered() signal to message() <== temporary
mConnectAction = new QAction( tr("Co&nnect"), mConnectionMenu );
connect( mConnectAction, SIGNAL( triggered() ), this, SLOT( message() ) );
// Create Custom Widget
mMovieTabPane = new MovieTabPane( this );
// Create Grid Layout and add mMovieTabPane
mGridLayout = new QGridLayout( this );
mGridLayout->addWidget( mMovieTabPane );
// Tell AppWindow to use mGridLayout
setLayout( mGridLayout );
// Scale
resize( 905, 495 );
// Show
show();
}
To copy to clipboard, switch view to plain text mode
I'll be back in a few hours to check replies... gotta go write a Physics mid term
Bookmarks