forked from qt-creator/qt-creator
Add "Select All" menu item to the design mode
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user