Results 1 to 3 of 3

Thread: why addSeparator() doesn't work on QMenuBar

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

    Default why addSeparator() doesn't work on QMenuBar

    Hi guys

    I want to add some separator between main menus items
    I find there is a function named addSeparator() in QMenuBar, But it doesn't work

    Why?

    I am using Qt V4.3.2 + Windows XP

    Could you give me some clues

    Thanks

  2. #2
    Join Date
    Oct 2007
    Location
    Cracow
    Posts
    56
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: why addSeparator() doesn't work on QMenuBar

    because it doesn't work with all styles, it's work with Motif and CDE styles

  3. #3
    Join Date
    May 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: why addSeparator() doesn't work on QMenuBar

    HI?

    Can we see how have you do it?

    Do like this :

    Qt Code:
    1. menubar = new QMenuBar(this);
    2. menubar->setGeometry(QRect(0, 0, 1183, 21));
    3. menu_File = new QMenu(menubar);
    4.  
    5. menubar->addAction(menu_File->menuAction());
    6. menu_File->addSeparator();
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 29th May 2008 at 11:33. Reason: missing [code] tags

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.