Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to creat a layout with BOTH a menubar and a tablewidget

How to creat a layout with BOTH a menubar and a tablewidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 257 Views
  • 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 Offline
    S Offline
    Saru4
    wrote on last edited by
    #1

    Hi there,
    I've been trying for a while now: (pyqt5 + pycharm + python 3.5)
    I can create a layout with a menubar up the top (File,Edit,Help) and a simple layout.
    I can also create a layout with a tablewidget no problems.
    BUT I cannot get both to work on the same layout.
    Could someone please show me a simple example of both on a page at the same time?

    thanks in advance
    regards
    saru4

    jsulmJ D 2 Replies Last reply
    0
    • S Saru4

      Hi there,
      I've been trying for a while now: (pyqt5 + pycharm + python 3.5)
      I can create a layout with a menubar up the top (File,Edit,Help) and a simple layout.
      I can also create a layout with a tablewidget no problems.
      BUT I cannot get both to work on the same layout.
      Could someone please show me a simple example of both on a page at the same time?

      thanks in advance
      regards
      saru4

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Saru4 Can you show how you're trying to create this layout?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Saru4

        Hi there,
        I've been trying for a while now: (pyqt5 + pycharm + python 3.5)
        I can create a layout with a menubar up the top (File,Edit,Help) and a simple layout.
        I can also create a layout with a tablewidget no problems.
        BUT I cannot get both to work on the same layout.
        Could someone please show me a simple example of both on a page at the same time?

        thanks in advance
        regards
        saru4

        D Offline
        D Offline
        DJaq
        wrote on last edited by
        #3

        @Saru4
        Are you using setMenuBar() to set the menu bar to your main window?
        This way, you would use:

        • setMenuBar(/menu bar goes here/) to set the menubar to your window;
        • setLayout(/layout goes here/) to set the main layout in your window.

        Then, you can call layout() to get the pointer on the main window's layout, to which you can call addWidget() to add any widget you like.

        If you want to, I can give you a quick example, but it will be a C++ example as I do not master Python very much. But only the syntax changes a bit, the process should be identical. ^^

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved