本文整理汇总了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();
}
示例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);
}
示例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;
}
示例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;
}