image properties dialog: add hold position option

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2645 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2013-11-28 21:25:20 +00:00
parent 938ce26b2b
commit 9b1052484e
3 changed files with 36 additions and 32 deletions

View File

@@ -25,6 +25,7 @@
*/
QetGraphicsItem::QetGraphicsItem(QGraphicsItem *parent):
QGraphicsObject(parent),
is_movable_(true),
first_move_(true)
{
}
@@ -32,8 +33,6 @@ QetGraphicsItem::QetGraphicsItem(QGraphicsItem *parent):
QetGraphicsItem::~QetGraphicsItem()
{}
void QetGraphicsItem::editProperty(){}
/**
* @brief QetGraphicsItem::diagram
*return the diagram of this item
@@ -48,7 +47,7 @@ Diagram* QetGraphicsItem::diagram() const{
* @param p the new position of item
*/
void QetGraphicsItem::setPos(const QPointF &p) {
if (p == pos()) return;
if (p == pos() || !is_movable_) return;
if (scene()) {
// arrondit l'abscisse a 10 px pres
int p_x = qRound(p.x() / (Diagram::xGrid * 1.0)) * Diagram::xGrid;