Package com.trolltech.qt.core

Examples of com.trolltech.qt.core.QPointF.y()


 
  @Override
  public void mouseMoveEvent(QGraphicsSceneMouseEvent event) {
    QPointF mousePos = event.scenePos();
    if (device != null) {
      Tile tile = getTile(mousePos.x(), mousePos.y());
      if(tile != null){
        String tileName = device.getPartName() + " | " +  tile.getName() +
        " | " + tile.getType() + " (" + currX + "," + currY + ")";
        this.updateStatus.emit(tileName, tile);
        prevX = currX;
View Full Code Here


 
  @Override
  public void mouseDoubleClickEvent(QGraphicsSceneMouseEvent event){
    QPointF mousePos = event.scenePos();
    currX = (int) Math.floor((mousePos.x()) / tileSize);
    currY = (int) Math.floor((mousePos.y()) / tileSize);

    if (currX >= 0 && currY >= 0 && currX < cols && currY < rows){
      updateCursor();
    }     
 
View Full Code Here

        QPointF delta = new QPointF(s1.x() - s2.x(), s1.y() - s2.y());
        lastPan = event.pos();
        // Scroll the scrollbars ie. do the pan
        double zoom = this.matrix().m11();
        this.horizontalScrollBar().setValue((int) (this.horizontalScrollBar().value()+zoom*delta.x()));
        this.verticalScrollBar().setValue((int) (this.verticalScrollBar().value()+zoom*delta.y()));
      }
    }
    super.mouseMoveEvent(event);
  }

 
View Full Code Here

    // Get the offset of how the screen moved
    QPointF offset = new QPointF(
        pointBeforeScale.x() - pointAfterScale.x(), pointBeforeScale.y() - pointAfterScale.y());
    this.horizontalScrollBar().setValue((int) (this.horizontalScrollBar().value()+zoom*offset.x()));
    this.verticalScrollBar().setValue((int) (this.verticalScrollBar().value()+zoom*offset.y()));
  }
 
  /**
   * This method gets called when a key on the keyboard is pressed. 
   * In this case, if the '=' key is pressed, it zooms in.  If the
View Full Code Here

  @Override
  public void mouseMoveEvent(QGraphicsSceneMouseEvent event) {
    QPointF mousePos = event.scenePos();
    currX = Math.floor((mousePos.x()) / tileSize);
    currY = Math.floor((mousePos.y()) / tileSize);
    if (currX >= 0 && currY >= 0 && currX < numCols && currY < numRows
        && (currX != prevX || currY != prevY)) {
      this.updateStatus.emit();
      updateCursor();
      prevX = currX;
View Full Code Here

        QPointF delta = new QPointF(s1.x() - s2.x(), s1.y() - s2.y());
        lastPan = event.pos();
        // Scroll the scrollbars ie. do the pan
        double zoom = this.matrix().m11();
        this.horizontalScrollBar().setValue((int) (this.horizontalScrollBar().value()+zoom*delta.x()));
        this.verticalScrollBar().setValue((int) (this.verticalScrollBar().value()+zoom*delta.y()));
      }
    }
    super.mouseMoveEvent(event);
  }

 
View Full Code Here

    QPointF offset = new QPointF(
        pointBeforeScale.x() - pointAfterScale.x(), pointBeforeScale
            .y()
            - pointAfterScale.y());
    this.horizontalScrollBar().setValue((int) (this.horizontalScrollBar().value()+zoom*offset.x()));
    this.verticalScrollBar().setValue((int) (this.verticalScrollBar().value()+zoom*offset.y()));
  }

 
  public void keyPressEvent(QKeyEvent event){
    double scaleFactor = 1.15;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.