[Qt-interest] Can I get QMainWindow not movable while maximized?

Valentina Masi valentina.masi at altran.it
Tue Jan 5 15:34:14 CET 2010


Hi,

I have the following problem: my main window is to be (1) maximum size, (2) without minimum, maximum and close button and (3) not movable. So, I wrote:
 
DemoConsole::DemoConsole(QWidget *parent, Qt::WFlags flags)

: QMainWindow(parent, flags)

{

  ui.setupUi(this);

  Qt::WindowFlags myFlags = windowFlags();
  myFlags = myFlags | Qt::CustomizeWindowHint;

  myFlags = myFlags | Qt::WindowTitleHint;

  myFlags = myFlags & ~Qt::WindowMinMaxButtonsHint;

  myFlags = myFlags & ~Qt::WindowCloseButtonHint;

  myFlags = myFlags & ~Qt::WindowSystemMenuHint;

  myFlags = myFlags | Qt::FramelessWindowHint;

      

  setWindowFlags(myFlags);

  showMaximized();

}

The code above builds a main window which meets requirements (1) and (2) but not (3); in fact, I can drag my window even though it is maximum size.
Can anyone help me, please?

Thank you in advance
Valentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100105/2c1aea52/attachment.html 


More information about the Qt-interest-old mailing list