File indexing completed on 2024-12-22 04:18:19
0001 /*************************************************************************** 0002 * * 0003 * copyright : (C) 2007 The University of Toronto * 0004 * netterfield@astro.utoronto.ca * 0005 * * 0006 * This program is free software; you can redistribute it and/or modify * 0007 * it under the terms of the GNU General Public License as published by * 0008 * the Free Software Foundation; either version 2 of the License, or * 0009 * (at your option) any later version. * 0010 * * 0011 ***************************************************************************/ 0012 0013 #ifndef __QNX__ 0014 #include "widgets.h" 0015 0016 namespace Kst { 0017 0018 Widgets::Widgets(QObject *parent) 0019 : QObject(parent) { 0020 _plugins.append(new ColorButtonPlugin(this)); 0021 _plugins.append(new DataSourceSelectorPlugin(this)); 0022 _plugins.append(new GradientEditorPlugin(this)); 0023 _plugins.append(new FileRequesterPlugin(this)); 0024 _plugins.append(new ComboBoxPlugin(this)); 0025 _plugins.append(new DataRangePlugin(this)); 0026 _plugins.append(new CurveSelectorPlugin(this)); 0027 _plugins.append(new VectorSelectorPlugin(this)); 0028 _plugins.append(new MatrixSelectorPlugin(this)); 0029 _plugins.append(new ScalarSelectorPlugin(this)); 0030 _plugins.append(new StringSelectorPlugin(this)); 0031 _plugins.append(new CurvePlacementPlugin(this)); 0032 _plugins.append(new CurveAppearancePlugin(this)); 0033 _plugins.append(new FFTOptionsPlugin(this)); 0034 _plugins.append(new ColorPalettePlugin(this)); 0035 _plugins.append(new LabelBuilderPlugin(this)); 0036 _plugins.append(new LabelLineEditPlugin(this)); 0037 } 0038 0039 0040 Widgets::~Widgets() { 0041 } 0042 0043 0044 WidgetPlugin::WidgetPlugin(QObject *parent) 0045 : QObject(parent), _initialized(false) { 0046 } 0047 0048 0049 WidgetPlugin::~WidgetPlugin() { 0050 } 0051 0052 0053 QString WidgetPlugin::group() const { 0054 return tr("Kst Widgets"); 0055 } 0056 0057 0058 QString WidgetPlugin::toolTip() const { 0059 return QString(); 0060 } 0061 0062 0063 QString WidgetPlugin::whatsThis() const { 0064 return QString(); 0065 } 0066 0067 0068 QString WidgetPlugin::instanceName() const { 0069 //QString name = static_cast<const QDesignerCustomWidgetInterface*>(this)->name().replace("", ""); 0070 QString name = static_cast<const QDesignerCustomWidgetInterface*>(this)->name(); 0071 QChar camel = name.at(0).toLower(); 0072 return name.replace(0,1,camel.toLower()); 0073 } 0074 0075 0076 QString WidgetPlugin::includeFile() const { 0077 return instanceName().toLower() + ".h"; 0078 } 0079 0080 0081 QString WidgetPlugin::domXml() const { 0082 QString name = static_cast<const QDesignerCustomWidgetInterface*>(this)->name(); 0083 return QString::fromUtf8("<widget class=\"%1\" name=\"%2\"/>") 0084 .arg(name).arg(instanceName()); 0085 } 0086 0087 0088 bool WidgetPlugin::isContainer() const { 0089 return false; 0090 } 0091 0092 0093 bool WidgetPlugin::isInitialized() const { 0094 return _initialized; 0095 } 0096 0097 0098 QIcon WidgetPlugin::icon() const { 0099 return QIcon(); 0100 } 0101 0102 0103 void WidgetPlugin::initialize(QDesignerFormEditorInterface *) { 0104 if (_initialized) 0105 return; 0106 0107 _initialized = true; 0108 } 0109 0110 Q_EXPORT_PLUGIN2(widgets, Widgets) 0111 0112 } 0113 0114 #endif // __QNX__ 0115 0116 // vim: ts=2 sw=2 et