当前位置: 首页>>代码示例>>C++>>正文


C++ QTreeWidgetItem::setChildIndicatorPolicy方法代码示例

本文整理汇总了C++中QTreeWidgetItem::setChildIndicatorPolicy方法的典型用法代码示例。如果您正苦于以下问题:C++ QTreeWidgetItem::setChildIndicatorPolicy方法的具体用法?C++ QTreeWidgetItem::setChildIndicatorPolicy怎么用?C++ QTreeWidgetItem::setChildIndicatorPolicy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QTreeWidgetItem的用法示例。


在下文中一共展示了QTreeWidgetItem::setChildIndicatorPolicy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: on_actionOpen_triggered

void ClifView::on_actionOpen_triggered()
{
  QString filename = QFileDialog::getOpenFileName(this,
        tr("Open clif File"));
  
  std::string path(filename.toLocal8Bit().constData());
  lf_file.open(path, H5F_ACC_RDONLY);
  
  //lffile = H5::H5File(filename.toLocal8Bit().constData(), H5F_ACC_RDONLY);

  vector<string> datasets = lf_file.datasetList();
  
  //FIXME clean root list!

  for(uint i=0;i<datasets.size();i++) {
     QString path(datasets[i].c_str());
     DatasetRoot *root = new DatasetRoot(&lf_file, datasets[i]);
     
     QTreeWidgetItem *item = new QTreeWidgetItem(ui->tree, QStringList(path));
     item->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
     
     item->setData(0, Qt::UserRole, QVP<DatasetRoot>::asQVariant(root));
     root_list.push_back(root);
  }
}
开发者ID:hendriksiedelmann,项目名称:clifview,代码行数:25,代码来源:clifview.cpp

示例2: taskListDownloaded

