forked from qt-creator/qt-creator
QmlDesigner: Rename scenePos in scenePosition
And change it to QPointF. Change-Id: I24c6238eb2c415296b4621b7aa0ec06d85293cb7 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -42,7 +42,7 @@ static inline QString captionForModelNode(const ModelNode &modelNode)
|
|||||||
return modelNode.id();
|
return modelNode.id();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool contains(const QmlItemNode &node, const QPoint &position)
|
static inline bool contains(const QmlItemNode &node, const QPointF &position)
|
||||||
{
|
{
|
||||||
return node.isValid() && node.instanceSceneTransform().mapRect(node.instanceBoundingRect()).contains(position);
|
return node.isValid() && node.instanceSceneTransform().mapRect(node.instanceBoundingRect()).contains(position);
|
||||||
}
|
}
|
||||||
@@ -346,7 +346,7 @@ public:
|
|||||||
foreach (const ModelNode &node, m_selectionContext.view()->allModelNodes()) {
|
foreach (const ModelNode &node, m_selectionContext.view()->allModelNodes()) {
|
||||||
if (node != m_selectionContext.currentSingleSelectedNode()
|
if (node != m_selectionContext.currentSingleSelectedNode()
|
||||||
&& node != parentNode
|
&& node != parentNode
|
||||||
&& contains(node, m_selectionContext.scenePos())
|
&& contains(node, m_selectionContext.scenePosition())
|
||||||
&& !node.isRootNode()) {
|
&& !node.isRootNode()) {
|
||||||
m_selectionContext.setTargetNode(node);
|
m_selectionContext.setTargetNode(node);
|
||||||
QString what = QString(QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Select: %1")).arg(captionForModelNode(node));
|
QString what = QString(QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Select: %1")).arg(captionForModelNode(node));
|
||||||
|
@@ -94,7 +94,7 @@ void ModelNodeContextMenu::execute(const QPoint &position, bool selectionMenuBoo
|
|||||||
QMenu* mainMenu = new QMenu();
|
QMenu* mainMenu = new QMenu();
|
||||||
|
|
||||||
m_selectionContext.setShowSelectionTools(selectionMenuBool);
|
m_selectionContext.setShowSelectionTools(selectionMenuBool);
|
||||||
m_selectionContext.setScenePos(m_scenePos);
|
m_selectionContext.setScenePosition(m_scenePos);
|
||||||
|
|
||||||
|
|
||||||
QSet<AbstractDesignerAction* > factories =
|
QSet<AbstractDesignerAction* > factories =
|
||||||
|
@@ -101,12 +101,12 @@ bool SelectionContext::showSelectionTools() const
|
|||||||
return m_showSelectionTools;
|
return m_showSelectionTools;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectionContext::setScenePos(const QPoint &postition)
|
void SelectionContext::setScenePosition(const QPointF &postition)
|
||||||
{
|
{
|
||||||
m_scenePosition = postition;
|
m_scenePosition = postition;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPoint SelectionContext::scenePos() const
|
QPointF SelectionContext::scenePosition() const
|
||||||
{
|
{
|
||||||
return m_scenePosition;
|
return m_scenePosition;
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include <qmldesignercorelib_global.h>
|
#include <qmldesignercorelib_global.h>
|
||||||
#include <abstractview.h>
|
#include <abstractview.h>
|
||||||
#include <QPoint>
|
#include <QPointF>
|
||||||
|
|
||||||
#ifndef SELECTIONCONTEXT_H
|
#ifndef SELECTIONCONTEXT_H
|
||||||
#define SELECTIONCONTEXT_H
|
#define SELECTIONCONTEXT_H
|
||||||
@@ -58,8 +58,8 @@ public:
|
|||||||
void setShowSelectionTools(bool show);
|
void setShowSelectionTools(bool show);
|
||||||
bool showSelectionTools() const;
|
bool showSelectionTools() const;
|
||||||
|
|
||||||
void setScenePos(const QPoint &postition);
|
void setScenePosition(const QPointF &postition);
|
||||||
QPoint scenePos() const;
|
QPointF scenePosition() const;
|
||||||
|
|
||||||
void setToggled(bool toggled);
|
void setToggled(bool toggled);
|
||||||
bool toggled() const;
|
bool toggled() const;
|
||||||
@@ -70,7 +70,7 @@ private:
|
|||||||
QWeakPointer<AbstractView> m_view;
|
QWeakPointer<AbstractView> m_view;
|
||||||
ModelNode m_targetNode;
|
ModelNode m_targetNode;
|
||||||
bool m_showSelectionTools;
|
bool m_showSelectionTools;
|
||||||
QPoint m_scenePosition;
|
QPointF m_scenePosition;
|
||||||
bool m_toggled;
|
bool m_toggled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user