Пример #1
0
void OBSBasicFilters::EditItem(QListWidgetItem *item, bool async)
{
	Qt::ItemFlags flags = item->flags();
	OBSSource filter    = item->data(Qt::UserRole).value<OBSSource>();
	const char *name    = obs_source_get_name(filter);
	QListWidget *list   = async ? ui->asyncFilters : ui->effectFilters;

	item->setText(QT_UTF8(name));
	item->setFlags(flags | Qt::ItemIsEditable);
	list->removeItemWidget(item);
	list->editItem(item);
	item->setFlags(flags);
}
Пример #2
0
void MainWindow::on_addButton_clicked()
{
    QListWidget *list = ui->taskList;
    QListWidgetItem *item = createListItem(QVariant(), tr("New Task"));
    list->editItem(item);
}