Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_wdg_random_pick.cpp
Go to the documentation of this file.
1/*
2 * This file is part of Krita
3 *
4 * SPDX-FileCopyrightText: 2006 Cyrille Berger <cberger@cberger.net>
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
10
11
12#include <QLayout>
13
16
17#include "ui_wdgrandompickoptions.h"
18
19KisWdgRandomPick::KisWdgRandomPick(KisFilter* /*nfilter*/, QWidget* parent)
20 : KisConfigWidget(parent)
21{
22 m_widget = new Ui_WdgRandomPickOptions();
23 m_widget->setupUi(this);
24
25 connect(widget()->intLevel, SIGNAL(valueChanged(int)), SIGNAL(sigConfigurationItemChanged()));
26 connect(widget()->intWindowSize, SIGNAL(valueChanged(int)), SIGNAL(sigConfigurationItemChanged()));
27 connect(widget()->intOpacity, SIGNAL(valueChanged(int)), SIGNAL(sigConfigurationItemChanged()));
28 m_seedH = rand();
29 m_seedV = rand();
30 m_seedThreshold = rand();
31}
32
37
39{
40 QVariant value;
41 if (config->getProperty("level", value)) {
42 widget()->intLevel->setValue(value.toUInt());
43 }
44 if (config->getProperty("windowsize", value)) {
45 widget()->intWindowSize->setValue(value.toUInt());
46 }
47 if (config->getProperty("opacity", value)) {
48 widget()->intOpacity->setValue(value.toUInt());
49 }
50}
51
52
54{
56 config->setProperty("level", this->widget()->intLevel->value());
57 config->setProperty("windowsize", this->widget()->intWindowSize->value());
58 config->setProperty("opacity", this->widget()->intOpacity->value());
59 config->setProperty("seedH", m_seedH);
60 config->setProperty("seedV", m_seedV);
61 config->setProperty("seedThreshold", m_seedThreshold);
62 return config;
63}
64
65
float value(const T *src, size_t ch)
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void sigConfigurationItemChanged()
static KisResourcesInterfaceSP instance()
KisWdgRandomPick(KisFilter *nfilter, QWidget *parent=0)
const Ui_WdgRandomPickOptions * widget() const
Ui_WdgRandomPickOptions * m_widget
KisPropertiesConfigurationSP configuration() const override
void setConfiguration(const KisPropertiesConfigurationSP) override