summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-03-31 14:57:35 (GMT)
committerTobias Markmann <tm@ayena.de>2016-03-31 14:57:35 (GMT)
commitcfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch)
tree18d94153a302445196fc0c18586abf44a1ce4a38 /Swift/QtUI/QtVCardWidget/QtTagComboBox.cpp
parent1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff)
downloadswift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip
swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines in the process. Changed CheckTabs.py tool to disallow hard tabs in source files. Test-Information: Manually checked 30 random files that the conversion worked as expected. Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Swift/QtUI/QtVCardWidget/QtTagComboBox.cpp')
-rw-r--r--Swift/QtUI/QtVCardWidget/QtTagComboBox.cpp104
1 files changed, 52 insertions, 52 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtTagComboBox.cpp b/Swift/QtUI/QtVCardWidget/QtTagComboBox.cpp
index 7036f84..ed36580 100644
--- a/Swift/QtUI/QtVCardWidget/QtTagComboBox.cpp
+++ b/Swift/QtUI/QtVCardWidget/QtTagComboBox.cpp
@@ -18,14 +18,14 @@
namespace Swift {
QtTagComboBox::QtTagComboBox(QWidget* parent) : QComboBox(parent) {
- setEditable(false);
- displayModel = new QStandardItemModel(this);
- displayItem = new QStandardItem();
- displayItem->setText("");
- displayModel->insertRow(0, displayItem);
- editMenu = new QMenu(this);
- this->setModel(displayModel);
- editable = true;
+ setEditable(false);
+ displayModel = new QStandardItemModel(this);
+ displayItem = new QStandardItem();
+ displayItem->setText("");
+ displayModel->insertRow(0, displayItem);
+ editMenu = new QMenu(this);
+ this->setModel(displayModel);
+ editable = true;
}
QtTagComboBox::~QtTagComboBox() {
@@ -33,40 +33,40 @@ QtTagComboBox::~QtTagComboBox() {
}
bool QtTagComboBox::isEditable() const {
- return editable;
+ return editable;
}
void QtTagComboBox::setEditable(const bool editable) {
- this->editable = editable;
+ this->editable = editable;
}
void QtTagComboBox::addTag(const QString &id, const QString &label) {
- QAction* tagAction = new QAction(editMenu);
- tagAction->setText(label);
- tagAction->setCheckable(true);
- tagAction->setData(QString(id));
- editMenu->addAction(tagAction);
+ QAction* tagAction = new QAction(editMenu);
+ tagAction->setText(label);
+ tagAction->setCheckable(true);
+ tagAction->setData(QString(id));
+ editMenu->addAction(tagAction);
}
void QtTagComboBox::setTag(const QString &id, bool value) {
- QList<QAction*> tagActions = editMenu->actions();
- foreach(QAction* action, tagActions) {
- if (action->data() == id) {
- action->setChecked(value);
- updateDisplayItem();
- return;
- }
- }
+ QList<QAction*> tagActions = editMenu->actions();
+ foreach(QAction* action, tagActions) {
+ if (action->data() == id) {
+ action->setChecked(value);
+ updateDisplayItem();
+ return;
+ }
+ }
}
bool QtTagComboBox::isTagSet(const QString &id) const {
- QList<QAction*> tagActions = editMenu->actions();
- foreach(QAction* action, tagActions) {
- if (action->data() == id) {
- return action->isChecked();
- }
- }
- return false;
+ QList<QAction*> tagActions = editMenu->actions();
+ foreach(QAction* action, tagActions) {
+ if (action->data() == id) {
+ return action->isChecked();
+ }
+ }
+ return false;
}
void QtTagComboBox::showPopup() {
@@ -78,31 +78,31 @@ void QtTagComboBox::hidePopup() {
}
bool QtTagComboBox::event(QEvent* event) {
- if (event->type() == QEvent::MouseButtonPress ||
- event->type() == QEvent::KeyRelease) {
- if (!editable) return true;
-
- QPoint p = mapToGlobal(QPoint(0,0));
- p += QPoint(0, height());
- editMenu->exec(p);
- updateDisplayItem();
- return true;
- }
- return QComboBox::event(event);
+ if (event->type() == QEvent::MouseButtonPress ||
+ event->type() == QEvent::KeyRelease) {
+ if (!editable) return true;
+
+ QPoint p = mapToGlobal(QPoint(0,0));
+ p += QPoint(0, height());
+ editMenu->exec(p);
+ updateDisplayItem();
+ return true;
+ }
+ return QComboBox::event(event);
}
void QtTagComboBox::updateDisplayItem() {
- QList<QAction*> tagActions = editMenu->actions();
- QString text = "";
- foreach(QAction* action, tagActions) {
- if (action->isChecked()) {
- if (text != "") {
- text += ", ";
- }
- text += action->text();
- }
- }
- setItemText(0, text);
+ QList<QAction*> tagActions = editMenu->actions();
+ QString text = "";
+ foreach(QAction* action, tagActions) {
+ if (action->isChecked()) {
+ if (text != "") {
+ text += ", ";
+ }
+ text += action->text();
+ }
+ }
+ setItemText(0, text);
}
}