feat: add widget for a text browser with image support

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow
2022-08-02 15:17:54 -03:00
parent 787234a53a
commit ea3be17220
5 changed files with 218 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#include "ProjectDescriptionPage.h"
#include "VariableSizedImageObject.h"
#include <QDebug>
ProjectDescriptionPage::ProjectDescriptionPage(QWidget* parent) : QTextBrowser(parent), m_image_text_object(new VariableSizedImageObject)
{
m_image_text_object->setParent(this);
document()->documentLayout()->registerHandler(QTextFormat::ImageObject, m_image_text_object.get());
}
void ProjectDescriptionPage::setMetaEntry(QString entry)
{
if (m_image_text_object)
m_image_text_object->setMetaEntry(entry);
}