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


C++ QListWidgetItem::setFlags方法代码示例

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


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

示例1: on_mAddButton_clicked

void QgsComposerManager::on_mAddButton_clicked()
{
  QgsComposer* newComposer = 0;

  newComposer = QgisApp::instance()->createNewComposer();
  if ( !newComposer )
  {
    return;
  }

  if ( mTemplate->currentIndex() > 0 )
  {
    QDomDocument templateDoc;
    QFile templateFile( mTemplate->itemData( mTemplate->currentIndex() ).toString() );
    if ( templateFile.open( QIODevice::ReadOnly ) )
    {
      if ( templateDoc.setContent( &templateFile, false ) )
      {
        newComposer->readXML( templateDoc );
      }
    }
  }

  QListWidgetItem* item = new QListWidgetItem( newComposer->title(), mComposerListWidget );
  item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable );
  mItemComposerMap.insert( item, newComposer );
}
开发者ID:Nald,项目名称:Quantum-GIS,代码行数:27,代码来源:qgscomposermanager.cpp

示例2: on_newColumnButton_clicked

void TreeWidgetEditor::on_newColumnButton_clicked()
{
    m_updating = true;
    QListWidgetItem *currentColumn = ui.listWidget->currentItem();
    int idx = ui.listWidget->count();
    if (currentColumn)
        idx = ui.listWidget->currentRow() + 1;

    QString newColumnString = tr("New Column");

    int columnCount = ui.treeWidget->columnCount();
    ui.treeWidget->setColumnCount(columnCount + 1);

    ui.treeWidget->headerItem()->setText(columnCount, newColumnString);
    moveColumnsLeft(idx, columnCount);

    QListWidgetItem *item = new QListWidgetItem();
    item->setFlags(item->flags() | Qt::ItemIsEditable);
    item->setText(newColumnString);
    ui.listWidget->insertItem(idx, item);
    ui.listWidget->setCurrentItem(item);

    ui.treeWidget->setCurrentItem(ui.treeWidget->currentItem(), ui.listWidget->currentRow());

    m_updating = false;
    updateEditor();

    ui.listWidget->editItem(item);
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:29,代码来源:treewidgeteditor.cpp

示例3: AddPage

void SettingsDialog::AddPage(Page id, SettingsPage* page) {
  // Create the list item
  QListWidgetItem* item = new QListWidgetItem(page->windowIcon(),
                                              page->windowTitle());
  ui_->list->addItem(item);

  if (!page->IsEnabled()) {
    item->setFlags(Qt::NoItemFlags);
  }

  // Create a scroll area containing the page
  QScrollArea* area = new QScrollArea;
  area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  area->setWidget(page);
  area->setWidgetResizable(true);
  area->setFrameShape(QFrame::NoFrame);
  area->setMinimumWidth(page->layout()->minimumSize().width());

  // Add the page to the stack
  ui_->stacked_widget->addWidget(area);

  // Remember where the page is
  PageData data;
  data.index_ = ui_->list->row(item);
  data.scroll_area_ = area;
  data.page_ = page;
  pages_[id] = data;
}
开发者ID:hairyjoe23,项目名称:jailurbator,代码行数:28,代码来源:settingsdialog.cpp

示例4: refreshComposers

void QgsComposerManager::refreshComposers()
{
  QString selName = mComposerListWidget->currentItem() ? mComposerListWidget->currentItem()->text() : "";

  mItemComposerMap.clear();
  mComposerListWidget->clear();

  QSet<QgsComposer*> composers = QgisApp::instance()->printComposers();
  QSet<QgsComposer*>::const_iterator it = composers.constBegin();
  for ( ; it != composers.constEnd(); ++it )
  {
    QListWidgetItem* item = new QListWidgetItem(( *it )->title(), mComposerListWidget );
    item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable );
    mItemComposerMap.insert( item, *it );
  }
  mComposerListWidget->sortItems();

  // Restore selection
  if ( !selName.isEmpty() )
  {
    QList<QListWidgetItem*> items = mComposerListWidget->findItems( selName, Qt::MatchExactly );
    if ( !items.isEmpty() )
    {
      mComposerListWidget->setCurrentItem( items.first() );
    }
  }
}
开发者ID:Aladar64,项目名称:QGIS,代码行数:27,代码来源:qgscomposermanager.cpp

示例5: QListWidgetItem

