summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-09-29 15:39:22 (GMT)
committerKevin Smith <git@kismith.co.uk>2014-10-07 07:42:11 (GMT)
commit10785a85347e0cca62e6029097baec7c4d7dc0d5 (patch)
tree1fe4757829f2ad6c18d672fe7b40e1f7a789052f /Swift/QtUI/QtVCardWidget
parent80addba4a31fcb09a9703778e1ea9b984593bfd5 (diff)
downloadswift-contrib-10785a85347e0cca62e6029097baec7c4d7dc0d5.zip
swift-contrib-10785a85347e0cca62e6029097baec7c4d7dc0d5.tar.bz2
Add tooltip to preferred stars of profile editor to describe what it's for.
Change-Id: I937c39406ec3ae58cd7c0d8311543bcbb684fda0
Diffstat (limited to 'Swift/QtUI/QtVCardWidget')
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp
index 21e794e..74ebd47 100644
--- a/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp
+++ b/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp
@@ -1,67 +1,68 @@
/*
* Copyright (c) 2012-2014 Tobias Markmann
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
/*
* Copyright (c) 2014 Kevin Smith and Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include <Swift/QtUI/QtVCardWidget/QtVCardGeneralField.h>
#include <cassert>
#include <QHBoxLayout>
namespace Swift {
QtVCardGeneralField::QtVCardGeneralField(QWidget* parent, QGridLayout* layout, bool editable, int row, QString label, bool preferrable, bool taggable) :
QWidget(parent), editable(editable), preferrable(preferrable), taggable(taggable), starVisible(false), layout(layout), row(row), preferredCheckBox(0), label(0), labelText(label),
tagComboBox(0), tagLabel(NULL), closeButton(0) {
}
QtVCardGeneralField::~QtVCardGeneralField() {
}
void QtVCardGeneralField::initialize() {
if (preferrable) {
preferredCheckBox = new QCheckBox(this);
+ preferredCheckBox->setToolTip(tr("Stars can be used to mark preferred contact details."));
preferredCheckBox->setStyleSheet(
"QCheckBox::indicator { width: 18px; height: 18px; }"
"QCheckBox::indicator:checked { image: url(:/icons/star-checked.png); }"
"QCheckBox::indicator:unchecked { image: url(:/icons/star-unchecked); }"
);
layout->addWidget(preferredCheckBox, row, 0, Qt::AlignVCenter);
childWidgets << preferredCheckBox;
}
label = new QLabel(this);
label->setText(labelText);
layout->addWidget(label, row, 1, Qt::AlignVCenter | Qt::AlignRight);
tagLabel = new QLabel(this);
tagLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
tagComboBox = new QtTagComboBox(this);
closeButton = new QtCloseButton(this);
connect(closeButton, SIGNAL(clicked()), SLOT(handleCloseButtonClicked()));
QHBoxLayout* tagLayout = new QHBoxLayout();
tagLayout->addWidget(tagLabel);
tagLayout->addWidget(tagComboBox);
setupContentWidgets();
layout->addLayout(tagLayout, row, 4, Qt::AlignTop);
layout->addWidget(closeButton, row, 5, Qt::AlignCenter);
closeButton->resize(12, 12);
tagLabel->hide();
childWidgets << label << tagComboBox << tagLabel << closeButton;
setEditable(editable);
}
bool QtVCardGeneralField::isEditable() const {
return editable;