Commit Graph

398 Commits

Author SHA1 Message Date
Eike Ziller
f17bf14533 Help: Use settings->setValueWithDefault
Task-number: QTCREATORBUG-24762
Change-Id: Ia2f7c0834758097814dd6234a6f4fd656a3821b0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-15 14:43:17 +00:00
Christian Stenger
b9c5d63c27 Help:iOS: Replace QRegExp by QRegularExpression
Task-number: QTCREATORBUG-24098
Change-Id: Ie63ac88e3afdc39db0d9ead4b058efbaec402001
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-13 12:45:11 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Christian Kandeler
02785342ac Fix some clang warnings about unused lambda captures
There are more, but we need to keep those because MSVC believes they are
required. This is the subset that satisifies both compilers.

Change-Id: I0b0a63d5496acc119a7f0513d3a1da0b76fa1fca
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-24 08:44:58 +00:00
Jarek Kobus
9ca7326d90 Integrate new filter engine
Adapt the code to deprecated usage of map as a multi map,
hence all cases replaced by QMultiMap.

Change-Id: I2d480467cd6e91d3e880555e6a21058dec056b3f
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-04-02 11:22:03 +00:00
Eike Ziller
43f364deb0 Help: Register "Extending Qt Creator" documentation as well
Doesn't hurt, might help.

Change-Id: Ie1173f4a7a4ca4084048ef6c22cd56c8a7916156
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-01-15 06:02:54 +00:00
Eike Ziller
dd7e73221e Move "Web Search" locator filter from Help to Core
It was invented as a "remote help" filter, but it actually doesn't have
anything to do with help or documentation.
Move it to more general place, also to enable future generalization to
another custom filter type.

Change-Id: Ib80eacd3c7cc33ae9f4d9353fa820272e3b0b25f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-12-18 12:42:18 +00:00
Eike Ziller
aad6ad8c10 Help: Replace annoying URL syncing by explicit Open in Edit Mode
Qt Creator was syncing the current page in Help mode to the page shown
in the side-by-side view in edit mode.
This doesn't really make sense because context is completely lost.
Instead provide the explicit option to open a help page in edit mode,
also from the external help window.

Fixes: QTCREATORBUG-19198
Change-Id: I00698bb431d5c116dd1e0e1cbdc5fbd7421ac267
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-30 11:19:54 +00:00
Eike Ziller
d34aee4d53 Help: Fix missing page switching keyboard shortcuts for external window
Which are relevant now that external windows support multiple pages.

Change-Id: Ibc748e9e0582c8d54264af535c32aa2702f91631
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-30 11:19:21 +00:00
Eike Ziller
3b2209b870 Help: Get rid of special CentralWidget class for help mode viewer
Change-Id: Id733eb0449cdaed5901e4144089c8adaaf07d7a9
Reviewed-by: hjk <hjk@qt.io>
2019-09-24 12:57:56 +00:00
Eike Ziller
4f19046d75 Help: Remove OpenPagesManager::instance()
It's owned by the HelpWidget now, and should be accessed through that.

Task-number: QTCREATORBUG-20558
Change-Id: I99118bb966922e6b4d356cf892d7604365357785
Reviewed-by: hjk <hjk@qt.io>
2019-09-24 12:57:29 +00:00
Eike Ziller
bef986f3fd Help: Move OpenPagesManager::createPage to HelpWidget
Removes some unneeded indirection.

Task-number: QTCREATORBUG-20558
Change-Id: I65d8d31e10300da3015f388ac490b8be6e090f29
Reviewed-by: hjk <hjk@qt.io>
2019-09-24 09:21:08 +00:00
Eike Ziller
f52c4f450d Help: Move viewer backend management from plugin to local help manager
which poses as a settings class.

Change-Id: Icb01f0d4750c2d197875954a648ae7358c4c217a
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-11 06:12:56 +00:00
Eike Ziller
e0e5621b80 Help: De-duplicate management of help viewer pages
For the help mode, the help viewer pages were managed both by the
OpenPagesModel and the HelpWidget, and needed manual keeping in sync.

Instead make the model just an aspect of the HelpWidget, manage
creation/deletion of pages via the HelpWidget, and use the model only
for the pure MVC API purposes.

Task-number: QTCREATORBUG-20558
Change-Id: Ib7d6f2561239b0d5f3328dfd30c84718f81af0a1
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-09 11:32:24 +00:00
Eike Ziller
0efd65e07e Help: Add litehtml based viewer backend
For CMake add litehtml installation path to CMAKE_PREFIX_PATH
For qmake pass litehtml installation path via LITEHTML_INSTALL_DIR qmake
variable

Release build of litehtml is recommended.