void
BCI2000Viewer::FillChannelList()
{
  ui->channelList->blockSignals( true );
  ui->channelList->clear();
  if( mFile.IsOpen() )
  {
    QListWidgetItem* pItem = new QListWidgetItem( tr("States"), ui->channelList );
    pItem->setBackground( cHeadingColor );
    pItem->setFlags( Qt::NoItemFlags );
    const StateList* states = mFile.States();
    for( int i = 0; i < states->Size(); ++i )
    {
      pItem = new QListWidgetItem( ( *states )[ i ].Name().c_str(), ui->channelList );
      pItem->setFlags( Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
    }

    pItem = new QListWidgetItem( tr("Channels"), ui->channelList );
    pItem->setBackground( cHeadingColor );
    pItem->setFlags( Qt::NoItemFlags );
    int base = ui->channelList->count(),
        channelsInFile = mFile.SignalProperties().Channels();
    if( mFile.Parameters()->Exists( "ChannelNames" ) )
    {
      ParamRef ChannelNames = mFile.Parameter( "ChannelNames" );
      for( int i = 0; i < ChannelNames->NumValues() && i < channelsInFile; ++i )
      {
        pItem = new QListWidgetItem( ChannelNames( i ).c_str(), ui->channelList );
        pItem->setFlags( Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
      }
    }
    for( int i = ui->channelList->count() - base; i < channelsInFile; ++i )
    {
      pItem = new QListWidgetItem( QString( tr("Channel %1") ).arg( i + 1 ), ui->channelList );
      pItem->setFlags( Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
    }

    int j = 0;
    for( ++j; j < ui->channelList->count()
              && ( ui->channelList->item( j )->flags() & Qt::ItemIsUserCheckable ); ++j )
      ui->channelList->item( j )->setCheckState( Qt::Unchecked );
    for( ++j; j < ui->channelList->count()
              && ( ui->channelList->item( j )->flags() & Qt::ItemIsUserCheckable ); ++j )
      ui->channelList->item( j )->setCheckState( Qt::Checked );
  }
  ui->channelList->blockSignals( false );
}
开发者ID:ACrazyer,项目名称:NeuralSystemsBCI2000,代码行数:47,代码来源:BCI2000Viewer.cpp

示例6: createIcon

//---------------------------------------------------------------------------------------------------------------------
void ConfigDialog::createIcon(const QString &icon, const QString &text)
{
    QListWidgetItem *button = new QListWidgetItem(contentsWidget);
    button->setIcon(QIcon(icon));
    button->setText(text);
    button->setTextAlignment(Qt::AlignHCenter);
    button->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
}
开发者ID:a-dilla,项目名称:Valentina,代码行数:9,代码来源:configdialog.cpp

示例7: on_add_clicked

void DlgEditListParameter::on_add_clicked()
{
  QListWidgetItem *item = new QListWidgetItem();
	item->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled);
	list->addItem(item);
	list->setCurrentItem(item);
	list->editItem(item);
}
开发者ID:lucciano,项目名称:powerdevs,代码行数:8,代码来源:dlg_edit_list_parameter.cpp

示例8: setValues

/*!
	\details Set the editor values
	\param values The string list to set as values
*/
void StringListEditor::setValues(const QStringList& values) {
	_list->clear();
	foreach ( QString value, values ) {
		QListWidgetItem* it = new QListWidgetItem( value, _list );
		it->setFlags( it->flags() | Qt::ItemIsEditable );
		_list->setCurrentItem( it );
		_list->scrollToItem( it );
	}
开发者ID:jzsun,项目名称:raptor,代码行数:12,代码来源:StringListEditor.cpp

示例9: appendToFileList

//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RicFileHierarchyDialog::appendToFileList(const QString& fileName)
{
    QString itemText = fileName;
    itemText.remove(0, rootDir().size());
    QListWidgetItem* item = new QListWidgetItem(itemText, m_fileList);
    item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
    item->setCheckState(Qt::Checked);
}
开发者ID:joakim-hove,项目名称:ResInsight,代码行数:11,代码来源:RicFileHierarchyDialog.cpp

示例10: addSourcesListItem

void QtShaderWindow::addSourcesListItem(const QString& title, bool isChecked, bool isBuiltIn)
{
    QListWidgetItem* item = new QListWidgetItem(title, m_sourcesListWidget);
    item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
    item->setCheckState(isChecked ? Qt::Checked : Qt::Unchecked);
    item->setData(SOURCES_LIST_BUILT_IN_ROLE, isBuiltIn);
    m_sourcesListWidget->addItem(item);
}
开发者ID:creepydragon,项目名称:r2,代码行数:8,代码来源:QtShaderWindow.cpp

示例11: on_mAddUrlPushButton_clicked

void QgsOptions::on_mAddUrlPushButton_clicked()
{
  QListWidgetItem* newItem = new QListWidgetItem( mExcludeUrlListWidget );
  newItem->setText( "URL" );
  newItem->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
  mExcludeUrlListWidget->addItem( newItem );
  mExcludeUrlListWidget->setCurrentItem( newItem );
}
开发者ID:mmubangizi,项目名称:qgis,代码行数:8,代码来源:qgsoptions.cpp

示例12: QListWidgetItem

QListWidgetItem *TodoProjectSettingsWidget::addToExcludedPatternsList(const QString &pattern)
{
    QListWidgetItem *item = new QListWidgetItem(pattern);
    item->setFlags(item->flags() | Qt::ItemIsEditable);
    prepareItem(item);
    ui->excludedPatternsList->addItem(item);
    return item;
}
开发者ID:DuinoDu,项目名称:qt-creator,代码行数:8,代码来源:todoprojectsettingswidget.cpp

示例13: addListItem

void addListItem(QListWidget* list, const QString& text)
{
    QListWidgetItem* item = new QListWidgetItem();
    item->setText(text);
    item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
    item->setCheckState(Qt::Checked);
    list->addItem(item);
}
开发者ID:jonatanfm,项目名称:tfg,代码行数:8,代码来源:WidgetRecorder.cpp

示例14: createLPanel

void MainWindow::createLPanel() {
    accountWidget = new AccountPage;
    folderWidget = new FolderPage;
    logWidget = new LogPage;
    aboutWidget = new AboutPage;

    ui->lPanelWidget->setViewMode(QListView::IconMode);
    ui->lPanelWidget->setMovement(QListView::Static);
    ui->lPanelWidget->setSpacing(8);

    ui->rPanelWidget->removeWidget(ui->rPanelWidget->widget(1));
    ui->rPanelWidget->removeWidget(ui->rPanelWidget->widget(0));
    ui->rPanelWidget->addWidget(accountWidget);
    ui->rPanelWidget->addWidget(folderWidget);
    ui->rPanelWidget->addWidget(logWidget);
    ui->rPanelWidget->addWidget(aboutWidget);

    QListWidgetItem *account = new QListWidgetItem(ui->lPanelWidget);
    account->setIcon(QIcon(":/resources/account.png"));
    account->setText(tr("Пользователи"));
    account->setTextAlignment(Qt::AlignHCenter);
    account->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);

    QListWidgetItem *folder = new QListWidgetItem(ui->lPanelWidget);
    folder->setIcon(QIcon(":/resources/folder.png"));
    folder->setText(tr("Расшаренная \nпапка"));
    folder->setTextAlignment(Qt::AlignHCenter);
    folder->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);

    QListWidgetItem *logging = new QListWidgetItem(ui->lPanelWidget);
    logging->setIcon(QIcon(":/resources/log.png"));
    logging->setText(tr("Логирование"));
    logging->setTextAlignment(Qt::AlignHCenter);
    logging->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);

    QListWidgetItem *about = new QListWidgetItem(ui->lPanelWidget);
    about->setIcon(QIcon(":/resources/info.png"));
    about->setText(tr("О программе..."));
    about->setTextAlignment(Qt::AlignHCenter);
    about->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);

    connect(ui->lPanelWidget,
            SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
            this, SLOT(changePage(QListWidgetItem*,QListWidgetItem*)));
}
开发者ID:mrProper-666,项目名称:FtpServer,代码行数:45,代码来源:mainwindow.cpp

示例15: fillWidget

void medPacsSelector::fillWidget( QList<QVariant> nodes )
{
    d->selectionList->clear();
    foreach(QVariant node, nodes)
    {
        QListWidgetItem* myItem = new QListWidgetItem(node.toStringList().at(0),d->selectionList);
        myItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
        myItem->setCheckState(Qt::Checked);
    }
开发者ID:medInria,项目名称:medInria-public,代码行数:9,代码来源:medPacsSelector.cpp


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