From 8070f7eedb6f23a09f85fe8015888c12b3974be2 Mon Sep 17 00:00:00 2001 From: blacksun Date: Thu, 4 Dec 2014 10:57:21 +0000 Subject: [PATCH] Forget file from previous commit git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3530 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/qet.cpp | 15 +++++++++++++++ sources/qet.h | 1 + 2 files changed, 16 insertions(+) diff --git a/sources/qet.cpp b/sources/qet.cpp index 17715869a..b66f832fa 100644 --- a/sources/qet.cpp +++ b/sources/qet.cpp @@ -683,3 +683,18 @@ QPointF QET::graphicsSceneEventPos(QEvent *event) { } return(event_scene_pos); } + +/** + * @brief QET::eachStrIsEqual + * @param qsl list of string to compare + * @return true if every string is identical, else false; + * The list must not be empty + * If the list can be empty, call isEmpty() before calling this function + */ +bool QET::eachStrIsEqual(const QStringList &qsl) { + if (qsl.size() == 1) return true; + foreach (const QString t, qsl) { + if (qsl.at(0) != t) return false; + } + return true; +} diff --git a/sources/qet.h b/sources/qet.h index f77b2baf0..2e4ab0ee9 100644 --- a/sources/qet.h +++ b/sources/qet.h @@ -154,6 +154,7 @@ namespace QET { QString titleBlockColumnLengthToString(const TitleBlockColumnLength &); bool writeXmlFile(QDomDocument &, const QString &, QString * = 0); QPointF graphicsSceneEventPos(QEvent *); + bool eachStrIsEqual (const QStringList &qsl); } class Qet : public QObject {