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 int index = 0;
29 Q_FOREACH (KisUniformPaintOpPropertySP prop, properties) {
30 QListWidgetItem *item = new QListWidgetItem(prop->name(), this);
31 item->setData(Qt::UserRole, prop->id());
32 addItem(item);
33 index++;
34 }
35}
36
38{
40
41 for (int i = 0; i < count(); i++) {
42 ids << item(i)->data(Qt::UserRole).toString();
43 }
44
45 return ids;
46}
47
49{
50 // we cannot change drop actions to Move only! It stops working
51 // for some reason :(
52 return QListWidget::supportedDropActions();
53}
Qt::DropActions supportedDropActions() const override
QList< QString > selectedPropertiesIds() const
void addProperties(const QList< KisUniformPaintOpPropertySP > &properties)