本文整理汇总了C++中QTableWidgetItem::checkState方法的典型用法代码示例。如果您正苦于以下问题:C++ QTableWidgetItem::checkState方法的具体用法?C++ QTableWidgetItem::checkState怎么用?C++ QTableWidgetItem::checkState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTableWidgetItem
的用法示例。
在下文中一共展示了QTableWidgetItem::checkState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateSelectAllColumn
void StochasticProcessWidget::updateSelectAllColumn(
int index) {
bool allChecked = true;
bool allUnchecked = true;
for (int i = 0; i <= 2; i++) {
QTableWidgetItem *item = distGraphTable->item(
i, index);
if (item) {
bool isChecked = item->checkState()
== Qt::Checked;
bool isPartiallyChecked =
item->checkState()
== Qt::PartiallyChecked;
allChecked = allChecked && isChecked
&& !isPartiallyChecked;
allUnchecked = allUnchecked && !isChecked
&& !isPartiallyChecked;
}
}
QTableWidgetItem *selectAllItem =
distGraphTable->item(5, index);
if (selectAllItem) {
if (allChecked) {
selectAllItem->setCheckState(Qt::Checked);
} else if (allUnchecked) {
selectAllItem->setCheckState(Qt::Unchecked);
} else {
selectAllItem->setCheckState(Qt::PartiallyChecked);
}
}
}
示例2: cellChangedSlot
void LiveEventControl::cellChangedSlot(int row, int column)
{
QTableWidgetItem *item = m_ui->panelTableWidget->item(row, column);
if (column == 0) { // Visible
emit setPanelVisible(row, item->checkState() == Qt::Checked);
}
else if (column == 2) { // Loop
emit loopPanel(row, item->checkState() == Qt::Checked);
}
else if (column == 4) { // Name
emit setPanelNameSignal(row, item->data(Qt::DisplayRole).toString());
}
}
示例3: createChartTable
bool ChartEditorWindow::createChartTable(){
bool ok;
QStringList selectedLayers;
// create table using the currently selected layers
for(int i=0; i < m_ui->tableWidgetSelect->rowCount(); i++){
QTableWidgetItem *item = m_ui->tableWidgetSelect->item(0, i);
if(item->checkState() == Qt::Checked)
selectedLayers << item->text();
}
chartTable.setSettings(chartTableSettings);
this->lvi = chartTable.generateLayerVisualInfoForAllTables(selectedLayers, &ok);
if(!ok){
showStatus("Error creating chart table.");
return false;
}
showChartTable();
//showLayers(); // don't update! must be selected before generation
showStatus("Generated chart table");
m_ui->actionSave->setEnabled(true);
m_ui->actionSaveAs->setEnabled(true);
return true;
}
示例4: syncMappingSettings
void MainSettingsDialog::syncMappingSettings()
{
settings->beginGroup("Mappings");
settings->remove("");
for (int i=0; i < ui->controllerMappingsTableWidget->rowCount(); i++)
{
QTableWidgetItem *itemGUID = ui->controllerMappingsTableWidget->item(i, 0);
QTableWidgetItem *itemMapping = ui->controllerMappingsTableWidget->item(i, 1);
QTableWidgetItem *itemDisable = ui->controllerMappingsTableWidget->item(i, 2);
if (itemGUID && !itemGUID->text().isEmpty() && itemDisable)
{
bool disableController = itemDisable->checkState() == Qt::Checked ? true : false;
if (itemMapping && !itemMapping->text().isEmpty())
{
settings->setValue(itemGUID->text(), itemMapping->text());
}
settings->setValue(QString("%1Disable").arg(itemGUID->text()), disableController);
}
}
settings->endGroup();
}
示例5: cellChangedSlot
void LandmarkRegistrationWidget::cellChangedSlot(int row, int column)
{
QTableWidgetItem* item = mLandmarkTableWidget->item(row, column);
QString uid = item->data(Qt::UserRole).toString();
if (column == 0)
{
QString name = item->text();
mServices->patient()->setLandmarkName(uid, name);
}
if (column == 1)
{
Qt::CheckState state = item->checkState();
mServices->patient()->setLandmarkActive(uid, state == Qt::Checked);
this->performRegistration(); // automatic when changing active state (Mantis #0000674)s
}
if (column == 2)
{
QString val = item->text();
// remove formatting stuff:
val = val.replace('(', " ");
val = val.replace(')', " ");
val = val.replace(',', " ");
Transform3D rMtarget = this->getTargetTransform();
Vector3D p_r = Vector3D::fromString(val);
Vector3D p_target = rMtarget.inv().coord(p_r);
this->setTargetLandmark(uid, p_target);
}
}
示例6: getVis
bool TToolbarEditor::getVis(int row, int col) {
QTableWidgetItem* item = active_actions_table->item(row, col);
if (item)
return item->checkState() != Qt::Unchecked;
return true;
}
示例7: slotUpdateLocalIgnoreList
void IgnoreListEditor::slotUpdateLocalIgnoreList()
{
ConfigFile cfgFile;
QString ignoreFile = cfgFile.excludeFile(ConfigFile::UserScope);
QFile ignores(ignoreFile);
if (ignores.open(QIODevice::WriteOnly)) {
for(int row = 0; row < ui->tableWidget->rowCount(); ++row) {
QTableWidgetItem *patternItem = ui->tableWidget->item(row, patternCol);
QTableWidgetItem *deletableItem = ui->tableWidget->item(row, deletableCol);
if (patternItem->flags() & Qt::ItemIsEnabled) {
QByteArray prepend;
if (deletableItem->checkState() == Qt::Checked) {
prepend = "]";
}
ignores.write(prepend+patternItem->text().toUtf8()+'\n');
}
}
// We need to force a remote discovery after a change of the ignore list.
// Otherwise we would not download the files/directories that are no longer
// ignored (because the remote etag did not change) (issue #3172)
foreach (Folder* folder, FolderMan::instance()->map()) {
folder->journalDb()->forceRemoteDiscoveryNextSync();
}
} else {
示例8: getSelectedSeries
// ------------------------------------------------------------------------
void DicomParser::getSelectedSeries(DicomSeriesList & selectedSeries)
{
for(unsigned int i = 0; i < seriesAgain.size(); i++)
{
QTableWidgetItem * item = table->item(i,4);
if(item->checkState() == Qt::Checked)
selectedSeries.push_back(seriesAgain[i]);
}
}
示例9: GetSelectedStockInfoList
bool tcStockSelectDialog::GetSelectedStockInfoList(tcStockInfoList &pStockInfoList)
{
int i;
for (i=0; i<tbl1->rowCount(); i++) {
QTableWidgetItem *item = tbl1->item(i, 0);
Q_ASSERT(item);
if (item->checkState() == Qt::Checked) {
tcStockInfo info = mViewStockInfoList[i];
pStockInfoList.append(info);
}
}
return true;
}
示例10: IsFavorite
bool tAllChannelStatus::IsFavorite(const int focusRow)
{
QTableWidgetItem* widget = item(focusRow, FAV_COLUMN);
if (widget)
{
return(widget->checkState() == Qt::Checked);
}
else
{
return(false); //just do something for now
}
}
示例11: updateSelectAllRow
void StochasticProcessWidget::updateSelectAllRow(
int index) {
if (index == 3) {
return;
}
bool allChecked = true;
bool allUnchecked = true;
int columnCount = distGraphTable->columnCount();
for (int i = 0; i <= columnCount - 2; i++) {
QTableWidgetItem *item = distGraphTable->item(
index, i);
if (item) {
bool isChecked = item->checkState()
== Qt::Checked;
bool isPartiallyChecked =
item->checkState()
== Qt::PartiallyChecked;
allChecked = allChecked && isChecked
&& !isPartiallyChecked;
allUnchecked = allUnchecked && !isChecked
&& !isPartiallyChecked;
}
}
QTableWidgetItem
*selectAllItem = distGraphTable->item(
index, columnCount - 1);
if (selectAllItem) {
if (allChecked) {
selectAllItem->setCheckState(Qt::Checked);
} else if (allUnchecked) {
selectAllItem->setCheckState(Qt::Unchecked);
} else {
selectAllItem->setCheckState(Qt::PartiallyChecked);
}
}
}
示例12: delButtonClicked
void RoomsDialog::delButtonClicked()
{
int s = this->m_tableWidget->rowCount();
QList<int> ids = QList<int>();
for (int i = 0; i < s; ++i) {
QTableWidgetItem *item = this->m_tableWidget->item(i, 4);
if (item->checkState() == Qt::Checked) {
int id = this->m_tableWidget->item(i, 0)->text().toInt();
ids.append(id);
}
}
gdata->deleteRooms(ids);
}
示例13: tableCellChanged
void rtCathDataObject::tableCellChanged(int row, int col) {
// Is it one of the check boxes?
if(col == 0) {
QTableWidgetItem* item = m_cathGuiSetup.pointsTable->item(row, col);
QTableWidgetItem* itemID = m_cathGuiSetup.pointsTable->item(row, col+1);
if (!item || !itemID) return;
int id=0;
bool ok=false;
id = itemID->text().toInt(&ok);
if ( ok ) {
if (item->checkState()==Qt::Checked) {
item->setText("ON");
item->setCheckState(Qt::Checked);
// Get from the discard pile...
if(m_discardCoilList.contains(id)) {
m_coilList.insert(id, m_discardCoilList.take(id));
m_coilList[id].visible = true;
m_coilLocations.insert(m_coilList[id].locationID, id);
}
} else if (item->checkState()==Qt::Unchecked) {
item->setText("OFF");
item->setCheckState(Qt::Unchecked);
if (m_coilList.contains(id)) {
// Send to discard pile...
m_coilList[id].visible = false;
m_coilLocations.remove(m_coilList[id].locationID, id);
m_discardCoilList.insert(id, m_coilList.take(id));
}
}
Modified();
}
}
}
示例14: slot_save
/* Called to save data to the configuration file. */
void SettingsPagePointDataLoading::slot_save()
{
QStringList files;
if( m_fileTable->item( 0, 0 )->checkState() == Qt::Checked )
{
// All files are selected.
files << "All";
}
else
{
// Store only checked file items.
for( int i = 1; i < m_fileTable->rowCount(); i++ )
{
QTableWidgetItem* item = m_fileTable->item( i, 0 );
if( item->checkState() == Qt::Checked )
{
files << item->text();
}
}
}
QStringList oldFiles = GeneralConfig::instance()->getOpenAipPoiFileList();
// save the new file list
GeneralConfig::instance()->setOpenAipPoiFileList( files );
// Check, if file list has been modified
if( oldFiles.size() != files.size() )
{
// List size is different, emit signal.
emit fileListChanged();
}
else
{
// The list size is equal, we have to check every single list element.
// Note that the lists are always sorted.
for( int i = 0; i < files.size(); i++ )
{
if( files.at(i) != oldFiles.at(i) )
{
// File names are different, emit signal.
emit fileListChanged();
break;
}
}
}
close();
}
示例15: OnButtonClickOk
void SporadicFrameEditDlg::OnButtonClickOk()
{
if ( 0 == nValidateValues() )
{
IFrame* pFrame;
LinFrameProps ouFrameProps;
ouFrameProps.m_eLinFrameType = eLinInvalidFrame;
if ( eEdit == m_ouMode )
{
pFrame = *m_pouFrame;
}
else
{
m_pLdfCluster->CreateElement(eFrameElement, (IElement**)&pFrame);
*m_pouFrame = pFrame;
}
if ( nullptr != pFrame )
{
pFrame->GetProperties(ouFrameProps);
//Frame Type
ouFrameProps.m_eLinFrameType = eLinSporadicFrame;
ouFrameProps.m_ouLINSporadicFrameProps.m_pouUnconditionalFrame.clear();
//Conditional Frames
int nRow = ui.tableFrames->rowCount();
IFrame* pouTempFrame;
for ( int i = 0 ; i < nRow; i++ )
{
QTableWidgetItem* pItem = ui.tableFrames->item(i, 0);
UID_ELEMENT uid = pItem->data(Qt::UserRole).value<UID_ELEMENT>();
if ( Qt::Checked == pItem->checkState() )
{
m_pLdfCluster->GetElement(eFrameElement, uid, (IElement**)&pouTempFrame);
if ( nullptr != pouTempFrame )
{
ouFrameProps.m_ouLINSporadicFrameProps.m_pouUnconditionalFrame[uid] = uid;
}
}
}
pFrame->SetProperties(ouFrameProps);
//Frame Name
pFrame->SetName(ui.editFrameName->text().toStdString());
}
LDFDatabaseManager::GetDatabaseManager()->setDocumentModified(true);
accept();
}
}