mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-20 09:22:15 -07:00
Fix lambdas
This commit is contained in:
parent
bdf75d1621
commit
6a54116095
5 changed files with 12 additions and 12 deletions
|
|
@ -1535,6 +1535,6 @@ void TabDeckEditor::showSearchSyntaxHelp()
|
||||||
browser->document()->setDefaultStyleSheet(sheet);
|
browser->document()->setDefaultStyleSheet(sheet);
|
||||||
|
|
||||||
browser->setHtml(text);
|
browser->setHtml(text);
|
||||||
connect(browser, &QTextBrowser::anchorClicked, [=](const QUrl &link) { searchEdit->setText(link.fragment()); });
|
connect(browser, &QTextBrowser::anchorClicked, [this](const QUrl &link) { searchEdit->setText(link.fragment()); });
|
||||||
browser->show();
|
browser->show();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1742,22 +1742,22 @@ void TabGame::createReplayDock()
|
||||||
aReplaySkipForward = new QAction(timelineWidget);
|
aReplaySkipForward = new QAction(timelineWidget);
|
||||||
timelineWidget->addAction(aReplaySkipForward);
|
timelineWidget->addAction(aReplaySkipForward);
|
||||||
connect(aReplaySkipForward, &QAction::triggered, this,
|
connect(aReplaySkipForward, &QAction::triggered, this,
|
||||||
[=]() { timelineWidget->skipByAmount(ReplayTimelineWidget::SMALL_SKIP_MS); });
|
[this] { timelineWidget->skipByAmount(ReplayTimelineWidget::SMALL_SKIP_MS); });
|
||||||
|
|
||||||
aReplaySkipBackward = new QAction(timelineWidget);
|
aReplaySkipBackward = new QAction(timelineWidget);
|
||||||
timelineWidget->addAction(aReplaySkipBackward);
|
timelineWidget->addAction(aReplaySkipBackward);
|
||||||
connect(aReplaySkipBackward, &QAction::triggered, this,
|
connect(aReplaySkipBackward, &QAction::triggered, this,
|
||||||
[=]() { timelineWidget->skipByAmount(-ReplayTimelineWidget::SMALL_SKIP_MS); });
|
[this] { timelineWidget->skipByAmount(-ReplayTimelineWidget::SMALL_SKIP_MS); });
|
||||||
|
|
||||||
aReplaySkipForwardBig = new QAction(timelineWidget);
|
aReplaySkipForwardBig = new QAction(timelineWidget);
|
||||||
timelineWidget->addAction(aReplaySkipForwardBig);
|
timelineWidget->addAction(aReplaySkipForwardBig);
|
||||||
connect(aReplaySkipForwardBig, &QAction::triggered, this,
|
connect(aReplaySkipForwardBig, &QAction::triggered, this,
|
||||||
[=]() { timelineWidget->skipByAmount(ReplayTimelineWidget::BIG_SKIP_MS); });
|
[this] { timelineWidget->skipByAmount(ReplayTimelineWidget::BIG_SKIP_MS); });
|
||||||
|
|
||||||
aReplaySkipBackwardBig = new QAction(timelineWidget);
|
aReplaySkipBackwardBig = new QAction(timelineWidget);
|
||||||
timelineWidget->addAction(aReplaySkipBackwardBig);
|
timelineWidget->addAction(aReplaySkipBackwardBig);
|
||||||
connect(aReplaySkipBackwardBig, &QAction::triggered, this,
|
connect(aReplaySkipBackwardBig, &QAction::triggered, this,
|
||||||
[=]() { timelineWidget->skipByAmount(-ReplayTimelineWidget::BIG_SKIP_MS); });
|
[this] { timelineWidget->skipByAmount(-ReplayTimelineWidget::BIG_SKIP_MS); });
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
replayPlayButton = new QToolButton;
|
replayPlayButton = new QToolButton;
|
||||||
|
|
|
||||||
|
|
@ -7,23 +7,23 @@
|
||||||
class TearOffMenu : public QMenu
|
class TearOffMenu : public QMenu
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TearOffMenu(const QString &title, QWidget *parent = nullptr) : QMenu(title, parent)
|
explicit TearOffMenu(const QString &title, QWidget *parent = nullptr) : QMenu(title, parent)
|
||||||
{
|
{
|
||||||
connect(&SettingsCache::instance(), &SettingsCache::useTearOffMenusChanged, this,
|
connect(&SettingsCache::instance(), &SettingsCache::useTearOffMenusChanged, this,
|
||||||
[=](bool state) { setTearOffEnabled(state); });
|
[this](const bool state) { setTearOffEnabled(state); });
|
||||||
setTearOffEnabled(SettingsCache::instance().getUseTearOffMenus());
|
setTearOffEnabled(SettingsCache::instance().getUseTearOffMenus());
|
||||||
}
|
}
|
||||||
|
|
||||||
TearOffMenu(QWidget *parent = nullptr) : QMenu(parent)
|
explicit TearOffMenu(QWidget *parent = nullptr) : QMenu(parent)
|
||||||
{
|
{
|
||||||
connect(&SettingsCache::instance(), &SettingsCache::useTearOffMenusChanged, this,
|
connect(&SettingsCache::instance(), &SettingsCache::useTearOffMenusChanged, this,
|
||||||
[=](bool state) { setTearOffEnabled(state); });
|
[this](const bool state) { setTearOffEnabled(state); });
|
||||||
setTearOffEnabled(SettingsCache::instance().getUseTearOffMenus());
|
setTearOffEnabled(SettingsCache::instance().getUseTearOffMenus());
|
||||||
}
|
}
|
||||||
|
|
||||||
TearOffMenu *addTearOffMenu(const QString &title)
|
TearOffMenu *addTearOffMenu(const QString &title)
|
||||||
{
|
{
|
||||||
TearOffMenu *menu = new TearOffMenu(title, this);
|
auto *menu = new TearOffMenu(title, this);
|
||||||
addMenu(menu);
|
addMenu(menu);
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ ZoneViewWidget::ZoneViewWidget(Player *_player,
|
||||||
// QLabel sizes aren't taken into account until the widget is rendered.
|
// QLabel sizes aren't taken into account until the widget is rendered.
|
||||||
// Force refresh after 1ms to fix glitchy rendering with long QLabels.
|
// Force refresh after 1ms to fix glitchy rendering with long QLabels.
|
||||||
auto *lastResizeBeforeVisibleTimer = new QTimer(this);
|
auto *lastResizeBeforeVisibleTimer = new QTimer(this);
|
||||||
connect(lastResizeBeforeVisibleTimer, &QTimer::timeout, this, [=] {
|
connect(lastResizeBeforeVisibleTimer, &QTimer::timeout, this, [=, this] {
|
||||||
resizeToZoneContents();
|
resizeToZoneContents();
|
||||||
disconnect(lastResizeBeforeVisibleTimer);
|
disconnect(lastResizeBeforeVisibleTimer);
|
||||||
lastResizeBeforeVisibleTimer->deleteLater();
|
lastResizeBeforeVisibleTimer->deleteLater();
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ void UserInfoBox::actPassword()
|
||||||
connect(pend,
|
connect(pend,
|
||||||
// we need qoverload here in order to select the right version of this function
|
// we need qoverload here in order to select the right version of this function
|
||||||
QOverload<const Response &, const CommandContainer &, const QVariant &>::of(&PendingCommand::finished),
|
QOverload<const Response &, const CommandContainer &, const QVariant &>::of(&PendingCommand::finished),
|
||||||
this, [=](const Response &response, const CommandContainer &, const QVariant &) {
|
this, [=, this](const Response &response, const CommandContainer &, const QVariant &) {
|
||||||
if (response.response_code() == Response::RespOk) {
|
if (response.response_code() == Response::RespOk) {
|
||||||
changePassword(oldPassword, newPassword);
|
changePassword(oldPassword, newPassword);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue