Commit 54eabfb0 authored by Montel Laurent's avatar Montel Laurent Committed by Laurent Montel
Browse files

Port to new connect api



Change-Id: If9948ced45095546f37f9f397b65f922dc925b6a
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 451a03a4
......@@ -158,7 +158,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
if (style != ModeWidget) {
m_switchToHelp = new QAction(tr("Go to Help Mode"), toolBar);
cmd = Core::ActionManager::registerAction(m_switchToHelp, Constants::CONTEXT_HELP, context);
connect(m_switchToHelp, SIGNAL(triggered()), this, SLOT(helpModeButtonClicked()));
connect(m_switchToHelp, &QAction::triggered, this, &HelpWidget::helpModeButtonClicked);
layout->addWidget(Core::Command::toolButtonWithAppendedShortcut(m_switchToHelp, cmd));
}
......@@ -172,7 +172,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
tr("Back"), toolBar);
connect(m_backAction, &QAction::triggered, this, &HelpWidget::backward);
m_backMenu = new QMenu(toolBar);
connect(m_backMenu, SIGNAL(aboutToShow()), this, SLOT(updateBackMenu()));
connect(m_backMenu, &QMenu::aboutToShow, this, &HelpWidget::updateBackMenu);
m_backAction->setMenu(m_backMenu);
cmd = Core::ActionManager::registerAction(m_backAction, Constants::HELP_PREVIOUS, context);
cmd->setDefaultKeySequence(QKeySequence::Back);
......@@ -184,7 +184,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
tr("Forward"), toolBar);
connect(m_forwardAction, &QAction::triggered, this, &HelpWidget::forward);
m_forwardMenu = new QMenu(toolBar);
connect(m_forwardMenu, SIGNAL(aboutToShow()), this, SLOT(updateForwardMenu()));
connect(m_forwardMenu, &QMenu::aboutToShow, this, &HelpWidget::updateForwardMenu);
m_forwardAction->setMenu(m_forwardMenu);
cmd = Core::ActionManager::registerAction(m_forwardAction, Constants::HELP_NEXT, context);
cmd->setDefaultKeySequence(QKeySequence::Forward);
......@@ -458,7 +458,7 @@ void HelpWidget::addViewer(HelpViewer *viewer)
print(viewer);
});
if (m_style == ExternalWindow)
connect(viewer, SIGNAL(titleChanged()), this, SLOT(updateWindowTitle()));
connect(viewer, &HelpViewer::titleChanged, this, &HelpWidget::updateWindowTitle);
connect(viewer, &HelpViewer::loadFinished, this, &HelpWidget::highlightSearchTerms);
......
......@@ -181,7 +181,7 @@ void TextBrowserHelpViewer::addBackHistoryItems(QMenu *backMenu)
QAction *action = new QAction(backMenu);
action->setText(m_textBrowser->historyTitle(-i));
action->setData(-i);
connect(action, SIGNAL(triggered()), this, SLOT(goToHistoryItem()));
connect(action, &QAction::triggered, this, &TextBrowserHelpViewer::goToHistoryItem);
backMenu->addAction(action);
}
}
......@@ -192,7 +192,7 @@ void TextBrowserHelpViewer::addForwardHistoryItems(QMenu *forwardMenu)
QAction *action = new QAction(forwardMenu);
action->setText(m_textBrowser->historyTitle(i));
action->setData(i);
connect(action, SIGNAL(triggered()), this, SLOT(goToHistoryItem()));
connect(action, &QAction::triggered, this, &TextBrowserHelpViewer::goToHistoryItem);
forwardMenu->addAction(action);
}
}
......
......@@ -126,18 +126,18 @@ void ImageViewer::ctor()
d->ui_toolbar.toolButtonPlayPause->setCommandId(Constants::ACTION_TOGGLE_ANIMATION);
// connections
connect(d->ui_toolbar.toolButtonZoomIn, SIGNAL(clicked()),
d->imageView, SLOT(zoomIn()));
connect(d->ui_toolbar.toolButtonZoomOut, SIGNAL(clicked()),
d->imageView, SLOT(zoomOut()));
connect(d->ui_toolbar.toolButtonFitToScreen, SIGNAL(clicked()),
d->imageView, SLOT(fitToScreen()));
connect(d->ui_toolbar.toolButtonOriginalSize, SIGNAL(clicked()),
d->imageView, SLOT(resetToOriginalSize()));
connect(d->ui_toolbar.toolButtonBackground, SIGNAL(toggled(bool)),
d->imageView, SLOT(setViewBackground(bool)));
connect(d->ui_toolbar.toolButtonOutline, SIGNAL(toggled(bool)),
d->imageView, SLOT(setViewOutline(bool)));
connect(d->ui_toolbar.toolButtonZoomIn, &QAbstractButton::clicked,
d->imageView, &ImageView::zoomIn);
connect(d->ui_toolbar.toolButtonZoomOut, &QAbstractButton::clicked,
d->imageView, &ImageView::zoomOut);
connect(d->ui_toolbar.toolButtonFitToScreen, &QAbstractButton::clicked,
d->imageView, &ImageView::fitToScreen);
connect(d->ui_toolbar.toolButtonOriginalSize, &QAbstractButton::clicked,
d->imageView, &ImageView::resetToOriginalSize);
connect(d->ui_toolbar.toolButtonBackground, &QAbstractButton::toggled,
d->imageView, &ImageView::setViewBackground);
connect(d->ui_toolbar.toolButtonOutline, &QAbstractButton::toggled,
d->imageView, &ImageView::setViewOutline);
connect(d->ui_toolbar.toolButtonPlayPause, &Core::CommandButton::clicked,
this, &ImageViewer::playToggled);
connect(d->file.data(), &ImageViewerFile::imageSizeChanged,
......@@ -150,8 +150,8 @@ void ImageViewer::ctor()
d->imageView, &ImageView::createScene);
connect(d->file.data(), &ImageViewerFile::isPausedChanged,
this, &ImageViewer::updatePauseAction);
connect(d->imageView, SIGNAL(scaleFactorChanged(qreal)),
this, SLOT(scaleFactorUpdate(qreal)));
connect(d->imageView, &ImageView::scaleFactorChanged,
this, &ImageViewer::scaleFactorUpdate);
}
ImageViewer::~ImageViewer()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment