Results 1 to 2 of 2

Thread: Menu issue

  1. #1
    Join Date
    Aug 2009
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Menu issue

    We want to use a std look and feel application but on a touchscreen. I need to enlarge the menu items to be a minimum of 40x80 for easy selection.

    I have been working with the stylesheets, but I can't seem to get what I want. I have a QMenuBar with a bunch of QActions (who have child actions) added to it. The stylesheets affect the first row of the menu, but nothing on the submenus. Ideally the action/action selection needs to be enlarged (not the text itself).

    Via QMenuBar I can set a min-width and min-height, and it works perfect.

    Via QMenu I can modify all submenus to have a large font, but the min-width and min-height affect the overall menu size itself, not the items in the menu.

    From there I am trying the QMenu::item, but it doesn't seem to be controlling anything....

    QMenu::item{ min-height: 40px; }

    What am I doing wrong ... ?????

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

    Default Re: Menu issue

    Put this in your main right after you create the application object:
    Qt Code:
    1. app.setGlobalStrut(QSize(40,40)),
    To copy to clipboard, switch view to plain text mode 
    This will inform Qt you don't want any user-clickable item to be smaller than 40x40. You won't have to manipulate the sizes on the widget level then. All GUI elements should respect this setting.You should make your custom ones obey it as well, by the way.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Help Menu
    By GrahamLabdon in forum Newbie
    Replies: 1
    Last Post: 3rd November 2010, 10:41
  2. Qt Pie Menu
    By stefan1981 in forum Qt Programming
    Replies: 1
    Last Post: 12th September 2008, 16:13
  3. Tray context menu display issue
    By r2hubert in forum Qt Programming
    Replies: 1
    Last Post: 7th July 2008, 21:15
  4. dropdown menu(popupmenu) refreshing issue
    By Ankit in forum Qt Programming
    Replies: 12
    Last Post: 24th August 2007, 05:57
  5. dropdown menu(popupmenu) refreshing issue
    By Ankit in forum Qt Tools
    Replies: 3
    Last Post: 17th August 2007, 14:09

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.