PrismLauncher/launcher/ui/widgets/ProjectDescriptionPage.cpp
flow d194b02e28
fix: prevent images overriding content when changing pages
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-10-11 15:51:54 -03:00

24 lines
633 B
C++

#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);
}
void ProjectDescriptionPage::flush()
{
if (m_image_text_object)
m_image_text_object->flush();
}