[Kst] branches/work/kst/pluginify/kst/src/libkstapp
Adam Treat
treat at kde.org
Tue Sep 19 01:10:02 CEST 2006
SVN commit 586193 by treat:
* Find and Edit the newly created widgets
M +89 -0 kstbasicdialog_i.cpp
M +10 -0 kstbasicdialog_i.h
--- branches/work/kst/pluginify/kst/src/libkstapp/kstbasicdialog_i.cpp #586192:586193
@@ -253,6 +253,75 @@
//Update the various widgets...
+ //input vectors...
+ QStringList iv = ptr->inputVectors();
+ QStringList::ConstIterator ivI = iv.begin();
+ for (; ivI != iv.end(); ++ivI) {
+ KstVectorPtr p = ptr->inputVector(*ivI);
+ QString t = p ? p->tagName() : QString::null;
+ if (VectorSelector *w = vector(*ivI)) {
+ w->setSelection(t);
+ }
+ }
+
+ //input scalars...
+ QStringList is = ptr->inputScalars();
+ QStringList::ConstIterator isI = is.begin();
+ for (; isI != is.end(); ++isI) {
+ KstScalarPtr p = ptr->inputScalar(*isI);
+ QString t = p ? p->tagName() : QString::null;
+ if (ScalarSelector *w = scalar(*isI)) {
+ w->setSelection(t);
+ }
+ }
+
+ //input strings...
+ QStringList istr = ptr->inputStrings();
+ QStringList::ConstIterator istrI = istr.begin();
+ for (; istrI != istr.end(); ++istrI) {
+ KstStringPtr p = ptr->inputString(*istrI);
+ QString t = p ? p->tagName() : QString::null;
+ if (StringSelector *w = string(*istrI)) {
+ w->setSelection(t);
+ }
+ }
+
+ //output vectors...
+ QStringList ov = ptr->outputVectors();
+ QStringList::ConstIterator ovI = ov.begin();
+ for (; ovI != ov.end(); ++ovI) {
+ KstVectorPtr p = ptr->outputVector(*ovI);
+ QString t = p ? p->tagName() : QString::null;
+ if (QLineEdit *w = output(*ovI)) {
+ w->setText(t);
+ w->setEnabled(false);
+ }
+ }
+
+ //output scalars...
+ QStringList os = ptr->outputScalars();
+ QStringList::ConstIterator osI = os.begin();
+ for (; osI != os.end(); ++osI) {
+ KstScalarPtr p = ptr->outputScalar(*osI);
+ QString t = p ? p->tagName() : QString::null;
+ if (QLineEdit *w = output(*osI)) {
+ w->setText(t);
+ w->setEnabled(false);
+ }
+ }
+
+ //ouput strings...
+ QStringList ostr = ptr->outputStrings();
+ QStringList::ConstIterator ostrI = ostr.begin();
+ for (; ostrI != ostr.end(); ++ostrI) {
+ KstStringPtr p = ptr->outputString(*ostrI);
+ QString t = p ? p->tagName() : QString::null;
+ if (QLineEdit *w = output(*ostrI)) {
+ w->setText(t);
+ w->setEnabled(false);
+ }
+ }
+
ptr->unlock();
adjustSize();
@@ -270,6 +339,26 @@
setFixedHeight(height());
}
+
+VectorSelector *KstBasicDialogI::vector(const QString &name) const {
+ return ::qt_cast<VectorSelector*>(_w->_inputOutputFrame->child(name.latin1()));
+}
+
+
+ScalarSelector *KstBasicDialogI::scalar(const QString &name) const {
+ return ::qt_cast<ScalarSelector*>(_w->_inputOutputFrame->child(name.latin1()));
+}
+
+
+StringSelector *KstBasicDialogI::string(const QString &name) const {
+ return ::qt_cast<StringSelector*>(_w->_inputOutputFrame->child(name.latin1()));
+}
+
+
+QLineEdit *KstBasicDialogI::output(const QString &name) const {
+ return ::qt_cast<QLineEdit*>(_w->_inputOutputFrame->child(name.latin1()));
+}
+
#include "kstbasicdialog_i.moc"
// vim: ts=2 sw=2 et
--- branches/work/kst/pluginify/kst/src/libkstapp/kstbasicdialog_i.h #586192:586193
@@ -24,6 +24,11 @@
#include "kstdatadialog.h"
#include "kstbasicplugin.h"
+class VectorSelector;
+class ScalarSelector;
+class StringSelector;
+class QLineEdit;
+
class BasicDialogWidget;
class KST_EXPORT KstBasicDialogI : public KstDataDialog {
@@ -57,6 +62,11 @@
void createInputString(const QString &name, QWidget *parent, QGridLayout *grid, int row);
void createOutputWidget(const QString &name, QWidget *parent, QGridLayout *grid, int row);
+ VectorSelector *vector(const QString &name) const;
+ ScalarSelector *scalar(const QString &name) const;
+ StringSelector *string(const QString &name) const;
+ QLineEdit *output(const QString &name) const;
+
static const QString& defaultTag;
static QGuardedPtr<KstBasicDialogI> _inst;
More information about the Kst
mailing list