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. Deep copy of QTabWidget pages advise/workaround?
Forum Updated to NodeBB v4.3 + New Features

Deep copy of QTabWidget pages advise/workaround?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 810 Views 1 Watching
  • 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.
  • T Offline
    T Offline
    TonyB123
    wrote on last edited by
    #1

    Hi,

    I've used Qt Creator (Designer) to design the QMainWindow with a child QTabWidget that has different designs of QWidget pages. Each page has a different mix of buttons, comboboxes, labels and QTableWidget tables

    When I run my Python app, I load the Qt front end in and I delete the tab pages to start from a blank QTabWidget. Then I want to be able to have multiple instances of my QWidget pages to appear that I designed earlier. I guess I want to be able to do a deep copy of these QWidget pages (that keeps all the layouts, buttons, comboboxes and QTableWidget tables that I designed) so that I can load them with different data. What's the best approach to do this?

    Thanks for your help.

    jsulmJ 1 Reply Last reply
    0
    • M Offline
      M Offline
      mpergand
      wrote on last edited by
      #2

      Hi,

      You need to create a separate ui form for each of your tab widgets and,
      use QUiLoader::load to instanciate the widget you want.

      1 Reply Last reply
      0
      • T TonyB123

        Hi,

        I've used Qt Creator (Designer) to design the QMainWindow with a child QTabWidget that has different designs of QWidget pages. Each page has a different mix of buttons, comboboxes, labels and QTableWidget tables

        When I run my Python app, I load the Qt front end in and I delete the tab pages to start from a blank QTabWidget. Then I want to be able to have multiple instances of my QWidget pages to appear that I designed earlier. I guess I want to be able to do a deep copy of these QWidget pages (that keeps all the layouts, buttons, comboboxes and QTableWidget tables that I designed) so that I can load them with different data. What's the best approach to do this?

        Thanks for your help.

        jsulmJ Online
        jsulmJ Online
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @TonyB123 Simply create so many of your widgets as you need, there is no need for deep copy.
        C++ version:

        MyWidget *widget1 = new MyWidget(this);
        MyWidget *widget2 = new MyWidget(this);
        ...
        

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

        1 Reply Last reply
        1

        • Login

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