Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Unsolved Setting up a QMenu

    General and Desktop
    3
    5
    1051
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Suroh6 last edited by

      I've been looking around at a variety of QMenu creation tutorials one of which comes from the Qt team, http://doc.qt.io/qt-5/qtwidgets-mainwindows-menus-example.html it seems like there is a ton of overhead involved in doing this so my question is, is there an easier way of doing this?

      By easier I don't mean "Less complex" I just mean less code I fully understand what's occurring in the above link I just can't accept that it's the best way of setting up a menu as it seems very inefficient.

      ? 1 Reply Last reply Reply Quote 0
      • ?
        A Former User @Suroh6 last edited by

        @Suroh6 Hi! You can do this without any code in Qt Designer.

        1 Reply Last reply Reply Quote 2
        • S
          Suroh6 last edited by

          Yeah, I understand that I just wasn't sure if there was a better way of implementing one without the use of the designer!

          1 Reply Last reply Reply Quote 0
          • Ni.Sumi
            Ni.Sumi last edited by

            Hi @Suroh6 ,

            As @Wieland suggested , using UI is best option . you can have very very less code. you can add signals and other Qt things directly with out any code. you can also access all the objects of the UI again in the code. Like this.. UI *spinBox1->setRange(1,10) ;

            If you want to code only C++, then the option to reduce couple of lines code by coding with skill. But it reduces may be couple of lines that's it.

            Using UI, is always best option for the people who dont want to see more code and its highly user friendly.

            S 1 Reply Last reply Reply Quote 1
            • S
              Suroh6 @Ni.Sumi last edited by

              @Ni.Sumi Yeah that's all I've managed to do myself is a handful of lines lol I guess I'll just stick with the Designer choice, thank you both for these responses!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post