PDA

View Full Version : QT menu window style in linux



atenakid
12th February 2014, 00:24
Hi all,

I stuck with the problem when build menu with Qt4 in ubuntu. The menu shows up on the upper left corner as Ubuntu style. :( :(
How can I change this into window like style like this one.
As far as I know, it is because using QMainWindow, it tries to mimic the desktop environment.
In addition, my target platform is embedded linux device :)

10038
http://qt-project.org/doc/qt-4.8/mainwindows-menus.html

Thanks you all for reading, and sorry about my English. ^^

anda_skoa
12th February 2014, 08:58
In addition, my target platform is embedded linux device :)


In this case you don't have to do anything. Your target device is not going to run Unity, is it?

Cheers,
_

adutzu89
12th February 2014, 10:13
You can remove the native titlebar with qt flags and you can create your own custom one, though it takes a bit more work.I didn't done it yet.
Otherwise, if your targeted platform has the window control buttons on the right,how you want it, there is no point in going that deep.

http://qt-project.org/doc/qt-4.8/qt.html#WindowType-enum

atenakid
12th February 2014, 11:39
In this case you don't have to do anything. Your target device is not going to run Unity, is it?

Cheers,
_

By now I just made the desktop target in ubuntu. I have never build for the embedded yet.
As far as I know, my target environment must be stblinux of BradCom. I have no idea what going on with this.
Thanks for your reply,
PS: This is my first time in OOP and Qt, I'm sorry for some non-sense questions. ^^

anda_skoa
12th February 2014, 12:35
By now I just made the desktop target in ubuntu. I have never build for the embedded yet.
As far as I know, my target environment must be stblinux of BradCom. I have no idea what going on with this.


The menu is one of the things that are handled through the platform integration plugin. Since you run Ubuntu with Unity, the menu gets placed into Unity's menu location, as users of that platform would expect.

On your target your are either not running Unity, thus getting "inline" menus, or, if you are running Unity, then this is the expected behavior.

Cheers,
_

atenakid
12th February 2014, 14:49
The menu is one of the things that are handled through the platform integration plugin. Since you run Ubuntu with Unity, the menu gets placed into Unity's menu location, as users of that platform would expect.

On your target your are either not running Unity, thus getting "inline" menus, or, if you are running Unity, then this is the expected behavior.

Cheers,
_

Thanks you for quick reply,

Just in case of running Unity, how can I made the menu show up as window style? would you give me some suggestion for that?
Some examples reference would be the best since I'm a Qt chicken, ^^

Many thanks,

anda_skoa
12th February 2014, 15:18
I am not sure how the achieved the integration, Canonical might even have added a local patch to Qt.

You could try building and running your application against a different Qt version.

Cheers,
_

Infinity
12th February 2014, 18:46
Are you talking about the "global application menu"?
According to an answer on askubuntu this feature can be disabled by removing the indicator-appmenu package. (Because of ugly things like that feature I prefer other desktop environments over Unity.)
See: http://askubuntu.com/questions/10481/how-do-i-disable-the-global-application-menu

atenakid
13th February 2014, 00:27
Are you talking about the "global application menu"?
According to an answer on askubuntu this feature can be disabled by removing the indicator-appmenu package. (Because of ugly things like that feature I prefer other desktop environments over Unity.)
See: http://askubuntu.com/questions/10481/how-do-i-disable-the-global-application-menu

Thanks you, it works for my case in Ubuntu environment ^^. I wonder can I do it in the embedded Linux and is there any problem while disable those?
Many thanks,

anda_skoa
13th February 2014, 09:31
Thanks you, it works for my case in Ubuntu environment ^^. I wonder can I do it in the embedded Linux and is there any problem while disable those?


Disable what?

Cheers,
_

Infinity
13th February 2014, 20:54
I wonder can I do it in the embedded Linux and is there any problem while disable those?
I don't think the problem will occur on embedded Linux since there will be no Unity desktop. Thus there is nothing to be disabled.