Logo Search packages:      
Sourcecode: ktikz version File versions  Download package

void TikzCommandInserter::insertTag ( const QString &  tag,
int  dx = 0,
int  dy = 0 

Inserts a TikZ command and moves the cursor to a position located dx characters to the right of and dy characters below the start of the inserted tag.

tagthe TikZ command to be inserted
dxthe x-offset of the new cursor position w.r.t. the beginning of the inserted tag
dythe y-offset of the new cursor position w.r.t. the beginning of the inserted tag

Definition at line 545 of file tikzcommandinserter.cpp.

References insertTag().

Referenced by getDockWidget(), and insertTag().

      QTextCursor cur = m_mainEdit->textCursor();
      const int pos = cur.position();
      cur.setPosition(pos, QTextCursor::MoveAnchor);
      if (tag.contains(s_completionPlaceHolder))
            cur = m_mainEdit->document()->find(s_completionPlaceHolder, cur);
            if (dy > 0)
                  cur.movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, dy);
                  cur.movePosition(QTextCursor::StartOfLine, QTextCursor::MoveAnchor, 1);
            if (dx > 0)
                  cur.movePosition(QTextCursor::NextCharacter, QTextCursor::MoveAnchor, dx);

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index