Style of Window
-
How can i with or without QSS change style of Window: buttons of closing, min and max, title area and other
Advance many thanks for your help! -
AFAIK you can't do it with Qt only. You need to draw your own decorations and use non-decorated window flag. Maybe there are also some solutions in WinAPI, but I don't know
-
The titlebar belongs to the OS and, so Qt does not have control over it and it is hence not possible to modify it using Qt. The following "FAQ":http://developer.qt.nokia.com/faq/answer/how_can_i_handle_events_in_the_titlebar_and_change_its_color_etc contains information on how you can create your own titlebar though and an example on how to do it.
-
If you create an own title bar on Windows OS, you loos some other windows features like maximizing != Fullscreen, menu in the task bar etc.
If you want to keep that, you must write OS specific code and overwrite WM_NCPAINT etc...
-
Also: users of window systems that allow you to adapt the layout of these buttons and frames (KDE comes to mind) will probably hate you for tampering with this. They expect their applications to follow their preference, instead of having to follow the preferences of the application's author.
-
How can i use QToolBar and QMenuBar in this modif window?
-
I did not get your question.
What is the problem?If you modify the header style it has no influence on the client widgets. Use them as normal.
-
But QMenuBar and QToolBar attached to QMainWindow, is it?
-
Yes, but they are part of the client area. The title bar and the title bar buttons are at the non client area.
The NonClient area is (AFAIK always) part of the OS, the content is part of the application.
-
Then, write please code how can i set QToolBar or QMenuBar to QWidget or dont attached al all(if it is posible)
-
This can be found in the "docs":http://doc.qt.nokia.com/4.7/index.html and "main window examples":http://doc.qt.nokia.com/4.7/examples-mainwindow.html . If you want to add a menu bar or a tool bar to a "normal" qwidget,. you have to add it amnually to a layout like all other widgets.