/* * Copyright (c) 2012 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #include "QtVCardGeneralField.h" #include namespace Swift { 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; } }