/* * Copyright 2009 by Alan Alpert * Copyright 2010 by Ménard Alexis * Copyright 2010 by Marco Martin * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "graphicswidgetsbindingsplugin.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "declarativetabbar.h" SignalPlotter::SignalPlotter(QGraphicsItem *parent) : Plasma::SignalPlotter(parent) {} SignalPlotter::~SignalPlotter() {} void SignalPlotter::addSample(const QVariantList &samples) { QList doubleSamples; foreach (const QVariant &sampleItem, samples) { doubleSamples << sampleItem.toDouble(); } if (plotColors().size() == doubleSamples.size()) { Plasma::SignalPlotter::addSample(doubleSamples); } } void GraphicsWidgetsBindingsPlugin::registerTypes(const char *uri) { Q_ASSERT(uri == QLatin1String("org.kde.plasma.graphicswidgets")); qmlRegisterType(uri, 0, 1, "TabBar"); qmlRegisterType(uri, 0, 1, "SignalPlotter"); qmlRegisterType(uri, 0, 1, "BusyWidget"); qmlRegisterType(uri, 0, 1, "CheckBox"); qmlRegisterType(uri, 0, 1, "ComboBox"); qmlRegisterType(uri, 0, 1, "FlashingLabel"); qmlRegisterType(uri, 0, 1, "Frame"); qmlRegisterType(uri, 0, 1, "GroupBox"); qmlRegisterType(uri, 0, 1, "IconWidget"); qmlRegisterType(uri, 0, 1, "ItemBackground"); qmlRegisterType(uri, 0, 1, "Label"); qmlRegisterType(uri, 0, 1, "LineEdit"); qmlRegisterType(uri, 0, 1, "Meter"); qmlRegisterType(uri, 0, 1, "PushButton"); qmlRegisterType(uri, 0, 1, "RadioButton"); qmlRegisterType(uri, 0, 1, "ScrollBar"); qmlRegisterType(uri, 0, 1, "ScrollWidget"); qmlRegisterType(uri, 0, 1, "Separator"); qmlRegisterType(uri, 0, 1, "Slider"); qmlRegisterType(uri, 0, 1, "SpinBox"); qmlRegisterType(uri, 0, 1, "SvgWidget"); qmlRegisterType(uri, 0, 1, "TextBrowser"); qmlRegisterType(uri, 0, 1, "TextEdit"); qmlRegisterType(uri, 0, 1, "ToolButton"); qmlRegisterType(uri, 0, 1, "TreeView"); qmlRegisterType(uri, 0, 1, "VideoWidget"); qmlRegisterType(uri, 0, 1, "WebView"); } #include "graphicswidgetsbindingsplugin.moc"