Changeset View
Changeset View
Standalone View
Standalone View
tests/units/widgets/applicationcomponentstest.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | |||||
48 | #include "widgets/pageviewerrorhandler.h" | 48 | #include "widgets/pageviewerrorhandler.h" | ||
49 | #include "widgets/quickselectdialog.h" | 49 | #include "widgets/quickselectdialog.h" | ||
50 | 50 | | |||
51 | 51 | | |||
52 | class CustomModelStub : public QStandardItemModel | 52 | class CustomModelStub : public QStandardItemModel | ||
53 | { | 53 | { | ||
54 | Q_OBJECT | 54 | Q_OBJECT | ||
55 | 55 | | |||
56 | QMimeData *mimeData(const QModelIndexList &indexes) const | 56 | QMimeData *mimeData(const QModelIndexList &indexes) const override | ||
57 | { | 57 | { | ||
58 | QStringList dataString; | 58 | QStringList dataString; | ||
59 | std::transform(indexes.begin(), indexes.end(), | 59 | std::transform(indexes.begin(), indexes.end(), | ||
60 | std::back_inserter(dataString), | 60 | std::back_inserter(dataString), | ||
61 | [] (const QModelIndex &index) { | 61 | [] (const QModelIndex &index) { | ||
62 | return index.data().toString(); | 62 | return index.data().toString(); | ||
63 | }); | 63 | }); | ||
64 | 64 | | |||
65 | auto data = new QMimeData; | 65 | auto data = new QMimeData; | ||
66 | data->setData(QStringLiteral("application/x-zanshin-object"), "object"); | 66 | data->setData(QStringLiteral("application/x-zanshin-object"), "object"); | ||
67 | data->setProperty("objects", QVariant::fromValue(dataString)); | 67 | data->setProperty("objects", QVariant::fromValue(dataString)); | ||
68 | 68 | | |||
69 | return data; | 69 | return data; | ||
70 | } | 70 | } | ||
71 | 71 | | |||
72 | bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &destination) | 72 | bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &destination) override | ||
73 | { | 73 | { | ||
74 | Q_UNUSED(action); | 74 | Q_UNUSED(action); | ||
75 | 75 | | |||
76 | Q_ASSERT(row == -1); | 76 | Q_ASSERT(row == -1); | ||
77 | Q_ASSERT(column == -1); | 77 | Q_ASSERT(column == -1); | ||
78 | Q_ASSERT(destination.isValid()); | 78 | Q_ASSERT(destination.isValid()); | ||
79 | Q_ASSERT(data->hasFormat(QStringLiteral("application/x-zanshin-object"))); | 79 | Q_ASSERT(data->hasFormat(QStringLiteral("application/x-zanshin-object"))); | ||
80 | 80 | | |||
▲ Show 20 Lines • Show All 608 Lines • Show Last 20 Lines |