[Qt-interest] How to customize window titlebar?
Nikos Chantziaras
realnc at arcor.de
Sun May 9 00:05:59 CEST 2010
I need a window that almost behaves like I want when using QDialog; that
is, stays on top of its parent (and *only* on top of the parent, not on
top other windows) and is centered above the parent when shown.
However, when using setWindowFlags(Qt::Dialog) on a QWidget instead, the
window is not centered above the parent when shown. I would also need
to customize it further, by removing the "what's this" help button from
the window title bar along with the maximize and minimize buttons,
leaving only the close button. Resizing the window is OK, but it makes
zero sense to maximize or minimize it.
I've experimented with stuff like:
setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint
| Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
but nothing really works. When using the "Window Flags" Qt example
(examples/widgets/windowflags) the only thing that almost does it is
"Qt::Drawer". But I don't want a Mac drawer really. I only want
something that's initially centered above the parent and offers no
buttons other that the close button.
Doable? I'm on KDE, and I suspect it might be a bit broken in this
regard and that's why I have those problems.
More information about the Qt-interest-old
mailing list