Results 1 to 12 of 12

Thread: how to change the position of menu of QMainWindow

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2008
    Posts
    58
    Thanks
    2

    Default Re: how to change the position of menu of QMainWindow

    my usecase as below:

    ------------------------------------------------------------------------------------
    menu here My Logo zoom control
    -------------------------------------------------------------------------------------
    | |
    | |
    | |
    | Center Widget |
    | |
    -------------------------------------------------------------------------------------
    now problem is My Logo is larger than menu's height, so I want to adjust menu text
    align with the bottom of my logo picture.

    Do I say clearly?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to change the position of menu of QMainWindow

    Did you try using style sheets for that? You should be able to declare alignment of menu bar items this way.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to change the position of menu of QMainWindow

    As a follow-up of my previous post, seems that using the following stylesheet works very nice:
    css Code:
    1. QMenuBar::item { padding-top: 120px; }
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    May 2008
    Posts
    58
    Thanks
    2

    Default Re: how to change the position of menu of QMainWindow

    Hi wysota

    Could you tell me how to use stylesheet in detailed

    Thanks

  5. #5
    Join Date
    May 2008
    Posts
    58
    Thanks
    2

    Default Re: how to change the position of menu of QMainWindow

    Hi wysota

    Thanks wysota again
    I have done it, it works very well

  6. #6
    Join Date
    Sep 2016
    Posts
    1
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to change the position of menu of QMainWindow

    hello,i have the same question as you ,can you tell me how to do it? thank you !!

  7. #7
    Join Date
    Apr 2008
    Posts
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to change the position of menu of QMainWindow

    Quote Originally Posted by yxmaomao View Post
    my usecase as below:

    ------------------------------------------------------------------------------------
    menu here My Logo zoom control
    -------------------------------------------------------------------------------------
    | |
    | |
    | |
    | Center Widget |
    | |
    -------------------------------------------------------------------------------------
    now problem is My Logo is larger than menu's height, so I want to adjust menu text
    align with the bottom of my logo picture.

    Do I say clearly?
    Would it not be easier just to put your logo underneath the menu?

  8. #8
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to change the position of menu of QMainWindow

    Why dont you use QToolBar ??? u can have a more combinations of using QWidget with toolbar....

Similar Threads

  1. QGraphicsTextItem: handling cursor position change
    By Angelo Moriconi in forum Qt Programming
    Replies: 2
    Last Post: 30th January 2007, 10:42
  2. How to get a position of the menu bar item?
    By Mad Max in forum Qt Programming
    Replies: 2
    Last Post: 20th November 2006, 03:20
  3. How to change system menu of window?
    By krivenok in forum Qt Programming
    Replies: 1
    Last Post: 27th January 2006, 15:19
  4. how change the QListBox item position by pixel
    By roy_skyx in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 01:34

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
  •  
Qt is a trademark of The Qt Company.