diff options
| author | Alexander Volkov <avolkov@astralinux.ru> | 2018-09-25 18:09:28 +0300 |
|---|---|---|
| committer | Alexander Volkov <avolkov@astralinux.ru> | 2021-01-12 15:33:10 +0300 |
| commit | 376e3bd8ecf40881685714f6f19e12d68e92127e (patch) | |
| tree | 8a137b8cea51115b405202ef6c0cffdf6fe78192 /src/widgets/doc/snippets/qtablewidget-using/mainwindow.cpp | |
| parent | 9e09677c1dd4da92735736a0fbcb703416bf4d6d (diff) | |
Introduce QUrlResourceProvider to load resources for HTML
QTextDocument and the text editor classes suggest to override
their loadResource() methods to provide data associated with
a text document. This approach has the following drawbacks:
- it requires subclassing
- there is no way to set a global resource provider
- QLabel is missing virtual loadResource() method and
it can't be added without breaking ABI
QUrlResourceProvider is designed to solve these issues.
One should create a derived class that implements
QUrlResourceProvider::resource(). The objects of the derived
class then can be set for any text document.
The default resource provider can be set with
QUrlResourceProvider::setDefaultProvider().
This change also adds QLabel::setResourceProvider(),
which doesn't break ABI.
[ChangeLog][QtGui][Text] Introduced QUrlResourceProvider that allows to
load resources for HTML. It is intended to replace the use of
QTextDocument::loadResource().
Change-Id: Iaf19b229f522a73508f20715257450fe58f68daf
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/doc/snippets/qtablewidget-using/mainwindow.cpp')
0 files changed, 0 insertions, 0 deletions