The litehtml backend is used by default when available, you can force
QTextBrowser again with the environment variable
"QTC_HELPVIEWER_BACKEND=textbrowser".

Some things are not implemented yet:
- Text search
- Context menu
- Shift-drag to extend existing selection

Change-Id: I79f989e5fe2063de2e9832abbed19b24d7a1a1fe
Reviewed-by: hjk <hjk@qt.io>
2019-08-28 08:06:20 +00:00
Tasuku Suzuki
395b5ec185 Add open online documentation button to help viewer
Change-Id: I21685005709332b1201aaf08804399ecbd82bf7c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-29 09:15:14 +00:00
Eike Ziller
b02f4ae615 Merge remote-tracking branch 'origin/4.9' into 4.10
Change-Id: I6f1bc9381dc8c0ce8abc5a6c006087076d8fc1bc
2019-06-18 11:48:32 +02:00
Michl Voznesensky
5bcc70b34d Fix bug for with redirect to general landing page Qt bug tracker. Now the redirection goes to the page creating the bug
Fixes: QTCREATORBUG-18734
Change-Id: I49847edce7da6a993ded3a9538334279965b6eb4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-18 07:41:25 +00:00
hjk
19e1cf1520 Replace uses of qVariantFromValue with QVariant::fromValue
Deprecated in Qt 5.14, alternative has been around since Qt 4 at least.

Change-Id: I4e3a53c289088368609e0d0ce2405a832d311308
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-05-27 12:33:29 +00:00
Eike Ziller
c53ccceff1 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/debugger/debuggerkitinformation.cpp
	src/plugins/languageclient/languageclientmanager.cpp
	src/plugins/plugins.pro
	src/plugins/projectexplorer/kit.cpp
	src/plugins/projectexplorer/kitmanager.cpp

Change-Id: I66fb941202991f35f7d7761430b21e42dfc678a8
2019-03-14 15:51:15 +01:00
Eike Ziller
71c6ad7f9e Help: Improve handling of results from index lookup
If help is only found by looking up in the index, show a selection
dialog to the user even if there is only one result. Otherwise we create
the impression that we really think that the help we find is the correct
one.

Also do not add the help text to the tool tip in this case.

Test case: struct Foo { static void objectCreated() {} };

Change-Id: I9579302843ea2923e06f56f4b646dd101f183b3f
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-03-05 10:33:51 +00:00
Eike Ziller
334c76fd31 Help viewer: Add option for scroll wheel zooming
Fixes: QTCREATORBUG-14154
Change-Id: Ia6c4aedb78954614477f0228ba82c4dc476a2525
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-21 13:26:06 +00:00
Eike Ziller
8309606a52 Help: Lookup in index if ID is not found
And if multiple topics are found in the index, show the topic chooser
dialog that we already have for the help index.

Fixes: QTCREATORBUG-12704
Task-number: QTCREATORBUG-15959
Change-Id: I7afa6f44bbecc12f602aaaa4a11209ec72399689
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-11 08:24:40 +00:00
Eike Ziller
f973b4e94a Help: Move finding the best documentation link to HelpItem
Change-Id: I5032d380295d942cd4f334e4bf47e349dd5b0aea
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-02-07 06:21:05 +00:00
Eike Ziller
92ddaea43e Help: Make a difference between "empty" and "valid"
Context help should take the HelpItem from the tool tip if it was set,
even if it isn't valid.
Similarly, if the help item was set on the text editor, it should not
ask the hover handlers (again), even if that is invalid

Change-Id: I481f8ad73c3cf8fdbb90f737ab36b4e380467026
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-04 09:20:55 +00:00
Eike Ziller
443931c1da Help: Move resolution of help from multiple candidate IDs to HelpItem
No need for code duplication.

Change-Id: I3d2c795d072b8de5818e1844b8126e526339c0da
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-01 11:28:02 +00:00
Eike Ziller
32429e11c9 Help: Avoid double lookup for help tooltips
Save the HelpItem directly in the tooltip instead of the help ID which
would need to be looked up again.

Change-Id: I107e82e89d9ea26cad9d6532ad4c687d1ac8f1ec
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-01 11:00:55 +00:00
Eike Ziller
d386b3c241 Help: Avoid ambiguity of help ID being interpreted as URL
Users know if they have a URL or not, we should not guess (and then even
guess differently at different places)

Change-Id: Iaaf69a94baadbee0ff427a2bc9065b714dcf8478
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-01-31 10:32:36 +00:00
Nikolai Kosjar
ab770f967b Help: Fix url handler
Change-Id: I59a83a8e6532cc91ad355cbb363faac75da6feed
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-01-30 12:04:44 +00:00
Eike Ziller
418dcfbcbb Help: Avoid multiple lookups of help id for context help
Context help would first query the database with potential IDs, and
afterwards the help plugin would look up the links for the resulting ID
again.
Pass the HelpItem (which potentially contains the cached links) directly
to context help.

