how to implement this MainWindow just like iTunes ?
I mean, no caption, just put menu bar in the main window, we can resize the main window from the four directions, please see the itunes.
Thanks in advance!
how to implement this MainWindow just like iTunes ?
I mean, no caption, just put menu bar in the main window, we can resize the main window from the four directions, please see the itunes.
Thanks in advance!
Would you care to provide more details? From what I see iTunes window has a title and is in all means a regular classical main window.
As you know, default for main window there is icon + title at the left-most, min/max/close buttons at the right-most, border lines at four directions' boder which you can resize the window.
at the bottom of the windows title and icon there is MenuBar then Tool Bar
But when you run the iTunes, you can see these are different.
So could you tell me how to impelment the mainwindow like the iTunes.
I have try to setWindowFlags( Qt::FramelessWindowHint ), but in this case I can't get
the resize indicator at the four direction's border, at the same time all the relative system's hint menu will be lost.
Isnt this I tunes like a custom shaped widget ??
With menus drawn with transparent background ?? and close/maximize/minimize buttons custom made ??
hope am not wrong![]()
yes I can customise the titlebar, but there are still two problems,
1. how can I show system context menus for eg min/max/ restore/move etc. you know when applicaton at the system task bar, right-click system menu will popup, but when I use setWindowFlags(Qt::FramelessWindowHint| Qt::WindowSystemMenuHint); OS context menu is not right.
2. after setWindowFlags(Qt::FramelessWindowHint), my application don't repsone system (window+M ) keys which should make my application minimise.
You can catch the QWidget::contextMenuEvent() I guess. The menu you are talking about is shown on right click of title bar, and also left mouse button click near the left most area of the title bar. I dont think it shud be difficult to mimick the same1. how can I show system context menus for eg min/max/ restore/move etc. you know when applicaton at the system task bar, right-click system menu will popup, but when I use setWindowFlags(Qt::FramelessWindowHint| Qt::WindowSystemMenuHint); OS context menu is not right.
No idea right now. Didnt try it yet2. after setWindowFlags(Qt::FramelessWindowHint), my application don't repsone system (window+M ) keys which should make my application minimise.![]()
I have tried many ways, still can't implement this function, Anybody know?
I am wondering how the iTunes implement this with Qt
1. iTunes can response system shortcut key : windows + M combined key to minimise
2. iTunes response system context menu very well
I have also been wondering how to do something like this. I want to use MainWindow, but I want to be able to draw my own titlebar, min, max, close buttons, and menus etc. All using custom graphics I made in photoshop/gimp. Is there any good tutorials/explanation about how to accomplish this?
2 paths to choose:
- Stylesheets, see Qt Style Sheets
- QStyle, see QStyle - creating custom styles
As for both it's a bit try-and-learn. There are some limitations on both.
What you can do to achieve a similar look to itunes is :
a) set your QMainWindow borderless, use a stylesheet on the QMenuBar. create a subclassed QMenu object and create a "title-like" stylesheet for that one. When creating the menubar, add your menuitems, then add a stretch, add your logo/title, add stretch, add padding after the stretch that is the same as the menuitems before... Lot of tuning hassle and work, but in theory it should work.
b) reimplement the drawing of a mainwindow entirely, and write it all by hand
c) QStyle as mentioned above.
for the windows+m issue, when using a borderless window, you might have to call: QWidget::activateWindow() on your mainwindow to get keyboard focus.
cheers,
Leif
Search the forum for "skins" or something similar. There has been a thread about a solution to completely modify the look of a window, including its title bar.
anyone has an idea for this now??
What problem are you currently facing and what did you already try to solve it?
My problem is :
set my MainWindow as frameless, then use setMask make main windows like iTunes
but now my app can't response to Windows + M combined shortcut keys to minimize window, and system context menu can't be shown now.
Actually I just want to get a window face which likes iTunes' and can response to system context menu and combined Windows+M shortcut keys correctly.
As for Windows+M, you can emulate it using a shortcut and QWidget API.
but when should I emulate this thing, I don't know when user click that keys you know
still nobody how to do this?
Have you seen QShortCut docs?
Bookmarks