Results 1 to 4 of 4

Thread: QMenu Multiple selection problem

  1. #1
    Join Date
    Dec 2008
    Location
    PUNE (INDIA)
    Posts
    49
    Thanks
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QMenu Multiple selection problem

    Hi all Experts,
    I am developing an application in which i am using QMenu.
    I have added QActions into the menu , which are checkable.
    My requirement is that
    1) I should check multiple actions when the menu gets displayed (without vanishing the menu).
    2) when i click ouside of the menu the menu should get vanished.

    I have attached the images which will make you understand more about my requirement.

    I want to deselect first three actions without the menu getting vanished.
    Attached Images Attached Images
    Thanks & Regards ,

    Vajindar Laddad .
    Trainee Developer.
    (INDIA).
    91+9325014248

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QMenu Multiple selection problem

    after clicking on needed action use removeAction for menu which holds this action.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QMenu Multiple selection problem

    QMenu works like menus are supposed to work. Are you sure you want to break commonly accepted UI design principles with such a weird construct? That would not be a menu any more but more like a custom popup component.
    J-P Nurmi

  4. #4
    Join Date
    Dec 2008
    Location
    PUNE (INDIA)
    Posts
    49
    Thanks
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMenu Multiple selection problem

    Example Code

    void Widget::customContextMenuRequested(const QPoint &pt)
    {
    menu->popup(mapToGlobal(pt));
    }

    void Widget::actionsTriggered(QAction *actionPassed)
    {
    menu->show();
    }

    will give you multiple selection QMenu
    Thanks & Regards ,

    Vajindar Laddad .
    Trainee Developer.
    (INDIA).
    91+9325014248

Similar Threads

  1. Syntax highlight selection problem
    By s.toonen in forum Qt Programming
    Replies: 9
    Last Post: 4th June 2008, 12:15
  2. Replies: 1
    Last Post: 1st June 2008, 11:04
  3. Selection problem in QTreeView
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 7th October 2006, 16:02
  4. Replies: 11
    Last Post: 7th July 2006, 13:09
  5. Multiple selection in QTextEdit
    By munna in forum Qt Programming
    Replies: 4
    Last Post: 1st July 2006, 07:58

Tags for this Thread

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.