forked from qt-creator/qt-creator
Core: Remove slot-by-name reference
Replace by lambda. Change-Id: I50a4a8b6db9790d06b3f60f5de7691b85f54995c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
e9296db573
commit
b2c74838e2
@@ -2983,12 +2983,14 @@ bool EditorManager::restoreState(const QByteArray &state)
|
||||
}
|
||||
|
||||
void EditorManager::showEditorStatusBar(const QString &id,
|
||||
const QString &infoText,
|
||||
const QString &buttonText,
|
||||
QObject *object, const char *member)
|
||||
const QString &infoText,
|
||||
const QString &buttonText,
|
||||
QObject *object,
|
||||
const std::function<void()> &function)
|
||||
{
|
||||
|
||||
EditorManagerPrivate::currentEditorView()->showEditorStatusBar(id, infoText, buttonText, object, member);
|
||||
EditorManagerPrivate::currentEditorView()->showEditorStatusBar(
|
||||
id, infoText, buttonText, object, function);
|
||||
}
|
||||
|
||||
void EditorManager::hideEditorStatusBar(const QString &id)
|
||||
|
@@ -152,9 +152,10 @@ public:
|
||||
static bool hasSplitter();
|
||||
|
||||
static void showEditorStatusBar(const QString &id,
|
||||
const QString &infoText,
|
||||
const QString &buttonText = QString(),
|
||||
QObject *object = 0, const char *member = 0);
|
||||
const QString &infoText,
|
||||
const QString &buttonText = QString(),
|
||||
QObject *object = nullptr,
|
||||
const std::function<void()> &function = nullptr);
|
||||
static void hideEditorStatusBar(const QString &id);
|
||||
|
||||
static EditorFactoryList editorFactories(const Utils::MimeType &mimeType, bool bestMatchOnly = true);
|
||||
|
@@ -218,15 +218,15 @@ void EditorView::closeCurrentEditor()
|
||||
void EditorView::showEditorStatusBar(const QString &id,
|
||||
const QString &infoText,
|
||||
const QString &buttonText,
|
||||
QObject *object, const char *member)
|
||||
QObject *object, const std::function<void()> &function)
|
||||
{
|
||||
m_statusWidgetId = id;
|
||||
m_statusWidgetLabel->setText(infoText);
|
||||
m_statusWidgetButton->setText(buttonText);
|
||||
m_statusWidgetButton->setToolTip(buttonText);
|
||||
m_statusWidgetButton->disconnect();
|
||||
if (object && member)
|
||||
connect(m_statusWidgetButton, SIGNAL(clicked()), object, member);
|
||||
if (object && function)
|
||||
connect(m_statusWidgetButton, &QToolButton::clicked, object, function);
|
||||
m_statusWidget->setVisible(true);
|
||||
m_statusHLine->setVisible(true);
|
||||
//m_editorForInfoWidget = currentEditor();
|
||||
|
@@ -38,6 +38,8 @@
|
||||
#include <QIcon>
|
||||
#include <QWidget>
|
||||
|
||||
#include <functional>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QAction;
|
||||
class QComboBox;
|
||||
@@ -95,7 +97,7 @@ public:
|
||||
void showEditorStatusBar(const QString &id,
|
||||
const QString &infoText,
|
||||
const QString &buttonText,
|
||||
QObject *object, const char *member);
|
||||
QObject *object, const std::function<void()> &function);
|
||||
void hideEditorStatusBar(const QString &id);
|
||||
void setCloseSplitEnabled(bool enable);
|
||||
void setCloseSplitIcon(const QIcon &icon);
|
||||
|
@@ -287,10 +287,9 @@ void MacroManager::startMacro()
|
||||
QString executeShortcut = Core::ActionManager::command(Constants::EXECUTE_LAST_MACRO)->keySequence().toString();
|
||||
QString help = tr("Macro mode. Type \"%1\" to stop recording and \"%2\" to play the macro.")
|
||||
.arg(endShortcut).arg(executeShortcut);
|
||||
Core::EditorManager::showEditorStatusBar(
|
||||
QLatin1String(Constants::M_STATUS_BUFFER),
|
||||
help,
|
||||
tr("Stop Recording Macro"), this, SLOT(endMacro()));
|
||||
Core::EditorManager::showEditorStatusBar(Constants::M_STATUS_BUFFER, help,
|
||||
tr("Stop Recording Macro"),
|
||||
this, [this] { endMacro(); });
|
||||
}
|
||||
|
||||
void MacroManager::endMacro()
|
||||
|
@@ -56,8 +56,6 @@ public:
|
||||
void executeLastMacro();
|
||||
void saveLastMacro();
|
||||
bool executeMacro(const QString &name);
|
||||
|
||||
public slots:
|
||||
void endMacro();
|
||||
|
||||
protected:
|
||||
|
Reference in New Issue
Block a user