Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How can I add Tab as UI file from qtdesigner converted file PYQT5?
Forum Updated to NodeBB v4.3 + New Features

How can I add Tab as UI file from qtdesigner converted file PYQT5?

Scheduled Pinned Locked Moved Unsolved Qt for Python
5 Posts 2 Posters 677 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.
  • A Offline
    A Offline
    aadil50
    wrote on last edited by
    #1

    I have a main windows which contain Add tab button and empty space.. I have a ui file converted to py file.. So I want to add that UI contents to empty space and when I add new tab it must create instance of UI file content in new tab. How can I do this ?

    My Main File:

    https://hastebin.com/kinocobire.rb

    My UI file converted to PY:

    https://hastebin.com/dawequluqa.rb

    jsulmJ 1 Reply Last reply
    0
    • A aadil50

      I have a main windows which contain Add tab button and empty space.. I have a ui file converted to py file.. So I want to add that UI contents to empty space and when I add new tab it must create instance of UI file content in new tab. How can I do this ?

      My Main File:

      https://hastebin.com/kinocobire.rb

      My UI file converted to PY:

      https://hastebin.com/dawequluqa.rb

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

      @aadil50 You import the generated Python module. Create an instance of Ui_MainWindow and add it to your tab layout.

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

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aadil50
        wrote on last edited by
        #3

        How can i do it? I have done, If you observe I have done it in comments.. It gives me error from ui file.. "AttributeError: 'First' object has no attribute 'setCentralWidget' "

        jsulmJ 1 Reply Last reply
        0
        • A aadil50

          How can i do it? I have done, If you observe I have done it in comments.. It gives me error from ui file.. "AttributeError: 'First' object has no attribute 'setCentralWidget' "

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

          @aadil50 said in How can I add Tab as UI file from qtdesigner converted file PYQT5?:

          setCentralWidget

          QWidget has no central widget, only QMainWindow has one.

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

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aadil50
            wrote on last edited by
            #5

            So I have to convert my Ui file QMainWindow to QWidget.. How can I resolve it? Kindly help me as I am beginner..

            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