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:
parent
e7b1c500d4
commit
fabf9239e0
@ -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)
|
||||
{
|
||||
|
@ -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());
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user