QmlDesigner.designModeWidget: exposing DesignModeWidget

This allows calling cut copy and paste and component managment
from the outside.

Change-Id: Ie784b243f522409e9e778ef0700ac9c2f64e43cd
Reviewed-on: http://codereview.qt-project.org/4994
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
Thomas Hartmann
2011-09-19 17:57:37 +02:00
parent d39fb3d8ce
commit b14bd3a589
3 changed files with 22 additions and 2 deletions

View File

@@ -94,6 +94,8 @@ const char * const SB_OPENDOCUMENTS = "OpenDocuments";
namespace QmlDesigner {
namespace Internal {
DesignModeWidget *DesignModeWidget::s_instance = 0;
DocumentWarningWidget::DocumentWarningWidget(DesignModeWidget *parent) :
Utils::FakeToolTip(parent),
m_errorMessage(new QLabel("Placeholder", this)),
@@ -195,6 +197,7 @@ DesignModeWidget::DesignModeWidget(QWidget *parent) :
m_navigatorHistoryCounter(-1),
m_keepNavigatorHistory(false)
{
s_instance = this;
m_undoAction = new QAction(tr("&Undo"), this);
connect(m_undoAction, SIGNAL(triggered()), this, SLOT(undo()));
m_redoAction = new QAction(tr("&Redo"), this);
@@ -228,6 +231,7 @@ DesignModeWidget::DesignModeWidget(QWidget *parent) :
DesignModeWidget::~DesignModeWidget()
{
s_instance = 0;
}
void DesignModeWidget::restoreDefaultView()
@@ -857,6 +861,17 @@ void DesignModeWidget::onGoForwardClicked()
}
}
void DesignModeWidget::onCrumblePathElementClicked(const QVariant &data)
{
currentDesignDocumentController()->setCrumbleBarInfo(data.value<CrumbleBarInfo>());
}
DesignModeWidget *DesignModeWidget::instance()
{
return s_instance;
}
void DesignModeWidget::resizeEvent(QResizeEvent *event)
{
if (m_warningWidget)