summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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;
}
}