This does not work with text wrapping since there are multiple
QTextLines inside a block but we can not adjust the line hight inside a
block. This needs to be addressed inside Qt.
This reverts commit dc64f3207b.
Change-Id: If6c28056da9891eeeb75f5939a42f08360013a80
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Also compare the anchor when looking for the selection. Otherwise we
might get a selection highlight that expands on adjacent extra
selections like code model warnings.
Change-Id: Ib8460c1089ed69d14b7a408ca70e7ac1f8642f6e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
It's never used, and actually there wouldn't be any sensible thing to do
with it.
Change-Id: Id8a8df18c7db4b98e5abbc034240bb90dc1dcaa9
Reviewed-by: hjk <hjk@qt.io>
Some printer seem to return an empty page rect for some configuration
which results in an invalide page count and a freezing ui. Do not print
anything and return in that case.
Fixes: QTCREATORBUG-24110
Change-Id: I42349bc97734e3f6a67502482d2b02959e865665
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
If the selection foregound color is undefined do not overwrite the
already applied highlighting.
Fixes: QTCREATORBUG-24656
Change-Id: Ia125e8e6b9efba73d5a13facc2446a793d59f5c3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Adapt to QStringRef and QAbstractItemView::viewOptions() removal
Task-number: QTCREATORBUG-24098
Change-Id: Ia2d446312f68bd60143796284d31f5bba56aa0ed
Reviewed-by: David Schulz <david.schulz@qt.io>
... by setEasingCurve().
Deprecation for 5.15.1/removal in 6 is looming.
Task-number: QTCREATORBUG-24098
Change-Id: Ic116cf78b8468f03f6b01e0b7af56584289589cc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Otherwise all editor ancestors like scrollbars might get an incorrect
palette.
Fixes: QTCREATORBUG-24270
Change-Id: I133cd1dbe284282122972130666c280ea412ea1a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The coreplugin/id.h header is kept for downstream for now.
Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Having a search inside a document and switching the find options
to use regular expressions may end up in lots of warnings
regarding using an invalid expression for a match call.
Check beforehand to avoid this.
Change-Id: Ia929090ae3910ff3fa87b57a5718293d2b6ccd04
Reviewed-by: David Schulz <david.schulz@qt.io>
The only reason it was required to be in Core plugin, was its use of Id,
which now is available in Utils.
Change-Id: I66ce863c24924e6448d339b3422538a7fe167336
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Instead of just enable actions that were disabled from the beginning you
can no disable optional actions.
Change-Id: I986b8a72523a8aeec9f4ccf76cd4921018ffc003
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Use an additional action mask to enable actions like find usage and
rename symbol per editor instance.
Change-Id: Iabee1820d0f3c156ad30ba760bfce9f6181045e6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
After qtbase/4a240bb67e72b34c80af448e0a74846609fa6975,
the scaling of the margins changed.
Fixes: QTBUG-81121
Change-Id: I6987fe8e25da1771dd2bcd36fff8558fefd3dee0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Add the possibility to more efficient column selection for large
documents using keyboard shortcuts Alt+Shift+PageUp/PageDown/Home/End.
Change-Id: Iaa2d9aeee587f1317dd82d7fef0b01fd5f5f7a55
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Only follow links under cursor if control was already activated when
pressing the mouse button. This amends
11eea3aae0 which just checks if control is
pressed after releasing the mouse button.
Change-Id: I90d23dd3e5ff63aac7812fad889ad9fb7c052b56
Fixes: QTCREATORBUG-23745
Reviewed-by: Alexis Murzeau <amubtdx@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
It did not center on the text cursor.
- Fix lastVisibleBlockNumber() to return the last block if the editor is
scrolled to the bottom (and there potentially is no block located at the
very bottom edge of the editor widget).
- Fix comparison of block numbers (0-based) with line numbers (1-based)
Change-Id: I21405443bea3533e393a7cf320ded6d47f647949
Reviewed-by: David Schulz <david.schulz@qt.io>
Some include of QPainterPath was removed in Qt, causing errors like:
easingpane\easinggraph.cpp(258): error C2079: 'path' uses undefined class 'QPainterPath'
easingpane\easinggraph.cpp(275): error C2027: use of undefined type 'QPainterPath'
easingpane\easinggraph.cpp(305): error C2664: 'void QPainter::drawPath(const QPainterPath &)': cannot convert argument 1 from 'int'
to 'const QPainterPath &'
easingpane\easinggraph.cpp(305): note: Reason: cannot convert from 'int' to 'const QPainterPath'
easingpane\easinggraph.cpp(305): note: use of undefined type 'QPainterPath'
...
Add the missing include statements.
Change-Id: I4f3383cbcec891a52480a683c9c76ed5deee2b2a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
In 6959618d7b a default indenter was set
on all text editor factories.
Unfortunately some editors, like the C++ editor, set their indenter in
the text document constructor, which would then be overridden by this
default indenter.
For now remove the default indenter again until this is better thought
through.
Partially reverts 6959618d7b.
Change-Id: I8f32e92438883edb6be853fa838b75297347a937
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Simple indentation based on the previous line was already available in
the NormalIndenter class. Merge that up the hierarchy chain into
TextIndenter which is the base for other text-based indenters, and make
that the default indenter for text editor factories.
Text editor factories that don't have a special indenter get at least
basic indentation support for free that way.
Change-Id: Ib977a990f10a99bead82bc8a8348c02a106665f1
Reviewed-by: David Schulz <david.schulz@qt.io>
If the text cursor is visible, but in the bottom area of the editor, it
would be no longer visible after splitting. That makes the probable
"area of interest" vanish from sight.
Check that condition (visible before, but would not be visible
afterwards), and if that is the case center the text cursor in both
resulting editors.
Change-Id: I8c8dccd2d9db439c82d0aca34b8ef99fa97aa48e
Reviewed-by: David Schulz <david.schulz@qt.io>
And when restoring editors in other ways (like from a session).
When splitting, the new editor was always scrolling to make the text
cursor visible, even if it wasn't visible in the original.
1. open editor with long contents
2. scroll away from the text cursor, so the line isn't visible
3. split and wonder
or 3. close and re-open Qt Creator, and restore the session
Our code already does set the state of the new editor to the old one,
but that state was destroyed by QPlainTextEdit::showEvent, which scrolls
on first show if text was added to the document.
So, wrap the showEvent with save/restoreState on first show.
Change-Id: I95e0b4e963ebb33d13ce020affaf7fc7f94c9257
Reviewed-by: David Schulz <david.schulz@qt.io>
The update rect should be identical to the calculated line rect when
repainting the current line highlight. And the offset must not be
calculated into the line rect since we just want to repaint the complete
viewport width.
Fixes: QTCREATORBUG-23647
Change-Id: I0656f0fee4823c8ff55c70b2a4cd69f0183e141d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Also when text is removed via shortcuts.
Fixes: QTCREATORBUG-15038
Change-Id: I1c78b9306594fbf13378a55b27be18769de141a6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
So far it was only possible to combine TextEditorFactory, BaseTextEditor
and TextEditorWidget directly.
That TextEditorWidget is also directly a QPlainTextEdit made it
impossible to "decorate" the text editor widget with something else
without a lot of effort.
Make it possible to create a text editor factory that returns an
arbitrary widget, as long as it can be "cast" to a TextEditorWidget with
either qobject_cast or Aggregation::query. That way the TextEditorWidget
instance can be attached to the editor widget via Aggregation.
Adapt other code that accesses TextEditorWidget from editors
accordingly. Introduce a common method how to do that.
Change-Id: I72b8721f3a8a8d8281c39af75253e9c80cbe1250
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>