Results 1 to 7 of 7

Thread: Qt Designer - creating a form that includes a menu bar only.

  1. #1
    Join Date
    Jun 2007
    Posts
    21
    Thanks
    25
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Qt Designer - creating a form that includes a menu bar only.

    Hi,

    Does anyone know if you can create a mainform using Qt3 Designer that includes a height equal to zero. (i.e. all i want is a form that includes the menu bar and no body).

    I have tried setting minimum height to zero and then setting preferred height to minimum in the form properties but this did not solve the problem.

    I was thinking i may have to code up this form outside Qt designer but was just checking in case someone had encountered this and solved this problem previously,

    Thanks in advance,

    nlev.

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

    Default Re: Qt Designer - creating a form that includes a menu bar only.

    What is the point of creating such a form?

  3. #3
    Join Date
    Jun 2007
    Posts
    21
    Thanks
    25
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Qt Designer - creating a form that includes a menu bar only.

    Porting a legacy motif application to qt, not sure why they did it this way,

    I have tried manually setting the height in the .ui xml file to zero but i think it may be a qt designer limitation?

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

    Default Re: Qt Designer - creating a form that includes a menu bar only.

    I suggest you do it the proper way instead of forcing odd design.

  5. #5
    Join Date
    Jun 2007
    Posts
    21
    Thanks
    25
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Qt Designer - creating a form that includes a menu bar only.

    coding by hand i have made a QMainWindow dialog and used the widget class public method "setFixedHeight()" to set the height = 0, (which half worked, ie there is a small area below the menu bar) and "setFixedWidth()"(which did not work, ie goes to a max limit, but window can still be shrunk thinner)

    Is there other way to keep only the menu bar, and no area below the menu bar?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt Designer - creating a form that includes a menu bar only.

    Yes. Use QMenuBar instead of QMainWindow.

  7. The following user says thank you to wysota for this useful post:

    nleverin (5th July 2007)

  8. #7
    Join Date
    Jun 2007
    Posts
    21
    Thanks
    25
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Qt Designer - creating a form that includes a menu bar only.

    Ah ha, thank you very much, worked perfectly!!!

    cheers heaps for your help, im a newbie to Qt and C++, so your help is very appreciated.

    nlev.

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.