Ejemplo n.º 1
0
void Image::startDrag(EditData& data)
      {
      ImageEditData* ed = new ImageEditData();
      ed->e    = this;
      ed->size = _size;
      data.addData(ed);
      }
Ejemplo n.º 2
0
void TextBase::startEdit(EditData& ed)
      {
      ed.grips = 0;
      TextEditData* ted = new TextEditData(this);
      ted->e = this;
      ted->cursor.setRow(0);
      ted->cursor.setColumn(0);
      ted->cursor.clearSelection();

      Q_ASSERT(!score()->undoStack()->active());      // make sure we are not in a Cmd

      ted->oldXmlText = xmlText();
      ted->startUndoIdx = score()->undoStack()->getCurIdx();

      if (layoutInvalid)
            layout();
      if (!ted->cursor.set(ed.startMove))
            ted->cursor.init();
      qreal _spatium = spatium();
      // refresh edit bounding box
      score()->addRefresh(canvasBoundingRect().adjusted(-_spatium, -_spatium, _spatium, _spatium));
      ed.addData(ted);
      }