summaryrefslogtreecommitdiffstats
path: root/examples/widgets/doc/codeeditor.qdoc
diff options
context:
space:
mode:
authorFrederik Gladhorn <[email protected]>2012-08-29 10:25:56 +0200
committerQt by Nokia <[email protected]>2012-09-01 11:24:50 +0200
commit3ef3c662fecf60be1efcc315a1ae585658c1bec3 (patch)
tree9942df6af7420a6c2b4fb48cd44bddc9cd3e8a5e /examples/widgets/doc/codeeditor.qdoc
parenteede34aa6b8f60ec2627ebd8726d76e15478edc3 (diff)
Don't reference widgets/widgets in example doc.
Change-Id: Ie1fe516f75ca8c1b2233dc6bb2b887b55593e730 Reviewed-by: Martin Smith <[email protected]>
Diffstat (limited to 'examples/widgets/doc/codeeditor.qdoc')
-rw-r--r--examples/widgets/doc/codeeditor.qdoc24
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/widgets/doc/codeeditor.qdoc b/examples/widgets/doc/codeeditor.qdoc
index 281239acea5..695ac5c4cee 100644
--- a/examples/widgets/doc/codeeditor.qdoc
+++ b/examples/widgets/doc/codeeditor.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example widgets/widgets/codeeditor
+ \example widgets/codeeditor
\title Code Editor Example
The Code Editor example shows how to create a simple editor that
@@ -80,13 +80,13 @@
extend the editor with breakpoints or other code editor features.
The widget would then help in the handling of mouse events.
- \snippet widgets/widgets/codeeditor/codeeditor.h extraarea
+ \snippet widgets/codeeditor/codeeditor.h extraarea
\section1 CodeEditor Class Definition
Here is the code editor's class definition:
- \snippet widgets/widgets/codeeditor/codeeditor.h codeeditordefinition
+ \snippet widgets/codeeditor/codeeditor.h codeeditordefinition
In the editor we resize and draw the line numbers on the \c
LineNumberArea. We need to do this when the number of lines in the
@@ -102,37 +102,37 @@
We will now go through the code editors implementation, starting
off with the constructor.
- \snippet widgets/widgets/codeeditor/codeeditor.cpp constructor
+ \snippet widgets/codeeditor/codeeditor.cpp constructor
In the constructor we connect our slots to signals in
QPlainTextEdit. It is necessary to calculate the line number area
width and highlight the first line when the editor is created.
- \snippet widgets/widgets/codeeditor/codeeditor.cpp extraAreaWidth
+ \snippet widgets/codeeditor/codeeditor.cpp extraAreaWidth
The \c lineNumberAreaWidth() function calculates the width of the
\c LineNumberArea widget. We take the number of digits in the last
line of the editor and multiply that with the maximum width of a
digit.
- \snippet widgets/widgets/codeeditor/codeeditor.cpp slotUpdateExtraAreaWidth
+ \snippet widgets/codeeditor/codeeditor.cpp slotUpdateExtraAreaWidth
When we update the width of the line number area, we simply call
QAbstractScrollArea::setViewportMargins().
- \snippet widgets/widgets/codeeditor/codeeditor.cpp slotUpdateRequest
+ \snippet widgets/codeeditor/codeeditor.cpp slotUpdateRequest
This slot is invoked when the editors viewport has been scrolled.
The QRect given as argument is the part of the editing area that
is do be updated (redrawn). \c dy holds the number of pixels the
view has been scrolled vertically.
- \snippet widgets/widgets/codeeditor/codeeditor.cpp resizeEvent
+ \snippet widgets/codeeditor/codeeditor.cpp resizeEvent
When the size of the editor changes, we also need to resize the
line number area.
- \snippet widgets/widgets/codeeditor/codeeditor.cpp cursorPositionChanged
+ \snippet widgets/codeeditor/codeeditor.cpp cursorPositionChanged
When the cursor position changes, we highlight the current line,
i.e., the line containing the cursor.
@@ -151,13 +151,13 @@
block, the cursor should be moved with QTextCursor::movePosition()
from a position set with \l{QTextCursor::}{setPosition()}.
- \snippet widgets/widgets/codeeditor/codeeditor.cpp extraAreaPaintEvent_0
+ \snippet widgets/codeeditor/codeeditor.cpp extraAreaPaintEvent_0
The \c lineNumberAreaPaintEvent() is called from \c LineNumberArea
whenever it receives a paint event. We start off by painting the
widget's background.
- \snippet widgets/widgets/codeeditor/codeeditor.cpp extraAreaPaintEvent_1
+ \snippet widgets/codeeditor/codeeditor.cpp extraAreaPaintEvent_1
We will now loop through all visible lines and paint the line
numbers in the extra area for each line. Notice that in a plain
@@ -169,7 +169,7 @@
and adjust these values by the height of the current text block in
each iteration in the loop.
- \snippet widgets/widgets/codeeditor/codeeditor.cpp extraAreaPaintEvent_2
+ \snippet widgets/codeeditor/codeeditor.cpp extraAreaPaintEvent_2
Notice that we check if the block is visible in addition to check
if it is in the areas viewport - a block can, for example, be