1.1 --- a/attributedialog.ui Tue Dec 04 12:32:56 2007 +0000
1.2 +++ b/attributedialog.ui Tue Dec 04 12:32:56 2007 +0000
1.3 @@ -6,7 +6,7 @@
1.4 <x>0</x>
1.5 <y>0</y>
1.6 <width>468</width>
1.7 - <height>78</height>
1.8 + <height>75</height>
1.9 </rect>
1.10 </property>
1.11 <property name="sizePolicy" >
1.12 @@ -20,30 +20,34 @@
1.13 </property>
1.14 <layout class="QVBoxLayout" >
1.15 <item>
1.16 - <widget class="QLineEdit" name="lineEdit" />
1.17 + <widget class="QLineEdit" name="dummyLineEdit" />
1.18 </item>
1.19 <item>
1.20 <layout class="QHBoxLayout" >
1.21 <item>
1.22 + <widget class="QPushButton" name="addButton" >
1.23 + <property name="text" >
1.24 + <string>Add key</string>
1.25 + </property>
1.26 + </widget>
1.27 + </item>
1.28 + <item>
1.29 <spacer>
1.30 <property name="orientation" >
1.31 <enum>Qt::Horizontal</enum>
1.32 </property>
1.33 <property name="sizeHint" >
1.34 <size>
1.35 - <width>40</width>
1.36 + <width>111</width>
1.37 <height>20</height>
1.38 </size>
1.39 </property>
1.40 </spacer>
1.41 </item>
1.42 <item>
1.43 - <widget class="QDialogButtonBox" name="buttonBox" >
1.44 - <property name="orientation" >
1.45 - <enum>Qt::Horizontal</enum>
1.46 - </property>
1.47 - <property name="standardButtons" >
1.48 - <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
1.49 + <widget class="QPushButton" name="closeButton" >
1.50 + <property name="text" >
1.51 + <string>Close</string>
1.52 </property>
1.53 </widget>
1.54 </item>
1.55 @@ -52,38 +56,5 @@
1.56 </layout>
1.57 </widget>
1.58 <resources/>
1.59 - <connections>
1.60 - <connection>
1.61 - <sender>buttonBox</sender>
1.62 - <signal>accepted()</signal>
1.63 - <receiver>AttributeDialog</receiver>
1.64 - <slot>accept()</slot>
1.65 - <hints>
1.66 - <hint type="sourcelabel" >
1.67 - <x>248</x>
1.68 - <y>254</y>
1.69 - </hint>
1.70 - <hint type="destinationlabel" >
1.71 - <x>157</x>
1.72 - <y>274</y>
1.73 - </hint>
1.74 - </hints>
1.75 - </connection>
1.76 - <connection>
1.77 - <sender>buttonBox</sender>
1.78 - <signal>rejected()</signal>
1.79 - <receiver>AttributeDialog</receiver>
1.80 - <slot>reject()</slot>
1.81 - <hints>
1.82 - <hint type="sourcelabel" >
1.83 - <x>316</x>
1.84 - <y>260</y>
1.85 - </hint>
1.86 - <hint type="destinationlabel" >
1.87 - <x>286</x>
1.88 - <y>274</y>
1.89 - </hint>
1.90 - </hints>
1.91 - </connection>
1.92 - </connections>
1.93 + <connections/>
1.94 </ui>
2.1 --- a/attributewidget.cpp Tue Dec 04 12:32:56 2007 +0000
2.2 +++ b/attributewidget.cpp Tue Dec 04 12:32:56 2007 +0000
2.3 @@ -3,4 +3,37 @@
2.4 AttributeWidget::AttributeWidget (QWidget *parent):QWidget (parent)
2.5 {
2.6 ui.setupUi (this);
2.7 + //ui.keyComboBox->setEditable (true);
2.8 + ui.valueComboBox->setEditable (true);
2.9 }
2.10 +
2.11 +void AttributeWidget::setTable(AttributeTable *at)
2.12 +{
2.13 + table=at;
2.14 +}
2.15 +
2.16 +void AttributeWidget::setKey (const QString &k)
2.17 +{
2.18 + key=k;
2.19 + ui.keyComboBox->insertItem (ui.keyComboBox->count(), key);
2.20 +}
2.21 +
2.22 +void AttributeWidget::setValues(const QStringList &vl)
2.23 +{
2.24 + ui.valueComboBox->clear();
2.25 + ui.valueComboBox->insertStringList(vl);
2.26 +}
2.27 +
2.28 +/*
2.29 +void AttributeWidget::setValue (const QString &v)
2.30 +{
2.31 +}
2.32 +*/
2.33 +
2.34 +void AttributeWidget::keyTextChanged(const QString &t)
2.35 +{
2.36 +}
2.37 +
2.38 +void AttributeWidget::valueTextChanged(const QString &t)
2.39 +{
2.40 +}
3.1 --- a/attributewidget.h Tue Dec 04 12:32:56 2007 +0000
3.2 +++ b/attributewidget.h Tue Dec 04 12:32:56 2007 +0000
3.3 @@ -3,6 +3,8 @@
3.4
3.5 #include "ui_attributewidget.h"
3.6
3.7 +#include "attribute.h"
3.8 +
3.9 #include <QWidget>
3.10
3.11 class AttributeWidget: public QWidget
3.12 @@ -10,8 +12,17 @@
3.13 Q_OBJECT
3.14 public:
3.15 AttributeWidget (QWidget *parent=0);
3.16 + void setTable (AttributeTable *at=0);
3.17 + void setKey (const QString &k);
3.18 + void setValues (const QStringList &vl);
3.19 +
3.20 +public slots:
3.21 + virtual void keyTextChanged(const QString &t);
3.22 + virtual void valueTextChanged(const QString &t);
3.23 +
3.24 private:
3.25 Ui::AttributeWidget ui;
3.26 -
3.27 + AttributeTable *table;
3.28 + QString key;
3.29 };
3.30 #endif