You create the QStackedWidget, but you do not give it any parent. You do not tell your QMainWidget to use the QStackedWidget as its "centralWidget". Thus the QStackedWidget is never shown, so it is always invisible.
Line 16 should be:
stackedWidget = new QStackedWidget( this );
To copy to clipboard, switch view to plain text mode
and add a line at the end of the constructor:
setCentralWidget( stackedWidget );
setCentralWidget( stackedWidget );
To copy to clipboard, switch view to plain text mode
If you want the background of the Raptor* widgets to be white, this code needs to be moved to their constructors. It does nothing if you have it in the Base constructor:
QPalette pal
= palette
();
// retrieves the default palette for the widget, as defined by the app's style pal.
setColor( QPalette::Window, Qt
::white );
setPalette( pal );
QPalette pal = palette(); // retrieves the default palette for the widget, as defined by the app's style
pal.setColor( QPalette::Window, Qt::white );
setPalette( pal );
To copy to clipboard, switch view to plain text mode
Edit: Actually, maybe this is incorrect. If you set the palette before creating the stacked and Raptor* widgets, it is possible that they will inherit the QPalette:: Window setting from the Base class.
Bookmarks