diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-05-25 12:09:53 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-06-20 20:29:15 +0200 |
commit | b149f5d77a3c362af1e82e95ddf0ae13954d2538 (patch) | |
tree | 8a668cffd0844dc91de222047135066f82e6ace0 /src/gui/text | |
parent | 84536ae61ed887f179deafb75fd28757f1cf9aba (diff) |
Overload QTextBrowser::setSource() to add optional type argument
Now that it's trying to guess whether the type is markdown based on
the file extension, there needs to be a way to override it. For example
it might be arranged that directory listings will be generated in
markdown format instead of HTML; then when loading a source URL that
is a directory, the application may override the type. The type for
the single-argument setSource(url) is UnknownResource to preserve
the existing behavior, but the user can override the guessing by
setting a specific type.
Change-Id: Id111efd24de7d8fd18c47b16a2d58f5b09d77891
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextdocument.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/text/qtextdocument.h b/src/gui/text/qtextdocument.h index edb6bd9310..2fadc40cd2 100644 --- a/src/gui/text/qtextdocument.h +++ b/src/gui/text/qtextdocument.h @@ -225,6 +225,7 @@ public: void print(QPagedPaintDevice *printer) const; enum ResourceType { + UnknownResource = 0, HtmlResource = 1, ImageResource = 2, StyleSheetResource = 3, @@ -232,6 +233,7 @@ public: UserResource = 100 }; + Q_ENUM(ResourceType) QVariant resource(int type, const QUrl &name) const; void addResource(int type, const QUrl &name, const QVariant &resource); |