[Qt-interest] How to display classification banners in QMainWindow?

William Lugg wlugg at prairienetworks.com
Tue Aug 4 02:08:13 CEST 2009


I never saw an answer to this on the list, but here's how we did it in our 
app.  Remember that ours is Qt 3.3 based so YMMV.

// NOTE: the this pointer below refers to a QMainWindow object
QDockWindow* topBanner = new QDockWindow( this, "TopBanner" );

QLabel* topBannerLabel = new QLabel( topBanner, "Welcome John Doe" );
// set min/max size on label for proper sizing, set alignment, colors,
font, etc..

topBanner->setWidget( topBannerLabel );
topBanner->setMovingEnabled( FALSE );
topBanner->setHorizontallyStretchable( TRUE );
this->addDockWindow( topBanner, Qt::DockTop, TRUE );

// do same for bottom

HTH
----
Bill Lugg
  Milstar Software Support
  Peterson AFB, CO
  No Micro$oft products were used to create this email.  
  God rules and if he needed a computer it would run Linux!


On Friday 31 July 2009 12:52:49 pm Eric Clark wrote:
> Please disregard the last email, I have discovered a way to do it. Thank
> You!
>
> Eric
>
> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Eric Clark Sent:
> Friday, July 31, 2009 1:42 PM
> To: Qt Interest (qt-interest at trolltech.com)
> Subject: [Qt-interest] How to display classification banners in
> QMainWindow?
>
> Hello All,
>
> I have an application that is developed for the government and it is a
> requirement that the application have classification banners on the top and
> bottom of the main window to display the classification of the application.
> I would like for these banners to be the topmost and bottommost widgets in
> my main window, but I do not see how to do this. It seems as though the
> menu bar must always be the topmost widget and the status bar must be the
> bottommost widget. Does anyone know how to bypass this? I could set my own
> menu bar widget on the main window, but the menu bar class says it always
> puts itself at the top of the layout. I could put the banner below the menu
> bar and above the status bar, but I am not sure how to set the status bar
> widget.
>
> Thank you in advance!
> Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090803/f720793b/attachment.html 


More information about the Qt-interest-old mailing list