Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_brush_hud_properties_list.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8
9
13
15 : QListWidget(parent),
16 m_d(new Private)
17{
18 setDragDropMode(QAbstractItemView::DragDrop);
19 setDefaultDropAction(Qt::MoveAction);
20}
21
25
27{
28 Q_FOREACH (KisUniformPaintOpPropertySP prop, properties) {
29 QListWidgetItem *item = new QListWidgetItem(prop->name(), this);
30 item->setData(Qt::UserRole, prop->id());
31 addItem(item);
32 }
33}
34
36{
38
39 for (int i = 0; i < count(); i++) {
40 ids << item(i)->data(Qt::UserRole).toString();
41 }
42
43 return ids;
44}
45
47{
48 // we cannot change drop actions to Move only! It stops working
49 // for some reason :(
50 return QListWidget::supportedDropActions();
51}
Qt::DropActions supportedDropActions() const override
QList< QString > selectedPropertiesIds() const
void addProperties(const QList< KisUniformPaintOpPropertySP > &properties)