Commit Graph

13 Commits

Author SHA1 Message Date
Eike Ziller
d3b4f06ada Help/litehtml: Fix that invisible text was found via text search
We need to explicitly restrict the index to the html body, otherwise
e.g. the title tag will be included.

Change-Id: Ic7d177deb9cc1c5ce072265669f4d921c9cb4bb1
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-10-01 07:41:26 +00:00
Eike Ziller
2152d4750c Help/litehtml: Fix selection drawing for CMake documentation
Don't rely on litehtml calling draw_background for the root element.
Manually draw selections first, then let litehtml draw as before.

Change-Id: Ic9efd11b564dec1742aa6b6ffcb58133504681ff
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-26 09:31:20 +00:00
Eike Ziller
284eab836c Help/litehtml: Fix text search in presence of multi-byte characters
std::string::size is returning byte-count, not character count, in
contrast to QString::size. Do not mix.

Fixes: QTCREATORBUG-22970
Change-Id: I865ca0c13a08fb500b6526ba6ee3207359e75107
Reviewed-by: hjk <hjk@qt.io>
2019-09-24 12:58:21 +00:00
Christian Stenger
78780bb2db Help: Fix compile with older Xcode
Change-Id: I73e062544c859ecf03cbb808daafe936be84bdbd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-23 07:34:15 +00:00
Eike Ziller
fe6ba084c4 Help/litehtml: Fix litehtml build on Windows and with GCC 5.3
GCC 5.3 doesn't want to convert char* literals to QString sometimes, and
for MSVC conversions litehtml::tstring/tchar_t <->
QString::fromStdString/QString fails because the former was wstring and
wchar
Also position independent code is needed on Linux

Change-Id: Iec8dd0d9d38a07cd1c4db49c9edf10e3d1d5b156
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-09-20 12:50:37 +00:00
Eike Ziller
057215eb10 Help/litehtml: Support global mouse selection on Linux
Change-Id: Ifef500e4777c8cad1b41cfd69240a31509abd8a0
Reviewed-by: hjk <hjk@qt.io>
2019-09-18 08:13:55 +00:00
Eike Ziller
dff7e1515a Help/litehtml: Implement text search
Build an index between (visible) text and litehtml elements, so we can
use the regular text search functionality of Qt.

Change-Id: I2bf29628482f81c67b20b9a02d7808a330a073eb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-09-17 12:58:25 +00:00
Eike Ziller
a1d21fb8fe Help/litehtml: Fix resolution of font name
- check case-insensitively
- need to break after the first font was found in database

Change-Id: Iddd58ec88d61b2506965a618441205e8176e383f
Reviewed-by: hjk <hjk@qt.io>
2019-09-13 11:28:39 +00:00
Eike Ziller
f5d6eb564b Help: Fix font point sizes with litehtml
Change-Id: Ia2d7434ed965b00075747c0bdd43d90a236b99dd
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-09-13 06:48:02 +00:00
Eike Ziller
62d16e437a Help: Add context menu to litehtml backend
Change-Id: I051984e360b41d17d32cff80fd1d4017fc81dae6
Reviewed-by: hjk <hjk@qt.io>
2019-09-10 12:56:51 +00:00
Eike Ziller
52729892d3 Help/litehtml: Support under-/overline and strikethrough
Change-Id: If8bd9480475e78cd2b0382d1dbb8e5b56d69ae10
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-09-10 12:06:05 +00:00
Eike Ziller
4b8ec5ffb7 Help: Fix rendering images with litehtml
Creating the document parses it, which also populates the pixmap cache,
so we may not clear the pixmap cache afterwards.

Change-Id: I1e6d1669db898b1e50d59d135e52807afb307d09
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-09-02 15:18:15 +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