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>
... in TextEditorFactory explicitly. Plan is to remove the QObject
inheritance of the factory, so it can't serve as a parent anymore.
Change-Id: I7bad358b5d150c695befc7ad4afcf7c2be7fd248
Reviewed-by: David Schulz <david.schulz@qt.io>
Also, replace or remove unneeded Q_OBJECTs, and make base
setters and adders protected.
Change-Id: I212257ef53984d8852dc8c478537199fc9483486
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We can't just add widgets after the first action of the toolbar.
The first action might not have a widget and will assert for that reason
in Qt.
Change-Id: Ib69c7d6d91bd56f25023aaebf961fef15cdcf008
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
If the cursor is positioned at a word boundary the action behaves
incorrect. Copy the behavior of QWidgetTextControlPrivate::keyPressEvent
which feels more natural.
Fixes: QTCREATORBUG-8977
Fixes: QTCREATORBUG-7056
Change-Id: I9dc0102023bb6234dcfa82619a976c723bc37a05
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Renaming the auto indent function triggered by Ctrl+I to make room
for a real format action.
Change-Id: If5731353311030d66a20f1093a7fdd300703ebbc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This avoids showing the option for example in git log or blame views.
The user also should not be able to actually change the line ending
style of read-only editors.
Fixes: QTCREATORBUG-23276
Change-Id: Ifa5cc9f663539928b4d5422b020e348b439684fa
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Marius Sincovici <smaryus@gmail.com>
The link is updated on the release anyway. Reset the press state of
the link now after a mouse move event.
Fixes: QTCREATORBUG-21848
Change-Id: Ice7a9873b1635a1b59ba7b8f2a266bf14e28c112
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
And use that in the Include and Type Hierarchy
panels to allow resizing the panels smaller.
Fixes: QTCREATORBUG-23197
Change-Id: Ia4b39e610c7a4be4df564dc69573f4748d7634a5
Reviewed-by: David Schulz <david.schulz@qt.io>
If the paint event rect does not contain the complete line, request an
update with the full line width also for editable editors. This fixes
current line highlight issues in the commit reword editor.
Change-Id: I6b93230a47bdd61248c1aa9631208606cbbae7c8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Check whether an editor already contains the hover handler before adding
to the list of handlers. Also remove the handler when a document is
deactivated for a specific client.
Change-Id: Iec1d3a0fd1dc3f02c8dd50b8968ff063efe2508a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
We should not force the tool tip text to HTML when help content is
available or when adding the F1 icon.
Instead add help content and F1 icon into the tool tip layout.
Change-Id: Ibe2d4fa2fb81bcda4e5aeb0d7d86dbf63fcf3ce6
Reviewed-by: David Schulz <david.schulz@qt.io>
Instead of just the editor with the info bar that was triggering the
download action or none editor if the action was triggered from the
settings dialog.
Change-Id: I4158eeb7fdb0a763d082c6d801b400e8635c7f38
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
by renaming it to Download Definitions and adding a tooltip stating that it
collects all definitions that are missing or were updated after the release and
downloads it to the ksyntax highlighting user folder.
Also adding a separate reload definitions button in the settings behind
the user path.
Change-Id: I059cc98e33147cae910fa4fdb35631d1dca81448
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
see QWidgetTextControl::processEvent and
QInputControl::isCommonTextEditShortcut. This will break assigning
shortcuts to for example Shift+a.
Change-Id: I4f97c27a47e2a7a44bf06b3ca949a6de74d4bb64
Fixes: QTCREATORBUG-22854
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Add into the text editor toolbar a combo box which allows to change
the line endings for an open document.
The supported line endings are LF and CRLF.
Change-Id: I029ba7867e0087b162edba7aba1bd1d1e966fd69
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Use it for search and replace functions as well as for Locator.
The camel case navigation can be switched on / off with
the existing menu Options > Text Editor > Behavior >
Enable Build-in camel case navigation.
Fixes: QTCREATORBUG-21140
Change-Id: I3f2dcafff231366b3c8f08c14514dd8940cca2a0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.
Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
When using the 'windowsvista' style the folding markers are blue when
hovered. This color is almost invisible on the default folding range
background color. Use the tested folding markers of the fusion style,
because it is already used when device pixel ratio != 1.0
Change-Id: I23659cce71a2eb101692597a1d256d43f6426920
Fixes: QTCREATORBUG-21702
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This restores a feature of older Qt Creator versions: typing "over"
closing punctuation. For instance, if my cursor is at | and I have
something like this:
if (statement|)
... and I type the ) character, older versions of Qt Creator would not
end up with )). With newer versions of Qt Creator, this behavior is
limited to the case where an autocompletion has just happened (i.e. if I
typed the opening ( character, the closing ) is auto inserted and
highlighted - and if I type it myself, it won't add a second one).
Task-number: QTCREATORBUG-16946
Change-Id: I45af3ac139d5e7c76e5f0a8a9d66762f9209a525
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Schulz <david.schulz@qt.io>
Instead of the first visible block we need to check the last invisible
block whether we should add the folding end text to the fold
replacement.
Introduced in b6b756e737
Change-Id: Id93403a14145c09069281d32d5b622bad80c4ae6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Add a button to the multiple definition found info that saves the
definition of the current highlighter for the open document.
Change-Id: I04b1b7571a864d781747547a1d315ec25bb6b5a1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Mainly to get rid of the QProcess::finished deprecation warning.
Also adjust coding style in the surrounding connects when needed.
Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>