Add "Select All" menu item to the design mode

This commit is contained in:
Marco Bubke
2010-01-25 15:22:08 +01:00
parent b4c6ecee58
commit 666b454295
5 changed files with 36 additions and 0 deletions

View File

@@ -497,6 +497,8 @@ DesignModeWidget::DesignModeWidget(DesignMode *designMode, QWidget *parent) :
connect(m_copyAction, SIGNAL(triggered()), this, SLOT(copySelected()));
m_pasteAction = new Utils::ParameterAction(tr("&Paste"), tr("Paste \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
connect(m_pasteAction, SIGNAL(triggered()), this, SLOT(paste()));
m_selectAllAction = new Utils::ParameterAction(tr("Select &All"), tr("Select All \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
connect(m_selectAllAction, SIGNAL(triggered()), this, SLOT(selectAll()));
QLabel *defaultBackground = new QLabel(tr("Open/Create a qml file first."));
defaultBackground->setAlignment(Qt::AlignCenter);
@@ -598,6 +600,11 @@ QAction *DesignModeWidget::pasteAction() const
return m_pasteAction;
}
QAction *DesignModeWidget::selectAllAction() const
{
return m_selectAllAction;
}
DesignMode *DesignModeWidget::designMode() const
{
return m_designMode;
@@ -639,6 +646,12 @@ void DesignModeWidget::paste()
m_currentDocumentWidget->document()->paste();
}
void DesignModeWidget::selectAll()
{
if (m_currentDocumentWidget)
m_currentDocumentWidget->document()->selectAll();
}
void DesignModeWidget::undoAvailable(bool isAvailable)
{
DesignDocumentController *documentController = qobject_cast<DesignDocumentController*>(sender());