Change-Id: I73bddcd3cd4eacaea412b98d53c5e5354a31f3d5
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-01-29 07:57:19 +00:00
Eike Ziller
bbe0cd68fa Help: Remove unused method and related code
Change-Id: I4c4641290eceb441339cc237ee74a52c1018e3ae
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-01-25 08:23:11 +00:00
Eike Ziller
379aef60f9 Help: Unify showing a specific help url
Makes code paths easier to follow.

Change-Id: I6056862c15dbbaa8c63f0633ba70a178cfa910f6
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-01-25 08:23:03 +00:00
Eike Ziller
809416c993 Help: Simplify and unify code
The help widget doesn't need to resolve the external help viewer
instance manually, we have an entrypoint for that already.

Change-Id: I6875c434428baac3f1883813207cf318d7d3dc09
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-01-24 14:03:38 +00:00
Eike Ziller
3c5650e514 Add macOS touch bar support
Introduce a generic Utils::TouchBar that implements a touch bar for
macOS based on QAction. Touch bars can be nested, and one is set to be
the application's top level touch bar.

Also add an ActionContainer for the touch bar. That allows us to manage
the layout of the touch bar the same way we do with menus.

Since the touch bar is an input device with very limited space, a
command in the touch bar needs to be specifically styled for the touch
bar by setting either touchBarText or touchBarIcon (or both).

Touch bars can be nested by nesting the ActionContainers. A nested touch
bar ActionContainer needs to specify an icon and/or text to show in the
touch bar button that opens that sub-bar.

Commands are only shown in the touch bar if they are valid within the
current context.

Implementation-wise we cannot use the standard NSPopoverTouchBarItem for
nesting touch bar levels. We cannot hide items in the touch bar, because
hidden items still take up space in the touch bar. So we need to rebuild
the touch bar regularly. Since the items we show are very dynamic, every
time the items in the toplevel bar change because of a context change,
any opened sub-level touch bar closes. That is why we maintain a stack of
touch bar levels ourselves, replacing the main touch bar with the current
level, and managing opening and closing the levels manually.

This patch adds buttons for Help, Bookmarks, Header/Source, Follow
(Symbol), Decl/Def, and a sub-bar for the debugger actions.

Fixes: QTCREATORBUG-21263
Change-Id: Ib63e610f21a993f1d324fe23c83a7f2224f434ac
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2019-01-15 14:33:56 +00:00
Daniel Wingerd
2710a9b0e5 help plugin: specify bgcolor for html
Change-Id: I5ffd9851d6bc43510f4eb3ad903055544d83b8b0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-12-14 10:46:35 +00:00
Daniel Wingerd
b8a4050bab help plugin: strip html from a translatable string
Change-Id: I4c147c969ae04c50ca2d6fd40143919236f97679
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-14 10:44:18 +00:00
Alessandro Portale
901b2be036 HelpPlugin: Modernize
modernize-use-*

Change-Id: Ie0058675c1336377326089dbc093436130f1fe03
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-12 11:10:38 +00:00
Leena Miettinen
5562cc7cfb Help: Add ellipsis to a menu item label that leads to a web site
Change-Id: Id273a8508c8393580c6b9222f95aa4033e9eca9a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-10-19 12:28:58 +00:00
Eike Ziller
b9db5ea86e Move documentationPath() from Core::ICore to Core::HelpManager
It is documentation related API, so it belongs there.

Change-Id: I5d1676f251e6deb92050ddedac19bf3c332aab54
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-09-20 07:19:49 +00:00
Eike Ziller
2c17fbe8dd Make Core independent from QtHelp
We don't want various plugins to depend on the Help plugin,
but we also do not want Core to depend on QtHelp.
For example when turning the Help plugin off, documentation should
actually no longer be registered through QtHelp. So we need
parts of the interface in Core, which must then be delegated
to the actual implementation in Help.

As positive side-effects the interface in Core will be slimmer,
and the code in the Help plugin can later be simplified, too,
because then we don't have the "Core" and the "Gui" help engines
separated in different plugins anymore, which should remove the
need for some setup indirections.

Task-number: QTCREATORBUG-20381
Change-Id: I634c5811c45d6a3dfd6ddc682cae270e38384cbf
Reviewed-by: hjk <hjk@qt.io>
2018-09-04 11:21:18 +00:00
Eike Ziller
8fa449126c Fix context of Locator input
- In the main window, the locator input (actually the status bar)
  visually feels like being part of the mode widget, so give
  it its context.
