Try this:
setWindowFlags(Qt:ialog);
That gives me a dialog with a title bar and a close X but no minimize or maximize buttons.
Ignore the icon, it's Qt: Dialog without the space.
Try this:
setWindowFlags(Qt:ialog);
That gives me a dialog with a title bar and a close X but no minimize or maximize buttons.
Ignore the icon, it's Qt: Dialog without the space.
Thanks for the answer, but exactly this (and some other things) does not work on Linux. I suppose you are working on Windows. I am afraid, that it is the the X Manager feature and I can't remove this stupid buttons. Even the dialog examples have the minimize/maximize buttons, and there is nothing to do to get rid of them.
Last edited by lotek; 23rd November 2010 at 23:59.
Yes, I am working on Windows, for now. But from what you said, I will have the same problems when I go over to Linux.
Hi,
The maximize button disappears when the setMaximumSize()method is called for a dialog.
For the context help button the arithmetical & with negation of the Qt::WindowContextHelpButtonHint flag works.
Qt::WindowFlags f = windowFlags();
f &= ~Qt::WindowContextHelpButtonHint;
setWindowFlags(f);
Only the minimize button stays, but i can live with it.
You should set "Qt::CustomizeWindowHint" for window flags,
Qt Code:
setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint);To copy to clipboard, switch view to plain text mode
Last edited by srazi; 24th November 2010 at 12:57. Reason: spelling corrections
Nice idea, but sorry...
I've already checked it. on Linux ( SuSE 11.2) the minimize and maximize buttons ale still visible. The close button and context help button disappear.
Anyway thanks for the hint!
me![]()
hi,
In Debian its working. It should work with windowflags ,
try Qt::FramelessWindowHint and if u want to show a title ,add a QLabel and show ur title.
Or Try window styles, like motif,kde etc using QStyle
Thnks
Bala
Works well in Ubuntu 10.04
All buttons visible and all buttons enabled: setWindowFlags(Qt::Tool)
All buttons visible, close and maximize buttons enabled, minimize button disabled: setWindowFlags(Qt::Tool | Qt::WindowTitleHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint)
All buttons visible, maximize button enabled, close and minimize disabled: setWindowFlags(Qt::Tool | Qt::WindowTitleHint | Qt::WindowMaximizeButtonHint | Qt::CustomizeWindowHint)
Only close button is visible and enabled setWindowFlags(Qt::Tool | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint)
No buttons in title bar: setWindowFlags(Qt::Tool | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint)
If i am understanding this problem correctly then this works with Qt4 on Ubuntu 10.10
w.setWindowFlags(Qt::Tool);
add that line before w.show() in your main.cpp and all you will have is the close button
HTH
TpwUK![]()
Bookmarks