Commit 9ac52c4a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated methods

parent 4d320f31
......@@ -299,7 +299,7 @@ QVariant AppMenuModel::data(const QModelIndex &index, int role) const
if (role == MenuRole) { // TODO this should be Qt::DisplayRole
return actions.at(row)->text();
} else if (role == ActionRole) {
return qVariantFromValue((void *) actions.at(row));
return QVariant::fromValue((void *) actions.at(row));
}
return QVariant();
......
......@@ -96,7 +96,7 @@ void DefaultFilterModel::addFilter(const QString &caption, const Filter &filter,
{
QList<QStandardItem *> newRow;
QStandardItem *item = new QStandardItem(caption);
item->setData(qVariantFromValue<Filter>(filter));
item->setData(QVariant::fromValue<Filter>(filter));
if (!icon.isNull()) {
item->setIcon(icon);
}
......
......@@ -57,6 +57,6 @@ void StatusNotifierItemJob::activateCallback(bool success)
void StatusNotifierItemJob::contextMenuReady(QMenu *menu)
{
if (operationName() == QString::fromLatin1("ContextMenu")) {
setResult(qVariantFromValue((QObject*)menu));
setResult(QVariant::fromValue((QObject*)menu));
}
}
......@@ -84,11 +84,11 @@ QVariant HistoryModel::data(const QModelIndex &index, int role) const
case Qt::DecorationRole:
return item->image();
case Qt::UserRole:
return qVariantFromValue<HistoryItemConstPtr>(qSharedPointerConstCast<const HistoryItem>(item));
return QVariant::fromValue<HistoryItemConstPtr>(qSharedPointerConstCast<const HistoryItem>(item));
case Qt::UserRole+1:
return item->uuid();
case Qt::UserRole+2:
return qVariantFromValue<HistoryItemType>(type);
return QVariant::fromValue<HistoryItemType>(type);
case Qt::UserRole+3:
return item->uuid().toBase64();
case Qt::UserRole+4:
......
......@@ -23,7 +23,7 @@
#include "config-klipper.h"
#include <QTime>
#include <QElapsedTimer>
#include <QTimer>
#include <QClipboard>
#include <QPointer>
......@@ -161,7 +161,7 @@ private:
QSharedPointer<HistoryItem> m_last;
QTime m_showTimer;
QElapsedTimer m_showTimer;
History* m_history;
KlipperPopup *m_popup;
......
......@@ -902,7 +902,7 @@ bool PanelView::event(QEvent *e)
if (!containmentContainsPosition(we->pos())) {
auto we2 = new QWheelEvent(positionAdjustedForContainment(we->pos()),
positionAdjustedForContainment(we->pos()) + position(),
we->pixelDelta(), we->angleDelta(), we->delta(),
we->pixelDelta(), we->angleDelta(), we->angleDelta().y(),
we->orientation(), we->buttons(), we->modifiers(), we->phase());
QCoreApplication::postEvent(this, we2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment