summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2012-10-04 17:00:37 (GMT)
committerTobias Markmann <tm@ayena.de>2012-11-11 16:38:02 (GMT)
commit7a73d0f61859aa1ed1af64ec5d42819ab4264c09 (patch)
tree91f46c8c9a5fcf99d76581b97efa7b056fe1c502 /Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp
parentf7807574201365276a26528135123545adcaa9bc (diff)
downloadswift-contrib-7a73d0f61859aa1ed1af64ec5d42819ab4264c09.zip
swift-contrib-7a73d0f61859aa1ed1af64ec5d42819ab4264c09.tar.bz2
Some refactoring.tobias/vcard
Diffstat (limited to 'Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp')
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp
index 551f5d3..f78f6bf 100644
--- a/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp
+++ b/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp
@@ -6,11 +6,46 @@
#include "QtVCardGeneralField.h"
+#include <QHBoxLayout>
+
namespace Swift {
-QtVCardGeneralField::QtVCardGeneralField(QWidget* parent) :
+QtVCardGeneralField::QtVCardGeneralField(QWidget* parent, bool editable) :
QWidget(parent) {
+ setEditable(editable);
+}
+
+void QtVCardGeneralField::initialize() {
+ setLayout(new QHBoxLayout);
+ preferredCheckBox = new QCheckBox(this);
+ layout()->addWidget(preferredCheckBox);
+ label = new QLabel(this);
+ layout()->addWidget(label);
+ tagComboBox = new QtTagComboBox(this);
+ setupContentWidgets();
+ layout()->addWidget(tagComboBox);
+
+}
+
+bool QtVCardGeneralField::isEditable() const {
+ return editable;
+}
+
+void QtVCardGeneralField::setEditable(bool editable) {
+ this->editable = editable;
+ editableChanged(this->editable);
+}
+
+void QtVCardGeneralField::setPreferred(const bool preferred) {
+ preferredCheckBox->setChecked(preferred);
+}
+
+bool QtVCardGeneralField::getPreferred() const {
+ return preferredCheckBox->isChecked();
+}
+QtTagComboBox *QtVCardGeneralField::getTagComboBox() {
+ return tagComboBox;
}
}