mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-27 14:20:52 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user