QTestLib: Replace typedef by 'using'

Apply Fixits by Qt Creator with some amendments.

Task-number: QTBUG-69413
Change-Id: I366cca6e5755719e8241e76774af6be2b5312627
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Friedemann Kleint 2019-06-13 11:54:29 +02:00
parent e7b1c500d4
commit fabf9239e0
4 changed files with 7 additions and 9 deletions

View File

@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
class QObject;
// Use pointers since we subclass QAccessibleEvent
typedef QList<QAccessibleEvent*> EventList;
using EventList = QList<QAccessibleEvent*>;
bool operator==(const QAccessibleEvent &l, const QAccessibleEvent &r)
{

View File

@ -301,7 +301,7 @@ class TestMethods {
public:
Q_DISABLE_COPY_MOVE(TestMethods)
typedef std::vector<QMetaMethod> MetaMethods;
using MetaMethods = std::vector<QMetaMethod>;
explicit TestMethods(const QObject *o, const MetaMethods &m = MetaMethods());

View File

@ -336,7 +336,7 @@ namespace QTest
template <typename T>
inline void addColumn(const char *name, T * = nullptr)
{
typedef std::is_same<T, const char*> QIsSameTConstChar;
using QIsSameTConstChar = std::is_same<T, const char*>;
Q_STATIC_ASSERT_X(!QIsSameTConstChar::value, "const char* is not allowed as a test data format.");
addColumnInternal(qMetaTypeId<T>(), name);
}

View File

@ -65,10 +65,10 @@ public:
int type;
};
typedef std::vector<Element> ElementList;
using ElementList = std::vector<Element>;
ElementList elementList;
typedef std::vector<QTestData *> DataList;
using DataList = std::vector<QTestData *>;
DataList dataList;
void addColumn(int elemType, const char *elemName) { elementList.push_back(Element(elemName, elemType)); }
@ -152,14 +152,12 @@ private:
int QTestTable::indexOf(const char *elementName) const
{
typedef QTestTablePrivate::ElementList::const_iterator It;
QTEST_ASSERT(elementName);
const QTestTablePrivate::ElementList &elementList = d->elementList;
const It it = std::find_if(elementList.begin(), elementList.end(),
NamePredicate(elementName));
const auto it = std::find_if(elementList.begin(), elementList.end(),
NamePredicate(elementName));
return it != elementList.end() ?
int(it - elementList.begin()) : -1;
}