Skip to content
Snippets Groups Projects
Commit caf8a451 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: adding new files

parent 72b9ad39
No related branches found
No related tags found
No related merge requests found
#include "propertyeditortransaction.h"
#include <QDebug>
namespace QmlDesigner {
PropertyEditorTransaction::PropertyEditorTransaction(QmlDesigner::PropertyEditor *propertyEditor) : QObject(propertyEditor), m_propertyEditor(propertyEditor)
{
}
void PropertyEditorTransaction::start()
{
if (m_rewriterTransaction.isValid())
m_rewriterTransaction.commit();
m_rewriterTransaction = m_propertyEditor->beginRewriterTransaction();
startTimer(4000);
}
void PropertyEditorTransaction::end()
{
if (m_rewriterTransaction.isValid())
m_rewriterTransaction.commit();
}
void PropertyEditorTransaction::timerEvent(QTimerEvent *timerEvent)
{
qDebug() << "timer";
killTimer(timerEvent->timerId());
if (m_rewriterTransaction.isValid())
m_rewriterTransaction.commit();
}
} //QmlDesigner
#ifndef PROPERTYEDITORTRANSACTION_H
#define PROPERTYEDITORTRANSACTION_H
#include "propertyeditor.h"
namespace QmlDesigner {
class PropertyEditorTransaction : public QObject
{
Q_OBJECT
public:
PropertyEditorTransaction(QmlDesigner::PropertyEditor *propertyEditor);
public slots:
void start();
void end();
protected:
void timerEvent(QTimerEvent *event);
private:
QmlDesigner::PropertyEditor *m_propertyEditor;
QmlDesigner::RewriterTransaction m_rewriterTransaction;
};
} //QmlDesigner
#endif // PROPERTYEDITORTRANSACTION_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment