forked from qt-creator/qt-creator
QmlDesigner: Fix deprecation warnings
Change-Id: Icebf96e8f1cfc6588c7db844da47e3ac7159e056 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -63,7 +63,7 @@ void populateMenu(QSet<ActionInterface* > &actionInterfaces,
|
||||
|
||||
actionInterfaces.subtract(matchingFactories);
|
||||
|
||||
QList<ActionInterface* > matchingFactoriesList = matchingFactories.toList();
|
||||
QList<ActionInterface* > matchingFactoriesList = Utils::toList(matchingFactories);
|
||||
Utils::sort(matchingFactoriesList, [](ActionInterface *l, ActionInterface *r) {
|
||||
return l->priority() > r->priority();
|
||||
});
|
||||
@@ -100,8 +100,7 @@ void ModelNodeContextMenu::execute(const QPoint &position, bool selectionMenuBoo
|
||||
|
||||
manager.setupContext();
|
||||
|
||||
QSet<ActionInterface* > factories =
|
||||
QSet<ActionInterface* >::fromList(manager.designerActions());
|
||||
QSet<ActionInterface* > factories = Utils::toSet(manager.designerActions());
|
||||
|
||||
populateMenu(factories, QByteArray(), mainMenu, m_selectionContext);
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <QGraphicsView>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QElapsedTimer>
|
||||
#include <QList>
|
||||
#include <QTime>
|
||||
|
||||
@@ -255,16 +256,16 @@ void FormEditorScene::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
currentTool()->mousePressEvent(removeLayerItems(itemsAt(event->scenePos())), event);
|
||||
}
|
||||
|
||||
static QTime staticTimer()
|
||||
static QElapsedTimer staticTimer()
|
||||
{
|
||||
QTime timer;
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
return timer;
|
||||
}
|
||||
|
||||
void FormEditorScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
static QTime time = staticTimer();
|
||||
static QElapsedTimer time = staticTimer();
|
||||
|
||||
QGraphicsScene::mouseMoveEvent(event);
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "bindingindicator.h"
|
||||
#include "contentnoteditableindicator.h"
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <QTime>
|
||||
|
||||
namespace QmlDesigner {
|
||||
@@ -87,7 +88,7 @@ private:
|
||||
AnchorIndicator m_anchorIndicator;
|
||||
BindingIndicator m_bindingIndicator;
|
||||
ContentNotEditableIndicator m_contentNotEditableIndicator;
|
||||
QTime m_mousePressTimer;
|
||||
QElapsedTimer m_mousePressTimer;
|
||||
QCursor m_cursor;
|
||||
bool m_itemAlreadySelected = false;
|
||||
};
|
||||
|
||||
@@ -273,7 +273,7 @@ void PropertyEditorQmlBackend::setup(const QmlObjectNode &qmlObjectNode, const Q
|
||||
|
||||
qCInfo(propertyEditorBenchmark) << Q_FUNC_INFO;
|
||||
|
||||
QTime time;
|
||||
QElapsedTimer time;
|
||||
if (propertyEditorBenchmark().isInfoEnabled())
|
||||
time.start();
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <nodeinstanceclientinterface.h>
|
||||
#include <nodeinstanceserverinterface.h>
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <QHash>
|
||||
#include <QImage>
|
||||
#include <QPointer>
|
||||
@@ -195,7 +196,7 @@ private: //variables
|
||||
|
||||
QPointer<NodeInstanceServerInterface> m_nodeInstanceServer;
|
||||
QImage m_baseStatePreviewImage;
|
||||
QTime m_lastCrashTime;
|
||||
QElapsedTimer m_lastCrashTime;
|
||||
NodeInstanceServerInterface::RunModus m_runModus;
|
||||
ProjectExplorer::Kit *m_currentKit = nullptr;
|
||||
ProjectExplorer::Project *m_currentProject = nullptr;
|
||||
|
||||
@@ -1396,7 +1396,7 @@ void ModelPrivate::setSelectedNodes(const QList<InternalNode::Pointer> &selected
|
||||
QList<InternalNode::Pointer> sortedSelectedList
|
||||
= Utils::filtered(selectedNodeList, &InternalNode::isValid);
|
||||
|
||||
sortedSelectedList = sortedSelectedList.toSet().toList();
|
||||
sortedSelectedList = Utils::toList(Utils::toSet(sortedSelectedList));
|
||||
Utils::sort(sortedSelectedList);
|
||||
|
||||
if (sortedSelectedList == m_selectedInternalNodeList)
|
||||
@@ -1767,7 +1767,8 @@ QList<InternalNodePointer> ModelPrivate::allNodes() const
|
||||
|
||||
nodeList.append(m_rootInternalNode);
|
||||
nodeList.append(m_rootInternalNode->allSubNodes());
|
||||
nodeList.append((m_nodeSet - nodeList.toSet()).toList());
|
||||
// FIXME: This is horribly expensive compared to a loop.
|
||||
nodeList.append(Utils::toList(m_nodeSet - Utils::toSet(nodeList)));
|
||||
|
||||
return nodeList;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <QLoggingCategory>
|
||||
#include <QTabWidget>
|
||||
|
||||
@@ -102,8 +103,7 @@ DesignDocument *ViewManager::currentDesignDocument() const
|
||||
|
||||
void ViewManager::attachNodeInstanceView()
|
||||
{
|
||||
|
||||
QTime time;
|
||||
QElapsedTimer time;
|
||||
if (viewBenchmark().isInfoEnabled())
|
||||
time.start();
|
||||
|
||||
@@ -117,7 +117,7 @@ void ViewManager::attachNodeInstanceView()
|
||||
|
||||
void ViewManager::attachRewriterView()
|
||||
{
|
||||
QTime time;
|
||||
QElapsedTimer time;
|
||||
if (viewBenchmark().isInfoEnabled())
|
||||
time.start();
|
||||
|
||||
@@ -253,7 +253,7 @@ void ViewManager::attachViewsExceptRewriterAndComponetView()
|
||||
|
||||
attachNodeInstanceView();
|
||||
|
||||
QTime time;
|
||||
QElapsedTimer time;
|
||||
if (viewBenchmark().isInfoEnabled())
|
||||
time.start();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user