void TasksDialog::taskListDownloaded(SynergyResponse response)
{
    if (response.error)
    {
        error(response.stdErr);
        return;
    }

    ui->treeWidget->clear();

    if (response.stdOut.isEmpty())
    {
        m_taskListReceived = true;
        ui->stackedWidget->setCurrentIndex(0);
        return;
    }

    QStringList taskList = response.stdOut.split(QLatin1String("\n"), QString::SkipEmptyParts);
    foreach(QString task, taskList)
    {
        int spaceIndex = task.indexOf(QLatin1Char(' '));
        QString objectName = task.left(spaceIndex);
        QString displayName = task.right(task.length() - spaceIndex);

        QTreeWidgetItem *treeItem = new QTreeWidgetItem(ui->treeWidget);
        treeItem->setText(0, displayName);
        treeItem->setData(0, Qt::UserRole, objectName);
        treeItem->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
    }
开发者ID:zeddq,项目名称:synergy-plugin,代码行数:29,代码来源:tasksdialog.cpp

示例3: removeExpands

void BasketTreeListView::removeExpands()
{
    QTreeWidgetItemIterator it(this);
    while (*it) {
        QTreeWidgetItem *item = *it;
        if (item->childCount() <= 0)
            item->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
        ++it;
    }
}
开发者ID:bewitchingme,项目名称:basket,代码行数:10,代码来源:basketlistview.cpp

示例4: onCanvasAdded

void CanvasPhotoWidget::onCanvasAdded(const std::string &name)
{
    QTreeWidgetItem* item = new QTreeWidgetItem();
    if (!item) return;
    item->setText(0, QString(name.c_str()));
    item->setFlags(item->flags() | Qt::ItemIsEditable);
    item->setData(0,cher::DelegateChildRole,1);
    item->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
//    item->setSizeHint(0, QSize(cher::APP_WIDGET_BUTTON, cher::APP_WIDGET_BUTTON));
    this->addTopLevelItem(item);
}
开发者ID:vicrucann,项目名称:cherish,代码行数:11,代码来源:TreeWidget.cpp

示例5: initMaterialCatalog

void MaterialBrowser::initMaterialCatalog( QString const & path )
{
  QFileInfoList topLevelList = QDir( path ).entryInfoList( QDir::Dirs | QDir::NoDotAndDotDot );
  for ( int i=0 ; i<topLevelList.size() ; i++ )
  {
    DP_ASSERT( topLevelList[i].isDir() );
    QTreeWidgetItem * topLevelItem = new QTreeWidgetItem();
    topLevelItem->setChildIndicatorPolicy( QTreeWidgetItem::ShowIndicator );
    topLevelItem->setData( 0, Qt::UserRole, topLevelList[i].absoluteFilePath() );
    topLevelItem->setText( 0, topLevelList[i].absoluteFilePath().section( '/', -1 ) );

    m_catalog->addTopLevelItem( topLevelItem );
  }
}
开发者ID:raedwulf,项目名称:pipeline,代码行数:14,代码来源:MaterialBrowser.cpp

示例6: browseItems

void dlgAddItems::browseItems()
{
    vector<OpcItem > vecAllBranches;
    m_pOpcCtrl->BrowserBranches(vecAllBranches);

    for (vector<OpcItem>::iterator it = vecAllBranches.begin(); it != vecAllBranches.end(); it++)
    {
        QTreeWidgetItem *rootItem = new QTreeWidgetItem(ui.treeGroups);
        wstring strGroup = (*it).sItem.GetBSTR();
        rootItem->setText(0, QString::fromStdWString(strGroup));
        rootItem->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
        ui.treeGroups->addTopLevelItem(rootItem);
    }
}
开发者ID:jjfsq1985,项目名称:StudyLab,代码行数:14,代码来源:dlgadditems.cpp

示例7: QString

QTreeWidgetItem *CollectionTreeWidget::addAlbum(QString artist, QString album, unsigned int albumId) {
    // Find id in database if we don't have it
    if (albumId == 0) {
         QSqlTableModel *model = service->collectionModel();

         // SQLite used two single quotes to escape a single quote! :)
         QString filter = "artist = '" + QString(artist).replace("'","''") + "' AND "
                          "album = '" + QString(album).replace("'","''") + "'";
         model->setFilter(filter);
         model->select();

         while (model->canFetchMore()) model->fetchMore();
         int total = model->rowCount();
         if (total > 0) {
            albumId = model->record(0).value(model->fieldIndex("id_album")).toInt();
         }
         else {
             qDebug("ERROR: no album found! -- " + model->filter().toUtf8());
             return NULL;
         }
    }

    // Looks for the artist
    QTreeWidgetItem *newAlbumNode; // The node with the album, whether it exists or not
    QTreeWidgetItem *artistItem;
    artistItem = addArtist(artist);

    // Look for album
    for (int i = 0; i < artistItem->childCount(); i++) {
        if (artistItem->child(i)->text(0) == album) {
            newAlbumNode = artistItem->child(i);
            return newAlbumNode;
        }
    }

    // Create our new album node and add it if it was not found
    newAlbumNode = new CollectionTreeWidgetItem(LevelAlbum, albumId, (QTreeWidget*)0);
    newAlbumNode->setText(0, album);
    newAlbumNode->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);

    // Set icon
    newAlbumNode->setIcon(0, IconFactory::fromTheme("media-cdrom"));

    artistItem->addChild(newAlbumNode);
    artistItem->sortChildren(0, Qt::AscendingOrder);

    return newAlbumNode;
}
开发者ID:esdrasbeleza,项目名称:audactile,代码行数:48,代码来源:collectiontreewidget.cpp

示例8: LoadTables

void ODBC_Connection::LoadTables()
{
	// the table and field view
	m_ui.TableTreeWidget->clear();

	// populate the available tables
	Logging::getInstance()->WriteLog(INFORMATION, QString("Retrieving database tables of connection \"%1\"...").arg(m_sConnectionName));
	for (int i = 0, count = m_db.tables().count(); i < count; i++)
	{
		QString sTableName = m_db.tables().value(i);
		QTreeWidgetItem *pItem = new QTreeWidgetItem(QStringList() << sTableName);
		pItem->setIcon(0, QIcon(":/ODBC_Query/Resources/table.png"));
		m_ui.TableTreeWidget->addTopLevelItem(pItem);
		pItem->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
	}
}
开发者ID:Edder,项目名称:odbc-query,代码行数:16,代码来源:ODBC_Connection.cpp

示例9: Insert

 /**
  * Inserts widget to be layed out.
  *
  * @param widget ContactWidget object to display.
  * @param key Grouping object.
  */
 void Insert(ContactWidget* widget, const T key){
   if (!map_.contains(key)) {
     QTreeWidgetItem* item = new QTreeWidgetItem;
     item->setData(0, Qt::DisplayRole, titler_(widget, key));
     item->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
     items_[key] = item;
     tree_->addTopLevelItem(item);
   }
   map_.insert(key, widget);
   QTreeWidgetItem* item = new QTreeWidgetItem;
   items_[key]->addChild(item);
   items_[key]->setExpanded(true);
   tree_->setItemWidget(item, 0, widget);
   // sort childern, which causes them to recalculate stylesheet and hide indentation
   items_[key]->sortChildren(0, Qt::AscendingOrder);
 }
