[Qt-interest] title bar

Sean Harmer sean.harmer at maps-technology.com
Fri Nov 27 10:16:26 CET 2009


Hi,

On Friday 27 November 2009 06:44:56 Gordon Schumacher wrote:
> linux newbie wrote:
> > Hi,
> >
> > I am using Qt on embedded ARM platform.
> >
> > 1. Is it possible to change title bar size?
> > 2. My screen size is 640x240. If I call resize(640, 240) in the
> > constructor, the window is not display'd fully. It is observed that
> > bottom lines were clipped (which is equal to height of title bar).
> 
> I suggest using showFullScreen() instead - that's what I'm doing in my
> Qt/E app.

We do this for some apps too. It works well in the case of a single 
mainwindow/dialog. When we have a number of dialogs though we derive our 
dialogs from a base class that uses the Qt::FramelessWindowHint and manually 
sets the geometry of the dialog to fill the screen. Something like this:

BaseDlg::BaseDlg( QWidget* parent )
    : QDialog( parent, Qt::FramelessWindowHint ),
      m_desktop( new QDesktopWidget() )
{
    QRect r = m_desktop->availableGeometry();
    setGeometry( r );
    setMaximumSize( r.width(), r.height() );
    setMinimumSize( r.width(), r.height() );
}

we then also have an init() function that modifies the style sheet to show a 
background pixmap of the correct size etc. The derived dialogs then call 
init() from their constructor.

Cheers,

Sean



More information about the Qt-interest-old mailing list