Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User hainingwu's Avatar
    Join Date
    Jul 2009
    Posts
    34
    I use Qt Designer to create a Qt Main Window. When I try to design my menu options, I got several problems:

    1. If I only create a menu item without sub-items, the menu item won't be visible. (Here I add the menu item by editing the .ui file.)

    2. To solve the problem above, I referenced some example code. Then I remove the menubar from the UI designer and create the menu option directly by calling menuBar()->addAction(). This approach worked!

    3. When ever I create a Qt Main Window class, the option menu always have two existing options, which are "Show open apps." and "Actions". I couldn't see where these two options were implemented. How can I remove these two options?

    4. Finally, after fighting with Qt Designer, I am wondering if it is better to use Qt Designer for UI, or I should just code everything by hand? Any suggestions?

    Thank you.

    Hai-Ning

  2. #2
    Nokia Developer Champion axeljaeger's Avatar
    Join Date
    Mar 2009
    Posts
    430
    3) I think these two items are added by the operating system. I saw them in native nokia applications too, so why bother?
    4) That depends on your taste. I try to do as much as possible in the designer but I do desktop development most of the time. For embedded, I usually do it by hand because the layouts are very simple and I have to fine tune anyway.

  3. #3
    Nokia Developer Champion savaj's Avatar
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034
    1. If I only create a menu item without sub-items, the menu item won't be visible. (Here I add the menu item by editing the .ui file.)
    Depends on how you implemented menu.

    2. To solve the problem above, I referenced some example code. Then I remove the menubar from the UI designer and create the menu option directly by calling menuBar()->addAction(). This approach worked!
    menuBar() function provided in QMainWindow will returns the menu bar for the main window. This function creates and returns an empty menu bar if the menu bar does not exist. so you can use it if you want.

    3. When ever I create a Qt Main Window class, the option menu always have two existing options, which are "Show open apps." and "Actions". I couldn't see where these two options were implemented. How can I remove these two options?
    Framework add one menu item "Show open apps." to show task bar and which is(if i am not wrong) can not removed. Never show "Actions" menu item, you might doing something wrong.

    4. Finally, after fighting with Qt Designer, I am wondering if it is better to use Qt Designer for UI, or I should just code everything by hand? Any suggestions?
    As said by axeljaeger, its depends on you.

  4. #4
    Hi!
    Did You manage to solve the problem:
    Quote Originally Posted by hainingwu View Post
    3. When ever I create a Qt Main Window class, the option menu always have two existing options, which are "Show open apps." and "Actions". I couldn't see where these two options were implemented. How can I remove these two options?
    I am interested in weird 'Actions' element. Nobody seems to experience the same problem and i can't figure out how to remove the element. Can someone explain what for is this 'Actions' menu entry and, most importatly, how to remove it?

    Regards,
    Thomas

  5. #5
    Nokia Developer Champion savaj's Avatar
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034
    Have you set setContextMenuPolicy() to Qt::NoContextMenu ???. Could it be possible to see how you created menu and how you added menu items?
    Last edited by savaj; 2009-09-22 at 16:34.

  6. #6
    Registered User fo2's Avatar
    Join Date
    Dec 2009
    Posts
    1
    Quote Originally Posted by hainingwu View Post
    3. When ever I create a Qt Main Window class, the option menu always have two existing options, which are "Show open apps." and "Actions". I couldn't see where these two options were implemented. How can I remove these two options?
    "Show open apps." - is a default entry.
    "Actions" - I have exactly same problem. So I can't solve it through ContextMenuPolicy.

  7. #7
    Regular Contributor treinio's Avatar
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329
    Quote Originally Posted by fo2 View Post
    "Actions" - I have exactly same problem. So I can't solve it through ContextMenuPolicy.
    It should be possible to get rid of the Actions menu with QWidget::setContextMenuPolicy( Qt::NoContextMenu ), as mentioned by savaj. Note however that you must set the context menu policy of every widget (that has actions) in the hierarchy. So, if you have a QMainWindow, call that method on it, as well as on each child widget.

  8. #8
    Registered User sindhuraa's Avatar
    Join Date
    Sep 2009
    Posts
    42
    hi....

    i tried to add menubar tht designer...
    bt it was nt achievable.. can some one let me knw how to add menubar tht designer..
    and is there any document tht describes how to use designer... in detail
    and wht all r the possible things tht can be achieved tht desgner??

  9. #9
    Nokia Developer Champion axeljaeger's Avatar
    Join Date
    Mar 2009
    Posts
    430
    http://qt.nokia.com/doc/4.6/designer-manual.html

    Btw: What kind of keyboard are you using? It is hard to read a text with so many typos.

  10. #10
    Registered User sindhuraa's Avatar
    Join Date
    Sep 2009
    Posts
    42
    it does nt give complete info.. like adding menus, sub menus as and so..
    spk abt launching nt abt the utility...

  11. #11
    Nokia Developer Champion axeljaeger's Avatar
    Join Date
    Mar 2009
    Posts
    430
    Sorry, but I do not understand your second sentence, there is too much errors.

  12. #12
    Super Contributor tamhanna's Avatar
    Join Date
    Jul 2008
    Posts
    2,020
    You MUST switch ADT to the QT C++ perspective to be able to add menus and so on!
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  13. #13

  14. #14
    Registered User sindhuraa's Avatar
    Join Date
    Sep 2009
    Posts
    42
    thanks for ur reply....ya i got it !

Similar Threads

  1. Engine instantiating the GUI in a new thread
    By savvy in forum Symbian C++
    Replies: 4
    Last Post: 2007-05-15, 15:03
  2. How to create an UI which just like the GUI of "new SMS"
    By Shen Tianping in forum Symbian User Interface
    Replies: 1
    Last Post: 2007-05-13, 17:18
  3. Can I create GUI components using carbide.vs, how?
    By Gr4c3 in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2007-05-09, 11:25
  4. how to create message like GUI?
    By sjedruszkiewicz in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-12-11, 11:41

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved