Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. [Solved]Adding a QTreeWidget to a new Tab from a QTabWidget
Forum Updated to NodeBB v4.3 + New Features

[Solved]Adding a QTreeWidget to a new Tab from a QTabWidget

Scheduled Pinned Locked Moved C++ Gurus
2 Posts 1 Posters 2.0k 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
    Tecnova
    wrote on last edited by
    #1

    Hi,
    my problem is that i create a QTreeWidget from a file in read in, in a thread.
    When the thread has created the treewidget he send it back to the main thread.

    Now i want to add a new tab to my Tabwidget and set the treewidget as the shown widget in this tab.
    but i get this error: No matching function for call to 'QTabWidget::addTab(QTreeWidget&)'
    my code looks like this:
    @void Dictionary::addToTab(QTreeWidget *tree)
    {
    ui->tabWidgetDebug->addTab(tree);
    ui->tabWidgetDebug->setCurrentIndex(ui->tabWidgetDebug->currentIndex()+1);
    ui->stackedWidget->setCurrentIndex(4);
    }@

    Earlier I didi the same thing with a QTableWidget, where I read in a file in a thread and give the complete table back to the the main thread and it worked fine when i added the widget to the tab.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Tecnova
      wrote on last edited by
      #2

      Ok,
      @ui->tabWidgetDebug->addTab(tree,"Name");@
      worked.

      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