File indexing completed on 2024-05-26 04:27:27
0001 /* 0002 * SPDX-FileCopyrightText: 2016 Dmitry Kazakov <dimula73@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "kis_combo_based_paintop_property.h" 0008 #include "kis_paintop_settings.h" 0009 0010 #include "QIcon" 0011 0012 0013 struct KisComboBasedPaintOpProperty::Private 0014 { 0015 QList<QString> items; 0016 QList<QIcon> icons; 0017 }; 0018 0019 KisComboBasedPaintOpProperty::KisComboBasedPaintOpProperty(const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent) 0020 : KisUniformPaintOpProperty(Combo, id, settings, parent) 0021 , m_d(new Private) 0022 { 0023 } 0024 0025 KisComboBasedPaintOpProperty::KisComboBasedPaintOpProperty(Type type, const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent) 0026 : KisUniformPaintOpProperty(Combo, id, settings, parent) 0027 , m_d(new Private) 0028 { 0029 KIS_ASSERT_RECOVER_RETURN(type == Combo); 0030 } 0031 0032 KisComboBasedPaintOpProperty::KisComboBasedPaintOpProperty(Type type, SubType subType, const KoID &id, KisPaintOpSettingsRestrictedSP settings, QObject *parent) 0033 : KisUniformPaintOpProperty(Combo, subType, id, settings, parent) 0034 , m_d(new Private) 0035 { 0036 KIS_ASSERT_RECOVER_RETURN(type == Combo); 0037 } 0038 0039 KisComboBasedPaintOpProperty::~KisComboBasedPaintOpProperty() 0040 { 0041 } 0042 0043 QList<QString> KisComboBasedPaintOpProperty::items() const 0044 { 0045 return m_d->items; 0046 } 0047 0048 void KisComboBasedPaintOpProperty::setItems(const QList<QString> &list) 0049 { 0050 m_d->items = list; 0051 } 0052 0053 QList<QIcon> KisComboBasedPaintOpProperty::icons() const 0054 { 0055 return m_d->icons; 0056 } 0057 0058 void KisComboBasedPaintOpProperty::setIcons(const QList<QIcon> &list) 0059 { 0060 m_d->icons = list; 0061 } 0062 0063 #include "kis_callback_based_paintop_property_impl.h" 0064 template class KRITAIMAGE_EXPORT_INSTANCE 0065 KisCallbackBasedPaintopProperty<KisComboBasedPaintOpProperty>;