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


C++ QCheckBox::installEventFilter方法代码示例

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


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

示例1: updateTable

void AssociationsDialog::updateTable(int index)
{
	Table *t = findTable(index);
	if (!t)
		return;

	if (active_table != t){
		active_table = t;
		tableCaptionLabel->setText(t->objectName());
		table->clearContents();
		table->setRowCount(t->numCols());

		QStringList colNames = t->colNames();
		for (int i=0; i<table->rowCount(); i++ ){
			QTableWidgetItem *cell = new QTableWidgetItem(colNames[i].replace(",", "."));
			cell->setBackground (QBrush(Qt::lightGray));
			cell->setFlags (Qt::ItemIsEnabled);
			table->setItem(i, 0, cell);
			}

		for (int j=1; j < table->columnCount(); j++){
			for (int i=0; i < table->rowCount(); i++ )
				{
				QTableWidgetItem *cell = new QTableWidgetItem();
				cell->setBackground (QBrush(Qt::lightGray));
				table->setItem(i, j, cell);

				QCheckBox* cb = new QCheckBox(table);
				cb->installEventFilter(this);
				table->setCellWidget(i, j, cb);
				}
			}
		}
	updateColumnTypes();
}
开发者ID:kuzavas,项目名称:qtiplot,代码行数:35,代码来源:AssociationsDialog.cpp

示例2: updateDefaultFiltersActivation

void FilterWindow::updateDefaultFiltersActivation(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> & roles)
{
    Q_UNUSED(topLeft);
    Q_UNUSED(bottomRight);
    Q_UNUSED(roles);

    QList<FilterData> allFilters = m_pFilterDataModel->data(m_pFilterDataModel->index(0,9), FilterDataModelRoles::GetAllFilters).value<QList<FilterData> >();

    if(m_lActivationCheckBoxList.size()==allFilters.size())
        return;

    while(!ui->m_layout_defaultFilterActivation->isEmpty())
        ui->m_layout_defaultFilterActivation->removeItem(ui->m_layout_defaultFilterActivation->itemAt(0));

    m_lActivationCheckBoxList.clear();

    for(int i = 0; i<allFilters.size(); i++) {
        //Check for user designed filter. This needs to be done because there only should be one filter in the model which holds the user designed filter.
        //Otherwise everytime a filter is designed a new filter would be added to this model -> too much storage consumption.
        if(allFilters.at(i).m_sName != "User Design") {
            QCheckBox *checkBox = new QCheckBox(allFilters.at(i).m_sName);
            connect(checkBox,&QCheckBox::toggled,
                        this,&FilterWindow::onChkBoxFilterActivation);

            checkBox->installEventFilter(this);

            m_lActivationCheckBoxList.append(checkBox);

            ui->m_layout_defaultFilterActivation->addWidget(checkBox);
        } else {
            QCheckBox *checkBox = new QCheckBox("Activate user designed filter");
            connect(checkBox,&QCheckBox::toggled,
                        this,&FilterWindow::onChkBoxFilterActivation);

            checkBox->installEventFilter(this);

            m_lActivationCheckBoxList.prepend(checkBox);

            ui->m_layout_designFilter->addWidget(checkBox,6,0,2,2);
        }
    }

    emit activationCheckBoxListChanged(m_lActivationCheckBoxList);
}
开发者ID:gitter-badger,项目名称:mne-cpp,代码行数:44,代码来源:filterwindow.cpp

示例3: QCheckBox

QWidget *DelegateInfoCheckBox::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
    if(index.column() == 0){
        return NULL;
    }

    QCheckBox *editor = new QCheckBox(parent);
    editor->installEventFilter(const_cast<DelegateInfoCheckBox*>(this));

//     return editor;
    return NULL;
}
开发者ID:maluginp,项目名称:tsunami-optimus,代码行数:12,代码来源:delegateinfocheckbox.cpp

示例4: QCheckBox

QCheckBox *OptionsPopup::createCheckboxForCommand(Id id)
{
    QAction *action = ActionManager::command(id)->action();
    QCheckBox *checkbox = new QCheckBox(action->text());
    checkbox->setToolTip(action->toolTip());
    checkbox->setChecked(action->isChecked());
    checkbox->setEnabled(action->isEnabled());
    checkbox->installEventFilter(this); // enter key handling
    QObject::connect(checkbox, &QCheckBox::clicked, action, &QAction::setChecked);
    QObject::connect(action, &QAction::changed, this, &OptionsPopup::actionChanged);
    m_checkboxMap.insert(action, checkbox);
    return checkbox;
}
开发者ID:AgnosticPope,项目名称:qt-creator,代码行数:13,代码来源:findtoolbar.cpp


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