forked from qt-creator/qt-creator
Design mode/Qt Designer: clean-up Part II: Fix undo.
Re-introduce FormEditorFile that delegates dirty handling to the form window. Change DesignerXmlEditable to be an IEditor that embeds TextEditable so that the PlainTextEditor can work with it, but delegates relevant functionality to FormEditorFile. Centralize all form window creation code that was scattered around in FormEditorW::createEditor() and have that return a struct Editor data, which is passed to FormEditorStack. Update the text editor only on open/createNew/switch away from design mode.
This commit is contained in:
@@ -32,8 +32,7 @@
|
||||
|
||||
#include <coreplugin/ifile.h>
|
||||
|
||||
#include "widgethost.h"
|
||||
#include "designerconstants.h"
|
||||
#include <QtCore/QPointer>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QDesignerFormWindowInterface;
|
||||
@@ -65,9 +64,12 @@ public:
|
||||
|
||||
// Internal
|
||||
void setSuggestedFileName(const QString &fileName);
|
||||
|
||||
bool writeFile(const QString &fileName, QString &errorString) const;
|
||||
bool writeFile(QFile &file, QString &errorString) const;
|
||||
|
||||
QDesignerFormWindowInterface *formWindow() const;
|
||||
|
||||
signals:
|
||||
// Internal
|
||||
void reload(const QString &);
|
||||
@@ -78,10 +80,12 @@ public slots:
|
||||
|
||||
private:
|
||||
const QString m_mimeType;
|
||||
|
||||
QString m_fileName;
|
||||
QString m_suggestedName;
|
||||
|
||||
QDesignerFormWindowInterface *m_formWindow;
|
||||
// Might actually go out of scope before the IEditor due
|
||||
// to deleting the WidgetHost which owns it.
|
||||
QPointer<QDesignerFormWindowInterface> m_formWindow;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user