开发者ID:marosi,项目名称:SocialDesktopClient,代码行数:22,代码来源:main_window.cpp

示例10: search

void medPacsWidget::search(QString query)
{
    this->readSettings();

    this->clear();

    if (!d->find) d->find = medAbstractPacsFactory::instance()->createFindScu("dcmtkFindScu");
    if(d->find)
    {
        d->find->clearAllQueryAttributes();
        d->find->setQueryLevel(medAbstractPacsFindScu::STUDY);
        d->find->addQueryAttribute(0x0010,0x0010, query.toAscii().constData()); // patient name
        d->find->addQueryAttribute(0x0008,0x0030, "\0"); // study date
        d->find->addQueryAttribute(0x0008,0x0050, "\0"); // accession no
        d->find->addQueryAttribute(0x0008,0x0061, "\0"); // modalities in study
        d->find->addQueryAttribute(0x0008,0x0090, "\0"); // ref physician
        d->find->addQueryAttribute(0x0008,0x1030, "\0"); // study description
        d->find->addQueryAttribute(0x0010,0x0020, "\0"); // patient ID
        d->find->addQueryAttribute(0x0010,0x0030, "\0"); // patient BD
        d->find->addQueryAttribute(0x0010,0x0040, "\0"); // sex
        d->find->addQueryAttribute(0x0020,0x000D, "\0"); // studyInstanceUID
        d->find->addQueryAttribute(0x0020,0x0010, "\0"); // study ID

        foreach(QStringList node, d->selectedNodes)
            d->find->sendFindRequest(node.at(0).toLatin1(), node.at(1).toLatin1(), tryToInt(node.at(2)),
                                     d->hostTitle.toLatin1(), d->hostAddress.toLatin1(), tryToInt(d->hostPort));

        QVector<medAbstractPacsNode *> nodes = d->find->getNodeContainer();

        foreach(medAbstractPacsNode *node, nodes) {

            QVector<medAbstractPacsResultDataset *> container = node->getResultDatasetContainer();

            foreach(medAbstractPacsResultDataset *dataset, container) {

                QTreeWidgetItem *item = new QTreeWidgetItem(this, QStringList()
                        << QString(dataset->findKeyValue(0x0010,0x0010))
                        << QString(dataset->findKeyValue(0x0008,0x1030))
                        << QString(dataset->findKeyValue(0x0020,0x0010))
                        << QString(dataset->findKeyValue(0x0008,0x0061)));

                item->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
                item->setData(0,Qt::UserRole, d->index(*node));
                item->setData(1,Qt::UserRole, QPoint(0x0020,0x000D));
                item->setData(2,Qt::UserRole, QString(dataset->getStudyInstanceUID()));
            }
开发者ID:papadop,项目名称:medInria-public,代码行数:46,代码来源:medPacsWidget.cpp

示例11: catalogItemExpanded

void MaterialBrowser::catalogItemExpanded( QTreeWidgetItem * item )
{
  GetApp()->setOverrideCursor( Qt::WaitCursor );

  std::vector<std::string> extensions = dp::fx::EffectLibrary::instance()->getRegisteredExtensions();

  QStringList filterList;
  for ( std::vector<std::string>::const_iterator it = extensions.begin() ; it != extensions.end() ; ++it )
  {
    filterList.push_back( QString( "*" ) + it->c_str() );
  }

  QString filePath = item->data( 0, Qt::UserRole ).toString();
  QFileInfoList fil = QDir( filePath ).entryInfoList( filterList, QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot, QDir::DirsFirst );
  for ( int i=0 ; i<fil.size() ; i++ )
  {
    QString filePath = fil[i].absoluteFilePath();
    if ( fil[i].isDir() )
    {
      QTreeWidgetItem * childItem = new QTreeWidgetItem();
      childItem->setData( 0, Qt::UserRole, filePath );
      childItem->setText( 0, filePath.section( '/', -1 ) );
      childItem->setChildIndicatorPolicy( QTreeWidgetItem::ShowIndicator );
      item->addChild( childItem );
    }
    else
    {
      std::string fp = filePath.toStdString();
      dp::fx::EffectLibrary::instance()->loadEffects( fp, dp::util::FileFinder( GetApp()->getPreferences()->getSearchPathsAsStdVector() ) );

      std::vector<std::string> materialNames;
      dp::fx::EffectLibrary::instance()->getEffectNames( fp, dp::fx::EffectSpec::EST_PIPELINE, materialNames );
      for ( std::vector<std::string>::const_iterator it = materialNames.begin() ; it != materialNames.end() ; ++it )
      {
        QTreeWidgetItem * childItem = new QTreeWidgetItem();
        childItem->setData( 0, Qt::UserRole, QString( it->c_str() ) );
        childItem->setText( 0, QString( it->c_str() ) );
        item->addChild( childItem );
      }
    }
  }

  GetApp()->restoreOverrideCursor();
}
开发者ID:raedwulf,项目名称:pipeline,代码行数:44,代码来源:MaterialBrowser.cpp

示例12: populate

void ItemAdder::populate(QTreeWidgetItem *parent,
                         teasafe::SharedTeaSafe const &teaSafe,
                         std::string const &path)
{
    if(teaSafe->folderExists(path)) {
        teasafe::TeaSafeFolder f = teaSafe->getTeaSafeFolder(path);
        std::vector<teasafe::EntryInfo> entryInfos = f.listAllEntries();
        std::vector<teasafe::EntryInfo>::iterator it = entryInfos.begin();

        for(; it != entryInfos.end(); ++it) {
            QTreeWidgetItem *item = new QTreeWidgetItem(parent);
            if(it->type() == teasafe::EntryType::FolderType) {
                item->setChildIndicatorPolicy (QTreeWidgetItem::ShowIndicator);
            }
            item->setText(0, QString(it->filename().c_str()));
        }
    }

    emit finished();
}
开发者ID:binarybazooka,项目名称:teasafe,代码行数:20,代码来源:ItemAdder.cpp

示例13: fillDateTreeWidget

void HistoryWindow::fillDateTreeWidget(int index)
{
	if (ui.fromComboBox->count() == 0)
		return;
	auto contactInfo = ui.fromComboBox->itemData(index).value<History::ContactInfo>();
	ui.dateTreeWidget->clear();

	setWindowTitle(QStringLiteral("%1 (%2)").arg(ui.fromComboBox->currentText(), ui.accountComboBox->currentText()));

	history()->months(contactInfo, m_search).connect(this, [this, contactInfo] (const QList<QDate> &months) {
		int index = ui.fromComboBox->currentIndex();
		auto currentContactInfo = ui.fromComboBox->itemData(index).value<History::ContactInfo>();
		if (!(currentContactInfo == contactInfo))
			return;

		QTreeWidgetItem *year = nullptr;
		QTreeWidgetItem *month = nullptr;
		Icon yearIcon(QStringLiteral("view-calendar-year"));

		for (const QDate &date : months) {
			if (!year || year->data(0, Qt::UserRole).toInt() != date.year()) {
				year = new QTreeWidgetItem(ui.dateTreeWidget);
				year->setText(0, QString::number(date.year()));
				year->setIcon(0, yearIcon);
				year->setData(0, Qt::UserRole, date.year());
				year->setExpanded(true);
			}

			month = new QTreeWidgetItem(year);
			month->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
			month->setText(0, QDate::longMonthName(date.month()));
			month->setIcon(0, Icon("view-calendar-month"));
			month->setData(0, Qt::UserRole, date);
			month->setExpanded(false);
		}

		if (month)
			ui.dateTreeWidget->setCurrentItem(month);
	});
}
开发者ID:CyberSys,项目名称:qutim,代码行数:40,代码来源:historywindow.cpp

示例14: recursiveInsert

static void recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QString path)
{
    QFileIconProvider prov;
    QIcon folderIcon = prov.icon(QFileIconProvider::Folder);
    if (pathTrail.size() == 0) {
        if (path.endsWith('/')) {
            path.chop(1);
        }
        parent->setToolTip(0, path);
        parent->setData(0, Qt::UserRole, path);
    } else {
        QTreeWidgetItem *item = findFirstChild(parent, pathTrail.first());
        if (!item) {
            item = new QTreeWidgetItem(parent);
            item->setIcon(0, folderIcon);
            item->setText(0, pathTrail.first());
            item->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
        }

        pathTrail.removeFirst();
        recursiveInsert(item, pathTrail, path);
    }
}
开发者ID:TaylorHicks,项目名称:mirall,代码行数:23,代码来源:folderwizard.cpp

示例15: setChildIndicatorPolicy

void QTreeWidgetItemProto::setChildIndicatorPolicy(int policy)
{
  QTreeWidgetItem *item = qscriptvalue_cast<QTreeWidgetItem*>(thisObject());
  if (item)
    item->setChildIndicatorPolicy((QTreeWidgetItem::ChildIndicatorPolicy)policy);
}
开发者ID:,项目名称:,代码行数:6,代码来源:


注:本文中的QTreeWidgetItem::setChildIndicatorPolicy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。