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. QList with QtabWidget
Forum Updated to NodeBB v4.3 + New Features

QList with QtabWidget

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 465 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.
  • jipe3001J Offline
    jipe3001J Offline
    jipe3001
    wrote on last edited by
    #1

    I am using Qlist to create QtabWidgets with several tabs but facing error message
    when trying to add tabs, here is the code used to generate the QTabwidgets:

    mainwindow.h

        QWidget *page1;
        QWidget *page2;
        QWidget *page3;
        QList <QTabWidget*> tab_widget_setup;
    

    mainwindow.cpp

        page1 = new QWidget;
        page2 = new QWidget;
        page3 = new QWidget;
    
        tab_widget_setup.append(new QTabWidget);
    	
        tab_widget_setup[0]->addTab(page1);
    
        Error msg: no matching menber function for call to 'addTab'
    

    Thks for your usual coop

    jsulmJ 1 Reply Last reply
    0
    • jipe3001J Offline
      jipe3001J Offline
      jipe3001
      wrote on last edited by
      #3

      Thks Jsulm, You are right, it's working now
      Stupid of me !

      1 Reply Last reply
      0
      • jipe3001J jipe3001

        I am using Qlist to create QtabWidgets with several tabs but facing error message
        when trying to add tabs, here is the code used to generate the QTabwidgets:

        mainwindow.h

            QWidget *page1;
            QWidget *page2;
            QWidget *page3;
            QList <QTabWidget*> tab_widget_setup;
        

        mainwindow.cpp

            page1 = new QWidget;
            page2 = new QWidget;
            page3 = new QWidget;
        
            tab_widget_setup.append(new QTabWidget);
        	
            tab_widget_setup[0]->addTab(page1);
        
            Error msg: no matching menber function for call to 'addTab'
        

        Thks for your usual coop

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

        @jipe3001 Check the documentation: https://doc.qt.io/qt-5/qtabwidget.html#addTab
        You need to pass more than one parameter to addTab.

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

        1 Reply Last reply
        3
        • jipe3001J Offline
          jipe3001J Offline
          jipe3001
          wrote on last edited by
          #3

          Thks Jsulm, You are right, it's working now
          Stupid of me !

          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