Bez tytułu

z Chocolate Gibbon, 6 dni temu, napisane w C++, wyświetlone 16 razy. [paste_expire] 10 miesiące.
URL https://pastebin.k4be.pl/view/c955f38e Udostępnij
Pobierz wklejkę lub Pokaż surowy tekst
  1.     QTreeWidgetItem *branchWithFiles(const ChromTreeItem *cti_source) {
  2.         bool keep = false;
  3.         auto node = new QTreeWidgetItem();
  4.         if(cti_source->isFileItem()) {
  5.             keep = true;
  6.         }
  7.         for (int i = 0; i < cti_source->childCount(); i++) {
  8.             auto *child = static_cast<const ChromTreeItem *>(cti_source->child(i));
  9.             auto subbranch = branchWithFiles(child);
  10.             if(subbranch) {
  11.                 node->addChild(subbranch);
  12.                 keep = true;
  13.             }
  14.         }
  15.         if(!keep) {
  16.             delete node;
  17.             return nullptr;
  18.         }
  19.         node->setText(0, cti_source->text(0));
  20.         if(cti_source->file) {
  21.             node->setText(1, QString::number(cti_source->file->fileID()));
  22.         }
  23.         return node;
  24.     }

odpowiedź "Bez tytułu"

Tutaj możesz odpowiedzieć na wklejkę z góry

captcha