- In extra editor windows, the whole editor window should have
  "editor manager" context, so that is also active for the locator
  input.

Task-number: QTCREATORBUG-20626
Task-number: QTCREATORBUG-20071
Change-Id: Ib68d6a8177446572ea59c3cc057eca0706173e11
Reviewed-by: Xing Xiong
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-09 08:55:25 +00:00
Robert Loehning
2d7d0abd2d Help: Make "System Information" a QDialog again
Making it a QWindow meant that Alt-Tab will lead to the main window and
right back to "System Information" because this is modal. This
incovenience outweighs the convenience of having a "Maximize" button.

This reverts a part of 40d7399755

Task-number: QTCREATORBUG-20513
Change-Id: Idcea54ee2f60f9f7efde7d25ce0c305b87f445dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-08 10:46:06 +00:00
Eike Ziller
da18fc1f50 Help: Use nullptr and fix a few warnings
Change-Id: I7f7307a765d8755bf96b0cad1210e61df0a0199f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-04-19 12:07:59 +00:00
Eike Ziller
454e9ee5ca Add Context Help to text editor context menu
For this make the default context menu for the text editor extensible
and add the context help item from the help plugin, which now has an
optional dependency on the text editor to ensure correct loading order
if both are present.

Task-number: QTCREATORBUG-55
Change-Id: I378a491ba3700e65fc262bdb10c8ead5ad62cb33
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-29 08:26:24 +00:00
hjk
d3eb585db9 Help: Pimpl plugin and avoid use of global object pool
Create a HelpPluginPrivate class, move all previously private
HelpPlugin data and code there.

Make it live from HelpPlugin::initialize() to HelpPlugin destruction,
so it can be used to handle life time of data members automatically,
making use of IPlugin::addAutoRemovedObject unneeded.

Change-Id: I9e381ca20b98f4d9c06687c11b81a64e69ceeb96
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-05 12:42:27 +00:00
Nikolai Kosjar
dd06a4188d Core: Return context help id by callback
...to support asynchronous providers.

Change-Id: I483489c74e7886d5bc2bf00b65540c3d2c7afee0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-18 13:54:02 +00:00
Alexandru Croitor
b23dab3ba2 Avoid double deletion of HelpWidget when quitting application via Dock
HelpWidgets that are created to be shown in an external window, had
two different places where they were deleted:
1) When the widget was closed (due to Qt::WA_DeleteOnClose)
2) In HelpPlugin::aboutToShutdown via manual delete call

In certain circumstances (when the WebEngine backend was used)
this caused a double delete. Specifically, after opening an external
help window, and closing the MainWindow, the application did not quit
due to QTBUG-62596.

Now if the help window were left open, and the application was quit
via the macOS Dock, this caused a crash.

When the application quits, it calls the HelpPlugin::aboutToShutdown,
which deletes the HelpWidget. This in turn destroys the WebEngine
view, which destroys the underlying QQuickWidget, which destroys
a QQuickRenderControl, which calls
QQuickRenderControlPrivate::windowDestroyed, which handles all
posted QEvent::DeferredDelete events, which in turn triggers the
deletion of the same HelpWidget due to the
Qt::WA_DeleteOnClose attribute.

The solution is to remove the Qt::WA_DeleteOnClose attribute, and only
delete the external HelpWidget on shutdown, and not on CloseEvent.

Task-number: QTBUG-63945
Task-number: QTCREATORBUG-19582
Change-Id: I5b73ff7fe52e7e1259a8aa98c97c9dbedd5e3c20
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-17 16:24:43 +00:00
Eike Ziller
8e3efd92c6 Fix Get Started Now (and other links)
If we do not specify the correct documentation URL including the version
number, QtHelp will look for any documentation that has the given path.
Since we now register Qbs documentation, and that also has a file
"doc/index.html", the Get Started Now button could open the Qbs manual
instead of the Qt Creator one.
Specify the full documentation URL including version number to ensure
that QtHelp opens the right page.

Change-Id: Ia77103fe2763dd208d3b9a279a8301f7f5799c8b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-09-12 07:32:34 +00:00
Eike Ziller
9297ee92c6 Help: Fix destination of index locator filter
When using locator in the external help window, open help pages or show
the topic chooser in the external help window, not the main window.

Change-Id: I792223147f1eb00addafb2618017536c126c71dd
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-07-27 12:15:11 +00:00
Eike Ziller
6afc0c3eb6 Help: Add method for showing URL in specific viewer
That centralizes all the focus setting, raising of windows, etc. This
was for example already done wrong when opening links in help mode and
external window.

Change-Id: I5036b5caa751d1f36dc442078624a31fb8f573ee
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-07-13 10:49:16 +00:00