Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Italian
  4. Qtreewidget Con allegato QpushButton
Forum Updated to NodeBB v4.3 + New Features

Qtreewidget Con allegato QpushButton

Scheduled Pinned Locked Moved Unsolved Italian
1 Posts 1 Posters 411 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.
  • P Offline
    P Offline
    Powa
    wrote on last edited by
    #1

    Salve ho questo piccolo problema, ho creato un treewidget e gli ho allegato dei Qpushbutton all'interno.. solo che adesso non riesco a fa funzionare i bottoni all'interno dell tree widget. qualcuno saprebbe aiutarmi in qualche modo ? grazie in anticipo```
    code_text

      : QMainWindow(parent)
      , ui(new Ui::MainWindow)
    {
      ui->setupUi(this);
      QPushButton *PremiButton = new QPushButton("Ok",this);
      QPushButton *Ecco = new QPushButton("Ok",this);
      QPushButton *Qui = new QPushButton("Ok",this);
    
    
    
      ui->Prova01->setColumnCount(3);
    
      QStringList labels;
      labels  << "Animali" << "Cose" << " Button"; //esempi
      ui->Prova01->setHeaderLabels(labels);
    
    
    
      QTreeWidgetItem *Prova = new QTreeWidgetItem(ui->Prova01);
      Prova->setText(0, "cane"); //nomi utiliazzati a caso 
      Prova->setText(1, "Piatto");
      ui->Prova01->addTopLevelItem(Prova);
      ui->Prova01->setItemWidget(Prova,2, PremiButton);
    
      QTreeWidgetItem *Nipoti = new QTreeWidgetItem();
      Nipoti->setText(0, "gatto");
      Nipoti->setText(1, "forchetta");
      Prova->addChild(Nipoti);
       ui->Prova01->setItemWidget(Nipoti,2, Ecco);
    
       QTreeWidgetItem *Nipoti1 = new QTreeWidgetItem();
      Nipoti1->setText(0, "topo");
      Nipoti1->setText(1, "Carta");
      Prova->addChild(Nipoti1);
      ui->Prova01->setItemWidget(Nipoti1,2, Qui);
    
      }
    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