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. puting 2 widgets in the same class

puting 2 widgets in the same class

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 407 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.
  • Z Offline
    Z Offline
    Zunneh
    wrote on last edited by
    #1

    Hello guys , i created a class which inherit from a QTreeWidget

    class CCONFIGTREE:public QTreeWidget
    {
    
    };
    

    in .cpp

      CCONFIGTREE::CCONFIGTREE():QTreeWidget()
      {
    
      }
    

    when i call my constructor , everything is okay
    Now i want to change my class , i want to create a QTabWidget and in this QTabWidget i put the CCONFIGTREE class
    i tried

    class CCONFIGTREE:public QTreeWidget
    {
    QTabWidget *test=new QTabWidget(this);
    setParent(test);
    };
    

    but didn't work , someone have idea please ? thanks

    my english is average, please use simple words and try to be the most explicit, thank you

    JonBJ CP71C 2 Replies Last reply
    0
    • Z Zunneh

      Hello guys , i created a class which inherit from a QTreeWidget

      class CCONFIGTREE:public QTreeWidget
      {
      
      };
      

      in .cpp

        CCONFIGTREE::CCONFIGTREE():QTreeWidget()
        {
      
        }
      

      when i call my constructor , everything is okay
      Now i want to change my class , i want to create a QTabWidget and in this QTabWidget i put the CCONFIGTREE class
      i tried

      class CCONFIGTREE:public QTreeWidget
      {
      QTabWidget *test=new QTabWidget(this);
      setParent(test);
      };
      

      but didn't work , someone have idea please ? thanks

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Zunneh
      I think this is a really bad idea, and can't really believe you want to even try to do this, but that aside what does "but didn't work" mean?

      1 Reply Last reply
      1
      • Z Zunneh

        Hello guys , i created a class which inherit from a QTreeWidget

        class CCONFIGTREE:public QTreeWidget
        {
        
        };
        

        in .cpp

          CCONFIGTREE::CCONFIGTREE():QTreeWidget()
          {
        
          }
        

        when i call my constructor , everything is okay
        Now i want to change my class , i want to create a QTabWidget and in this QTabWidget i put the CCONFIGTREE class
        i tried

        class CCONFIGTREE:public QTreeWidget
        {
        QTabWidget *test=new QTabWidget(this);
        setParent(test);
        };
        

        but didn't work , someone have idea please ? thanks

        CP71C Offline
        CP71C Offline
        CP71
        wrote on last edited by
        #3

        @Zunneh
        Hi,
        maybe this reading can help you.

        https://doc.qt.io/qt-5/qtwidgets-dialogs-tabdialog-example.html

        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