Filters configuration
Boudewijn Rempt
boud at valdyas.org
Mon Oct 17 16:33:23 CEST 2005
On Sunday 16 October 2005 18:48, Cyrille Berger wrote:
> Hello,
>
> I have the feeling, for sometime, that we could do better for
> filtersconfiguration than what we are doing.
I agree here, but let's take a step back and enumerate the requirements for
filter configuration
* Support an arbitrary number of named parameters with a large set of types.
* We must be able to map between configuration parameters and a .ui defined
gui.
* Must be loaded and saved into and from an XML representation (for adjustment
layers)
* We must be able to separate the gui and the configuration if we want to make
it possible to run Krita as a commandline application without a gui -- which
is something I'm already being asked about.
* Make it as easy as possible to use the configuration object, preferably
making it a blackbox.
I want to get rid of the automatically created filter gui's since they are
never as pretty as hand-crafted .ui files.
So, I'd rather have something like
KisFilterConfiguration {
setGroup (const QString & group);
QString group();
QVariant readEntry(const QString & key, QVariant default);
void writeEntry(const QString & key, QVariant value);
QStringList listKeys();
QDom getXML();
void setXML(const QDom &);
};
KisFilterWidget {
// The page is the ui file, with the widget names mapped to the names
KisFilterWidget(QWidget * page);
// Set the filter configuration: we loop over all keys in the cfg and
// try to find the corresponding widget and set the right value.
setFilterConfig(KisFilterConfiguration * cfg);
}
This is a bit simpler, and if there are complex interdependencies between
values in the widget, the filter can subclass the .ui file and code the
interdependencies.
--
Boudewijn Rempt
http://www.valdyas.org/fading/index.cgi
More information about the kimageshop
mailing list