forked from qt-creator/qt-creator
Add support for contents() to designer documents
Change-Id: Ie8c65c7a692d752bac3b6427f66116282b486576 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -141,6 +141,11 @@ bool FormWindowFile::save(QString *errorString, const QString &name, bool autoSa
|
||||
return true;
|
||||
}
|
||||
|
||||
QByteArray FormWindowFile::contents() const
|
||||
{
|
||||
return formWindowContents().toUtf8();
|
||||
}
|
||||
|
||||
bool FormWindowFile::setContents(const QByteArray &contents)
|
||||
{
|
||||
if (Designer::Constants::Internal::debug)
|
||||
@@ -184,6 +189,8 @@ void FormWindowFile::setFilePath(const FileName &newName)
|
||||
void FormWindowFile::updateIsModified()
|
||||
{
|
||||
bool value = m_formWindow && m_formWindow->isDirty();
|
||||
if (value)
|
||||
emit contentsChanged();
|
||||
if (value == m_isModified)
|
||||
return;
|
||||
m_isModified = value;
|
||||
|
@@ -56,6 +56,7 @@ public:
|
||||
OpenResult open(QString *errorString, const QString &fileName,
|
||||
const QString &realFileName) override;
|
||||
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||
QByteArray contents() const override;
|
||||
bool setContents(const QByteArray &contents) override;
|
||||
bool shouldAutoSave() const override;
|
||||
bool isModified() const override;
|
||||
|
Reference in New Issue
Block a user