Commit b9bf2d00 authored by Laurent Montel's avatar Laurent Montel 😁

Add to layout

parent f2969d86
......@@ -40,58 +40,72 @@ AddressLocationWidget::AddressLocationWidget(QWidget *parent)
QLabel *label = new QLabel(KContacts::Address::streetLabel(), this);
label->setObjectName(QStringLiteral("streetlabel"));
topLayout->addWidget(label, 1, 0);
mStreetEdit = new KLineEdit(this);
mStreetEdit->setPlaceholderText(i18n("Add Street"));
mStreetEdit->setObjectName(QStringLiteral("streetlineedit"));
mStreetEdit->setTrapReturnKey(true);
topLayout->addWidget(mStreetEdit, 2, 0);
label = new QLabel(KContacts::Address::postOfficeBoxLabel(), this);
label->setObjectName(QStringLiteral("postofficeboxlabel"));
topLayout->addWidget(label, 1, 1);
mPOBoxEdit = new KLineEdit(this);
mPOBoxEdit->setPlaceholderText(i18n("Add Post Office Box"));
mPOBoxEdit->setObjectName(QStringLiteral("postofficeboxlineedit"));
mPOBoxEdit->setTrapReturnKey(true);
topLayout->addWidget(mPOBoxEdit, 2, 1);
label = new QLabel(KContacts::Address::postalCodeLabel(), this);
label->setObjectName(QStringLiteral("postalcodelabel"));
topLayout->addWidget(label, 3, 0);
mPostalCodeEdit = new KLineEdit(this);
mPostalCodeEdit->setPlaceholderText(i18n("Add Postal Code"));
mPostalCodeEdit->setObjectName(QStringLiteral("postalcodelineedit"));
mPostalCodeEdit->setTrapReturnKey(true);
topLayout->addWidget(mPostalCodeEdit, 4, 0);
label = new QLabel(KContacts::Address::localityLabel(), this);
label->setObjectName(QStringLiteral("localitylabel"));
topLayout->addWidget(label, 3, 1);
mLocalityEdit = new KLineEdit(this);
mLocalityEdit->setPlaceholderText(i18n("Add Locality"));
mLocalityEdit->setObjectName(QStringLiteral("localitylineedit"));
mLocalityEdit->setTrapReturnKey(true);
topLayout->addWidget(mLocalityEdit, 4, 1);
label = new QLabel(KContacts::Address::regionLabel(), this);
label->setObjectName(QStringLiteral("regionlabel"));
topLayout->addWidget(label, 5, 0);
mRegionEdit = new KLineEdit(this);
mRegionEdit->setPlaceholderText(i18n("Add Region"));
mRegionEdit->setObjectName(QStringLiteral("regionlineedit"));
mRegionEdit->setTrapReturnKey(true);
topLayout->addWidget(mRegionEdit, 6, 0);
label = new QLabel(KContacts::Address::postalCodeLabel(), this);
label->setObjectName(QStringLiteral("postalcodelabel"));
mPostalCodeEdit = new KLineEdit(this);
mPostalCodeEdit->setPlaceholderText(i18n("Add Postal Code"));
mPostalCodeEdit->setObjectName(QStringLiteral("postalcodelineedit"));
mPostalCodeEdit->setTrapReturnKey(true);
label = new QLabel(KContacts::Address::countryLabel(), this);
label->setObjectName(QStringLiteral("countrylabel"));
topLayout->addWidget(label, 5, 1);
mCountryCombo = new KComboBox(this);
mCountryCombo->setObjectName(QStringLiteral("countrycombobox"));
mCountryCombo->setEditable(true);
mCountryCombo->lineEdit()->setPlaceholderText(i18n("Add a Country"));
mCountryCombo->setDuplicatesEnabled(false);
topLayout->addWidget(mCountryCombo, 6, 1);
mPreferredCheckBox = new QCheckBox(i18nc("street/postal", "This is the preferred address"), this);
mPreferredCheckBox->setObjectName(QStringLiteral("preferredcheckbox"));
topLayout->addWidget(mPreferredCheckBox, 7, 0, 1, 2);
mAddAddress = new QPushButton(i18n("Add Address"), this);
mAddAddress->setObjectName(QStringLiteral("addbuttonaddress"));
topLayout->addWidget(mAddAddress, 8, 0);
}
......
......@@ -73,7 +73,7 @@ void AddressLocationWidgetTest::shouldHaveDefaultValue()
QLabel *countrylabel = w.findChild<QLabel *>(QStringLiteral("countrylabel"));
QVERIFY(countrylabel);
KComboBox *countrycombobox = w.findChild<KComboBox *>(QStringLiteral("countrylabel"));
KComboBox *countrycombobox = w.findChild<KComboBox *>(QStringLiteral("countrycombobox"));
QVERIFY(countrycombobox);
QCheckBox *preferredcheckbox = w.findChild<QCheckBox *>(QStringLiteral("preferredcheckbox"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment