Results 1 to 2 of 2

Thread: Defining position for QMenu used by QPushButton

  1. #1
    Join Date
    Feb 2009
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Defining position for QMenu used by QPushButton

    Hi,

    So I want to open QMenu when button is clicked. There is no problem with opening it, but what would be good way to define where menu is opened? As default it shows on below the button, but is there way to define it to be shown for example on the right side of button? I have toolbar on left side of UI with several buttons, so it would be convenient to show sub-menus on the right side of this toolbar. UI is made on dialog.

    One way could be to open menu in certain location (QPoint) when button is clicked, but I think that would be little messy. So is there any support in Qt to associate button and menu and define menus location?

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Defining position for QMenu used by QPushButton

    well, one good way of doing it would be to create a custom widget and show it on the click of the button using the connect() method

Similar Threads

  1. Qpushbutton
    By iamhere in forum Qt Programming
    Replies: 5
    Last Post: 15th October 2008, 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.