×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    34

    Using Qt Designer to create GUI

    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
    Regular Contributor
    Join Date
    Mar 2009
    Posts
    430

    Re: Using Qt Designer to create GUI

    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
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Using Qt Designer to create GUI

    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
    Registered User
    Join Date
    Jan 2009
    Posts
    4

    Re: Using Qt Designer to create GUI

    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
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Using Qt Designer to create GUI

    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
    Join Date
    Dec 2009
    Posts
    1

    Re: Using Qt Designer to create GUI

    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
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: Using Qt Designer to create GUI

    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
    Join Date
    Sep 2009
    Posts
    42

    Thumbs up Re: Using Qt Designer to create GUI

    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
    Regular Contributor
    Join Date
    Mar 2009
    Posts
    430

    Re: Using Qt Designer to create GUI

    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
    Join Date
    Sep 2009
    Posts
    42

    Re: Using Qt Designer to create GUI

    it does nt give complete info.. like adding menus, sub menus as and so..
    spk abt launching nt abt the utility...

  11. #11
    Regular Contributor
    Join Date
    Mar 2009
    Posts
    430

    Re: Using Qt Designer to create GUI

    Sorry, but I do not understand your second sentence, there is too much errors.

  12. #12
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Using Qt Designer to create GUI

    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
    Regular Contributor
    Join Date
    Mar 2009
    Posts
    430

    Re: Using Qt Designer to create GUI


  14. #14
    Registered User
    Join Date
    Sep 2009
    Posts
    42

    Re: Using Qt Designer to create GUI

    thanks for ur reply....ya i got it !

Similar Threads

  1. 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
  •  
×