PDA

View Full Version : Document title bar problem



Álvaro
31st October 2011, 16:51
I have changed the MDI example (Qt 4.7.4) to explain a title bar problem.

The image below demonstrates the problem. The three document buttons (maximize, minimize and close) do not appear.

7050

In the attached source (7049), there is a file, named "Defines.h", where is possible to simulate the error.

What's happening, does anyone know?

Thank you,
Álvaro.

Álvaro
1st November 2011, 16:28
There is a new version 7060.

The first version contains errors in the files ".pro" and "main.pp".

Santosh Reddy
2nd November 2011, 00:02
This looks strange. The problem is created by QMenuBar. As QMainWindow's default QMenuBar is hidden and when you create a new maximized the MDI child with menubar hidden, it is causing this button's missing, (in my case the Qt Icon on the left of menus is also missing, on Windows Vista).

If you set default menu bar visible before creating the MDI child it works ok. Just by calling menuBar()->show() in ctor, or mainWin.menuBar()->show() before mainWin.newFile() in main.cpp

I guess QMainWindow's layout manager is not handing menu bar hidden scenario properly, which is causing the widgets to be overlapping (or something of that sort which is causing geometry problems).