Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/plugins/phonedetailswidget.cpp
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 45 | { | |||
---|---|---|---|---|---|
50 | } | 50 | } | ||
51 | 51 | | |||
52 | QLayoutItem *child; | 52 | QLayoutItem *child; | ||
53 | while ((child = layout()->takeAt(0)) != 0) { | 53 | while ((child = layout()->takeAt(0)) != 0) { | ||
54 | delete child->widget(); | 54 | delete child->widget(); | ||
55 | delete child; | 55 | delete child; | ||
56 | } | 56 | } | ||
57 | 57 | | |||
58 | Q_FOREACH (const QString &phone, person->phones()) { | 58 | const auto lst = person->phones(); | ||
59 | for (const QString &phone : lst) { | ||||
59 | QLabel *phoneLabel = new QLabel(phone, this); | 60 | QLabel *phoneLabel = new QLabel(phone, this); | ||
60 | phoneLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); | 61 | phoneLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); | ||
61 | layout()->addWidget(phoneLabel); | 62 | layout()->addWidget(phoneLabel); | ||
62 | } | 63 | } | ||
63 | } | 64 | } |