Make accidentally activating the link navigation more difficult

Only checking Ctrl and link availability on mouse release was triggering
the navigation too easily.

Now you have to press and release the mouse on the same link, having
Ctrl pressed all the time. In addition, when changing the text selection
the link is also cleared.

Task-number: QTCREATORBUG-134
Reviewed-by: con
This commit is contained in:
Thorbjørn Lindeijer
2009-11-03 14:29:49 +01:00
parent a4d1eb48c7
commit 2c115e934f
3 changed files with 58 additions and 35 deletions

View File

@@ -538,6 +538,9 @@ protected:
bool isValid() const
{ return !(pos == -1 || length == -1); }
bool operator==(const Link &other) const
{ return pos == other.pos && length == other.length; }
int pos; // Link position
int length; // Link length
@@ -593,6 +596,7 @@ private:
QTextBlock collapsedBlockAt(const QPoint &pos, QRect *box = 0) const;
void updateLink(QMouseEvent *e);
void showLink(const Link &);
void clearLink();