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; }
void TodoProjectSettingsWidget::excludedPatternChanged(QListWidgetItem *item) { if (item->text().isEmpty() || item->text() == excludePlaceholder()) { ui->excludedPatternsList->removeItemWidget(item); delete item; } else { prepareItem(item); } saveSettings(); ui->excludedPatternsList->setCurrentItem(nullptr); }
void scene::mousePressEvent(QGraphicsSceneMouseEvent *event) { if(event->button()==Qt::LeftButton and currenttool!=-1) { bool check=false; for(int i=0;i<handles.size();i++) { if(handles.at(i)->contains(event->scenePos())) check=true; } if(!check) prepareItem(event->scenePos().toPoint()); else { prepareMove(event->scenePos().toPoint()); } } }