2 * This file is part of jSpeed.
4 * jSpeed is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * jSpeed is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with jSpeed. If not, see <http://www.gnu.org/licenses/>.
19 #include <QtCore/QString>
20 #include <QtGui/QGraphicsItem>
22 #include "dropshadoweffect.h"
23 #include "blureffect.h"
24 #include "opacityeffect.h"
31 Effect* Effect::getEffect(QString const& name)
33 if(name == "dropshadow")
35 return new DropshadowEffect;
37 else if(name == "blur")
39 return new BlurEffect;
41 else if(name == "opacity")
43 return new OpacityEffect;
49 int Effect::getAttribute(QString const& name,
51 const Effect::AttributeDetails details[],
55 QString lower = name.toLower();
57 for(int i = 0; i < count; i++)
59 if(details[i].name == lower)
61 if(!details[i].isQreal)
68 double tmp = value.toDouble(&ok);
72 realValue = static_cast<qreal>(tmp);