Results 1 to 11 of 11

Thread: QT menu window style in linux

  1. #1
    Join Date
    Jan 2014
    Location
    Korea
    Posts
    7
    Thanks
    6
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Smile QT menu window style in linux

    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

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

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

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT menu window style in linux

    Quote Originally Posted by atenakid View Post
    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,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    atenakid (12th February 2014)

  4. #3
    Join Date
    Oct 2013
    Posts
    142
    Thanks
    36
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QT menu window style in linux

    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....indowType-enum

  5. #4
    Join Date
    Jan 2014
    Location
    Korea
    Posts
    7
    Thanks
    6
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT menu window style in linux

    Quote Originally Posted by anda_skoa View Post
    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. ^^

  6. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT menu window style in linux

    Quote Originally Posted by atenakid View Post
    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,
    _

  7. #6
    Join Date
    Jan 2014
    Location
    Korea
    Posts
    7
    Thanks
    6
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT menu window style in linux

    Quote Originally Posted by anda_skoa View Post
    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,

  8. #7
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT menu window style in linux

    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,
    _

  9. #8
    Join Date
    Oct 2012
    Posts
    132
    Thanks
    10
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QT menu window style in linux

    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...plication-menu

  10. The following user says thank you to Infinity for this useful post:

    atenakid (13th February 2014)

  11. #9
    Join Date
    Jan 2014
    Location
    Korea
    Posts
    7
    Thanks
    6
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT menu window style in linux

    Quote Originally Posted by Infinity View Post
    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...plication-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,

  12. #10
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT menu window style in linux

    Quote Originally Posted by atenakid View Post
    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,
    _

  13. #11
    Join Date
    Oct 2012
    Posts
    132
    Thanks
    10
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QT menu window style in linux

    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.

  14. The following user says thank you to Infinity for this useful post:

    atenakid (18th February 2014)

Similar Threads

  1. Window menu problem, C# & Qt
    By linuxoid in forum Newbie
    Replies: 5
    Last Post: 29th April 2016, 22:03
  2. QTreeWidget context menu style
    By Raadush in forum Qt Programming
    Replies: 1
    Last Post: 3rd July 2012, 11:29
  3. [Qt 4.6.3 Linux] style sheet focus on QPushButton
    By snooker9 in forum Qt Programming
    Replies: 0
    Last Post: 5th March 2012, 13:27
  4. Tab keeps hover style after a context menu is closed
    By gui developer in forum Newbie
    Replies: 1
    Last Post: 29th September 2010, 01:44
  5. Window style
    By almost in forum Qt Programming
    Replies: 1
    Last Post: 18th September 2006, 05:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.