Commit dd8f2dda authored by Montel Laurent's avatar Montel Laurent Committed by hjk

Port to new connect api

Change-Id: I31078e08f46892e94597f48fd27057a16039eb5a
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 835f1fbc
......@@ -67,31 +67,50 @@ ContextPaneTextWidget::ContextPaneTextWidget(QWidget *parent) :
ui->colorButton->setShowArrow(false);
ui->textColorButton->setShowArrow(false);
connect(ui->colorButton, SIGNAL(toggled(bool)), this, SLOT(onColorButtonToggled(bool)));
connect(ui->textColorButton, SIGNAL(toggled(bool)), this, SLOT(onTextColorButtonToggled(bool)));
connect(ui->colorButton, &QmlEditorWidgets::ColorButton::toggled,
this, &ContextPaneTextWidget::onColorButtonToggled);
connect(ui->textColorButton, &QmlEditorWidgets::ColorButton::toggled,
this, &ContextPaneTextWidget::onTextColorButtonToggled);
ContextPaneWidget *parentContextWidget = qobject_cast<ContextPaneWidget*>(parentWidget());
connect(parentContextWidget->colorDialog(), SIGNAL(accepted(QColor)), this, SLOT(onColorDialogApplied(QColor)));
connect(parentContextWidget->colorDialog(), SIGNAL(rejected()), this, SLOT(onColorDialogCancled()));
connect(ui->fontSizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(onFontSizeChanged(int)));
connect(ui->fontSizeSpinBox, SIGNAL(formatChanged()), this, SLOT(onFontFormatChanged()));
connect(ui->boldButton, SIGNAL(toggled(bool)), this, SLOT(onBoldCheckedChanged(bool)));
connect(ui->italicButton, SIGNAL(toggled(bool)), this, SLOT(onItalicCheckedChanged(bool)));
connect(ui->underlineButton, SIGNAL(toggled(bool)), this, SLOT(onUnderlineCheckedChanged(bool)));
connect(ui->strikeoutButton, SIGNAL(toggled(bool)), this, SLOT(onStrikeoutCheckedChanged(bool)));
connect(ui->fontComboBox, SIGNAL(currentFontChanged(QFont)), this, SLOT(onCurrentFontChanged(QFont)));
connect(ui->centerHAlignmentButton, SIGNAL(toggled(bool)), this, SLOT(onHorizontalAlignmentChanged()));
connect(ui->leftAlignmentButton, SIGNAL(toggled(bool)), this, SLOT(onHorizontalAlignmentChanged()));
connect(ui->rightAlignmentButton, SIGNAL(toggled(bool)), this, SLOT(onHorizontalAlignmentChanged()));
connect(ui->centerVAlignmentButton, SIGNAL(toggled(bool)), this, SLOT(onVerticalAlignmentChanged()));
connect(ui->topAlignmentButton, SIGNAL(toggled(bool)), this, SLOT(onVerticalAlignmentChanged()));
connect(ui->bottomAlignmentButton, SIGNAL(toggled(bool)), this, SLOT(onVerticalAlignmentChanged()));
connect(ui->styleComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(onStyleComboBoxChanged(QString)));
connect(parentContextWidget->colorDialog(), &CustomColorDialog::accepted,
this, &ContextPaneTextWidget::onColorDialogApplied);
connect(parentContextWidget->colorDialog(), &CustomColorDialog::rejected,
this, &ContextPaneTextWidget::onColorDialogCancled);
connect(ui->fontSizeSpinBox,
static_cast<void (QmlEditorWidgets::FontSizeSpinBox::*)(int)>(&QmlEditorWidgets::FontSizeSpinBox::valueChanged),
this, &ContextPaneTextWidget::onFontSizeChanged);
connect(ui->fontSizeSpinBox, &QmlEditorWidgets::FontSizeSpinBox::formatChanged,
this, &ContextPaneTextWidget::onFontFormatChanged);
connect(ui->boldButton, &QToolButton::toggled,
this, &ContextPaneTextWidget::onBoldCheckedChanged);
connect(ui->italicButton, &QToolButton::toggled,
this, &ContextPaneTextWidget::onItalicCheckedChanged);
connect(ui->underlineButton, &QToolButton::toggled,
this, &ContextPaneTextWidget::onUnderlineCheckedChanged);
connect(ui->strikeoutButton, &QToolButton::toggled,
this, &ContextPaneTextWidget::onStrikeoutCheckedChanged);
connect(ui->fontComboBox, &QFontComboBox::currentFontChanged,
this, &ContextPaneTextWidget::onCurrentFontChanged);
connect(ui->centerHAlignmentButton, &QToolButton::toggled,
this, &ContextPaneTextWidget::onHorizontalAlignmentChanged);
connect(ui->leftAlignmentButton, &QToolButton::toggled,
this, &ContextPaneTextWidget::onHorizontalAlignmentChanged);
connect(ui->rightAlignmentButton, &QToolButton::toggled,
this, &ContextPaneTextWidget::onHorizontalAlignmentChanged);
connect(ui->centerVAlignmentButton, &QToolButton::toggled,
this, &ContextPaneTextWidget::onVerticalAlignmentChanged);
connect(ui->topAlignmentButton, &QToolButton::toggled,
this, &ContextPaneTextWidget::onVerticalAlignmentChanged);
connect(ui->bottomAlignmentButton, &QToolButton::toggled,
this, &ContextPaneTextWidget::onVerticalAlignmentChanged);
connect(ui->styleComboBox, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &ContextPaneTextWidget::onStyleComboBoxChanged);
}
static inline bool checkIfBoolean(const QVariant &v)
......
......@@ -183,7 +183,7 @@ ContextPaneWidget::ContextPaneWidget(QWidget *parent) : DragWidget(parent), m_cu
m_toolButton->setFixedSize(16, 16);
m_toolButton->setToolTip(tr("Hides this toolbar."));
connect(m_toolButton, SIGNAL(clicked()), this, SLOT(onTogglePane()));
connect(m_toolButton, &QToolButton::clicked, this, &ContextPaneWidget::onTogglePane);
layout->addWidget(m_toolButton, 0, 0, 1, 1);
colorDialog();
......@@ -431,9 +431,12 @@ void ContextPaneWidget::protectedMoved()
QWidget* ContextPaneWidget::createFontWidget()
{
m_textWidget = new ContextPaneTextWidget(this);
connect(m_textWidget, SIGNAL(propertyChanged(QString,QVariant)), this, SIGNAL(propertyChanged(QString,QVariant)));
connect(m_textWidget, SIGNAL(removeProperty(QString)), this, SIGNAL(removeProperty(QString)));
connect(m_textWidget, SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)), this, SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)));
connect(m_textWidget, &ContextPaneTextWidget::propertyChanged,
this, &ContextPaneWidget::propertyChanged);
connect(m_textWidget, &ContextPaneTextWidget::removeProperty,
this, &ContextPaneWidget::removeProperty);
connect(m_textWidget, &ContextPaneTextWidget::removeAndChangeProperty,
this, &ContextPaneWidget::removeAndChangeProperty);
return m_textWidget;
}
......@@ -442,9 +445,12 @@ QWidget* ContextPaneWidget::createEasingWidget()
{
m_easingWidget = new EasingContextPane(this);
connect(m_easingWidget, SIGNAL(propertyChanged(QString,QVariant)), this, SIGNAL(propertyChanged(QString,QVariant)));
connect(m_easingWidget, SIGNAL(removeProperty(QString)), this, SIGNAL(removeProperty(QString)));
connect(m_easingWidget, SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)), this, SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)));
connect(m_easingWidget, &EasingContextPane::propertyChanged,
this, &ContextPaneWidget::propertyChanged);
connect(m_easingWidget, &EasingContextPane::removeProperty,
this, &ContextPaneWidget::removeProperty);
connect(m_easingWidget, &EasingContextPane::removeAndChangeProperty,
this, &ContextPaneWidget::removeAndChangeProperty);
return m_easingWidget;
}
......@@ -452,9 +458,12 @@ QWidget* ContextPaneWidget::createEasingWidget()
QWidget *ContextPaneWidget::createImageWidget()
{
m_imageWidget = new ContextPaneWidgetImage(this);
connect(m_imageWidget, SIGNAL(propertyChanged(QString,QVariant)), this, SIGNAL(propertyChanged(QString,QVariant)));
connect(m_imageWidget, SIGNAL(removeProperty(QString)), this, SIGNAL(removeProperty(QString)));
connect(m_imageWidget, SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)), this, SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)));
connect(m_imageWidget, &ContextPaneWidgetImage::propertyChanged,
this, &ContextPaneWidget::propertyChanged);
connect(m_imageWidget, &ContextPaneWidgetImage::removeProperty,
this, &ContextPaneWidget::removeProperty);
connect(m_imageWidget, &ContextPaneWidgetImage::removeAndChangeProperty,
this, &ContextPaneWidget::removeAndChangeProperty);
return m_imageWidget;
}
......@@ -462,9 +471,12 @@ QWidget *ContextPaneWidget::createImageWidget()
QWidget *ContextPaneWidget::createBorderImageWidget()
{
m_borderImageWidget = new ContextPaneWidgetImage(this, true);
connect(m_borderImageWidget, SIGNAL(propertyChanged(QString,QVariant)), this, SIGNAL(propertyChanged(QString,QVariant)));
connect(m_borderImageWidget, SIGNAL(removeProperty(QString)), this, SIGNAL(removeProperty(QString)));
connect(m_borderImageWidget, SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)), this, SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)));
connect(m_borderImageWidget, &ContextPaneWidgetImage::propertyChanged,
this, &ContextPaneWidget::propertyChanged);
connect(m_borderImageWidget, &ContextPaneWidgetImage::removeProperty,
this, &ContextPaneWidget::removeProperty);
connect(m_borderImageWidget, &ContextPaneWidgetImage::removeAndChangeProperty,
this, &ContextPaneWidget::removeAndChangeProperty);
return m_borderImageWidget;
......@@ -473,9 +485,12 @@ QWidget *ContextPaneWidget::createBorderImageWidget()
QWidget *ContextPaneWidget::createRectangleWidget()
{
m_rectangleWidget = new ContextPaneWidgetRectangle(this);
connect(m_rectangleWidget, SIGNAL(propertyChanged(QString,QVariant)), this, SIGNAL(propertyChanged(QString,QVariant)));
connect(m_rectangleWidget, SIGNAL(removeProperty(QString)), this, SIGNAL(removeProperty(QString)));
connect(m_rectangleWidget, SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)), this, SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)));
connect(m_rectangleWidget, &ContextPaneWidgetRectangle::propertyChanged,
this, &ContextPaneWidget::propertyChanged);
connect(m_rectangleWidget, &ContextPaneWidgetRectangle::removeProperty,
this, &ContextPaneWidget::removeProperty);
connect(m_rectangleWidget, &ContextPaneWidgetRectangle::removeAndChangeProperty,
this, &ContextPaneWidget::removeAndChangeProperty);
return m_rectangleWidget;
}
......
......@@ -89,18 +89,28 @@ ContextPaneWidgetImage::ContextPaneWidgetImage(QWidget *parent, bool borderImage
uiBorderImage->label->installEventFilter(labelFilter);
connect(uiBorderImage->verticalTileRadioButton, SIGNAL(toggled(bool)), this, SLOT(onVerticalStretchChanged()));
connect(uiBorderImage->verticalStretchRadioButton, SIGNAL(toggled(bool)), this, SLOT(onVerticalStretchChanged()));
connect(uiBorderImage->verticalTileRadioButtonNoCrop, SIGNAL(toggled(bool)), this, SLOT(onVerticalStretchChanged()));
connect(uiBorderImage->horizontalTileRadioButton, SIGNAL(toggled(bool)), this, SLOT(onHorizontalStretchChanged()));
connect(uiBorderImage->horizontalStretchRadioButton, SIGNAL(toggled(bool)), this, SLOT(onHorizontalStretchChanged()));
connect(uiBorderImage->horizontalTileRadioButtonNoCrop, SIGNAL(toggled(bool)), this, SLOT(onHorizontalStretchChanged()));
connect(uiBorderImage->verticalTileRadioButton, &QRadioButton::toggled,
this, &ContextPaneWidgetImage::onVerticalStretchChanged);
connect(uiBorderImage->verticalStretchRadioButton, &QRadioButton::toggled,
this, &ContextPaneWidgetImage::onVerticalStretchChanged);
connect(uiBorderImage->verticalTileRadioButtonNoCrop, &QRadioButton::toggled,
this, &ContextPaneWidgetImage::onVerticalStretchChanged);
connect(uiBorderImage->horizontalTileRadioButton, &QRadioButton::toggled,
this, &ContextPaneWidgetImage::onHorizontalStretchChanged);
connect(uiBorderImage->horizontalStretchRadioButton, &QRadioButton::toggled,
this, &ContextPaneWidgetImage::onHorizontalStretchChanged);
connect(uiBorderImage->horizontalTileRadioButtonNoCrop, &QRadioButton::toggled,
this, &ContextPaneWidgetImage::onHorizontalStretchChanged);
PreviewLabel *previewLabel = previewDialog()->previewLabel();
connect(previewLabel, SIGNAL(leftMarginChanged()), this, SLOT(onLeftMarginsChanged()));
connect(previewLabel, SIGNAL(rightMarginChanged()), this, SLOT(onRightMarginsChanged()));
connect(previewLabel, SIGNAL(topMarginChanged()), this, SLOT(onTopMarginsChanged()));
connect(previewLabel, SIGNAL(bottomMarginChanged()), this, SLOT(onBottomMarginsChanged()));
connect(previewLabel, &PreviewLabel::leftMarginChanged,
this, &ContextPaneWidgetImage::onLeftMarginsChanged);
connect(previewLabel, &PreviewLabel::rightMarginChanged,
this, &ContextPaneWidgetImage::onRightMarginsChanged);
connect(previewLabel, &PreviewLabel::topMarginChanged,
this, &ContextPaneWidgetImage::onTopMarginsChanged);
connect(previewLabel, &PreviewLabel::bottomMarginChanged,
this, &ContextPaneWidgetImage::onBottomMarginsChanged);
} else {
ui = new Ui::ContextPaneWidgetImage;
......@@ -110,19 +120,27 @@ ContextPaneWidgetImage::ContextPaneWidgetImage(QWidget *parent, bool borderImage
m_fileWidget = ui->fileWidget;
m_sizeLabel = ui->sizeLabel;
connect(ui->stretchRadioButton, SIGNAL(toggled(bool)), this, SLOT(onStretchChanged()));
connect(ui->tileRadioButton, SIGNAL(toggled(bool)), this, SLOT(onStretchChanged()));
connect(ui->horizontalStretchRadioButton, SIGNAL(toggled(bool)), this, SLOT(onStretchChanged()));
connect(ui->verticalStretchRadioButton, SIGNAL(toggled(bool)), this, SLOT(onStretchChanged()));
connect(ui->preserveAspectFitRadioButton, SIGNAL(toggled(bool)), this, SLOT(onStretchChanged()));
connect(ui->cropAspectFitRadioButton, SIGNAL(toggled(bool)), this, SLOT(onStretchChanged()));
connect(ui->stretchRadioButton, &QRadioButton::toggled,
this, &ContextPaneWidgetImage::onStretchChanged);
connect(ui->tileRadioButton, &QRadioButton::toggled,
this, &ContextPaneWidgetImage::onStretchChanged);
connect(ui->horizontalStretchRadioButton, &QRadioButton::toggled,
this, &ContextPaneWidgetImage::onStretchChanged);
connect(ui->verticalStretchRadioButton, &QRadioButton::toggled,
this, &ContextPaneWidgetImage::onStretchChanged);
connect(ui->preserveAspectFitRadioButton, &QRadioButton::toggled,
this, &ContextPaneWidgetImage::onStretchChanged);
connect(ui->cropAspectFitRadioButton, &QRadioButton::toggled,
this, &ContextPaneWidgetImage::onStretchChanged);
}
previewDialog();
m_fileWidget->setShowComboBox(true);
m_fileWidget->setFilter(QLatin1String("*.png *.gif *.jpg"));
connect(m_fileWidget, SIGNAL(fileNameChanged(QUrl)), this, SLOT(onFileNameChanged()));
connect(labelFilter, SIGNAL(doubleClicked()), this, SLOT(onPixmapDoubleClicked()));
connect(m_fileWidget, &FileWidget::fileNameChanged,
this, &ContextPaneWidgetImage::onFileNameChanged);
connect(labelFilter, &LabelFilter::doubleClicked,
this, &ContextPaneWidgetImage::onPixmapDoubleClicked);
}
......@@ -881,7 +899,7 @@ PreviewDialog::PreviewDialog(QWidget *parent) : DragWidget(parent)
toolButton->setIcon(icon);
toolButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
toolButton->setFixedSize(icon.availableSizes().value(0) + QSize(4, 4));
connect(toolButton, SIGNAL(clicked()), this, SLOT(onTogglePane()));
connect(toolButton, &QToolButton::clicked, this, &PreviewDialog::onTogglePane);
QScrollArea *scrollArea = new QScrollArea(this);
WheelFilter *wheelFilter = new WheelFilter(scrollArea);
......@@ -906,7 +924,7 @@ PreviewDialog::PreviewDialog(QWidget *parent) : DragWidget(parent)
wheelFilter->setTarget(this);
connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(onSliderMoved(int)));
connect(m_slider, &QSlider::valueChanged, this, &PreviewDialog::onSliderMoved);
foreach (QWidget *childWidget, findChildren<QWidget*>()) {
childWidget->installEventFilter(wheelFilter);
......
......@@ -50,23 +50,33 @@ ContextPaneWidgetRectangle::ContextPaneWidgetRectangle(QWidget *parent) :
ui->colorColorButton->setShowArrow(false);
ui->borderColorButton->setShowArrow(false);
connect(ui->colorColorButton, SIGNAL(toggled(bool)), this, SLOT(onColorButtonToggled(bool)));
connect(ui->borderColorButton, SIGNAL(toggled(bool)), this, SLOT(onBorderColorButtonToggled(bool)));
connect(ui->colorColorButton, &QmlEditorWidgets::ColorButton::toggled,
this, &ContextPaneWidgetRectangle::onColorButtonToggled);
connect(ui->borderColorButton, &QmlEditorWidgets::ColorButton::toggled,
this, &ContextPaneWidgetRectangle::onBorderColorButtonToggled);
connect(ui->colorSolid, SIGNAL(clicked()), this, SLOT(onColorSolidClicked()));
connect(ui->borderSolid, SIGNAL(clicked()), this, SLOT(onBorderSolidClicked()));
connect(ui->colorSolid, &QToolButton::clicked,
this, &ContextPaneWidgetRectangle::onColorSolidClicked);
connect(ui->borderSolid, &QToolButton::clicked,
this, &ContextPaneWidgetRectangle::onBorderSolidClicked);
connect(ui->colorNone, SIGNAL(clicked()), this, SLOT(onColorNoneClicked()));
connect(ui->borderNone, SIGNAL(clicked()), this, SLOT(onBorderNoneClicked()));
connect(ui->colorNone, &QToolButton::clicked,
this, &ContextPaneWidgetRectangle::onColorNoneClicked);
connect(ui->borderNone, &QToolButton::clicked,
this, &ContextPaneWidgetRectangle::onBorderNoneClicked);
connect(ui->colorGradient, SIGNAL(clicked()), this, SLOT(onGradientClicked()));
connect(ui->colorGradient, &QToolButton::clicked, this, &ContextPaneWidgetRectangle::onGradientClicked);
ContextPaneWidget *parentContextWidget = qobject_cast<ContextPaneWidget*>(parentWidget());
connect(parentContextWidget->colorDialog(), SIGNAL(accepted(QColor)), this, SLOT(onColorDialogApplied(QColor)));
connect(parentContextWidget->colorDialog(), SIGNAL(rejected()), this, SLOT(onColorDialogCancled()));
connect(ui->gradientLine, SIGNAL(openColorDialog(QPoint)), this, SLOT(onGradientLineDoubleClicked(QPoint)));
connect(ui->gradientLine, SIGNAL(gradientChanged()), this, SLOT(onUpdateGradient()));
connect(parentContextWidget->colorDialog(), &CustomColorDialog::accepted,
this, &ContextPaneWidgetRectangle::onColorDialogApplied);
connect(parentContextWidget->colorDialog(), &CustomColorDialog::rejected,
this, &ContextPaneWidgetRectangle::onColorDialogCancled);
connect(ui->gradientLine, &QmlEditorWidgets::GradientLine::openColorDialog,
this, &ContextPaneWidgetRectangle::onGradientLineDoubleClicked);
connect(ui->gradientLine, &QmlEditorWidgets::GradientLine::gradientChanged,
this, &ContextPaneWidgetRectangle::onUpdateGradient);
}
ContextPaneWidgetRectangle::~ContextPaneWidgetRectangle()
......
......@@ -121,15 +121,23 @@ CustomColorDialog::CustomColorDialog(QWidget *parent) : QFrame(parent )
resize(sizeHint());
connect(m_colorBox, SIGNAL(colorChanged()), this, SLOT(onColorBoxChanged()));
connect(m_alphaSpinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBoxChanged()));
connect(m_rSpinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBoxChanged()));
connect(m_gSpinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBoxChanged()));
connect(m_bSpinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBoxChanged()));
connect(m_hueControl, SIGNAL(hueChanged(int)), this, SLOT(onHueChanged(int)));
connect(applyButton, SIGNAL(pressed()), this, SLOT(onAccept()));
connect(cancelButton, SIGNAL(pressed()), this, SIGNAL(rejected()));
connect(m_colorBox, &ColorBox::colorChanged, this, &CustomColorDialog::onColorBoxChanged);
connect(m_alphaSpinBox,
static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
this, &CustomColorDialog::spinBoxChanged);
connect(m_rSpinBox,
static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
this, &CustomColorDialog::spinBoxChanged);
connect(m_gSpinBox,
static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
this, &CustomColorDialog::spinBoxChanged);
connect(m_bSpinBox,
static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
this, &CustomColorDialog::spinBoxChanged);
connect(m_hueControl, &HueControl::hueChanged, this, &CustomColorDialog::onHueChanged);
connect(applyButton, &QPushButton::pressed, this, &CustomColorDialog::onAccept);
connect(cancelButton, &QPushButton::pressed, this, &CustomColorDialog::rejected);
m_alphaSpinBox->setMaximum(1);
m_rSpinBox->setMaximum(1);
......
......@@ -62,9 +62,9 @@ FileWidget::FileWidget(QWidget *parent) :
m_comboBox->setEditable(true);
layout->addWidget(m_pushButton);
m_pushButton->setText(QLatin1String("..."));
connect(m_lineEdit, SIGNAL(editingFinished()), this, SLOT(lineEditChanged()));
connect(m_pushButton, SIGNAL(released()), this, SLOT(onButtonReleased()));
connect(m_comboBox, SIGNAL(editTextChanged(QString)), this, SLOT(comboBoxChanged()));
connect(m_lineEdit, &QLineEdit::editingFinished, this, &FileWidget::lineEditChanged);
connect(m_pushButton, &QToolButton::released, this, &FileWidget::onButtonReleased);
connect(m_comboBox, &QComboBox::editTextChanged, this, &FileWidget::comboBoxChanged);
}
FileWidget::~FileWidget()
......
......@@ -38,7 +38,8 @@ namespace QmlEditorWidgets {
FontSizeSpinBox::FontSizeSpinBox(QWidget *parent) :
QAbstractSpinBox(parent), m_isPointSize(true), m_value(0)
{
connect(this, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
connect(this, &FontSizeSpinBox::editingFinished,
this, &FontSizeSpinBox::onEditingFinished);
}
void FontSizeSpinBox::stepBy(int steps)
......
......@@ -45,8 +45,8 @@ using namespace Core::Internal;
CurrentDocumentFind::CurrentDocumentFind()
: m_currentFind(0)
{
connect(qApp, SIGNAL(focusChanged(QWidget*,QWidget*)),
this, SLOT(updateCandidateFindFilter(QWidget*,QWidget*)));
connect(qApp, &QApplication::focusChanged,
this, &CurrentDocumentFind::updateCandidateFindFilter);
}
void CurrentDocumentFind::removeConnections()
......@@ -189,7 +189,8 @@ void CurrentDocumentFind::acceptCandidate()
m_currentFind = m_candidateFind;
if (m_currentFind) {
connect(m_currentFind, SIGNAL(changed()), this, SIGNAL(changed()));
connect(m_currentFind.data(), &IFindSupport::changed,
this, &CurrentDocumentFind::changed);
connect(m_currentFind, SIGNAL(destroyed(QObject*)), SLOT(clearFindSupport()));
}
if (m_currentWidget)
......@@ -200,8 +201,10 @@ void CurrentDocumentFind::acceptCandidate()
void CurrentDocumentFind::removeFindSupportConnections()
{
if (m_currentFind) {
disconnect(m_currentFind, SIGNAL(changed()), this, SIGNAL(changed()));
disconnect(m_currentFind, SIGNAL(destroyed(QObject*)), this, SLOT(clearFindSupport()));
disconnect(m_currentFind.data(), &IFindSupport::changed,
this, &CurrentDocumentFind::changed);
disconnect(m_currentFind.data(), &IFindSupport::destroyed,
this, &CurrentDocumentFind::clearFindSupport);
}
if (m_currentWidget)
m_currentWidget->removeEventFilter(this);
......
......@@ -214,7 +214,8 @@ void FindPlugin::setupMenu()
cmd = ActionManager::registerAction(d->m_openFindDialog, Constants::ADVANCED_FIND, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F")));
mfindadvanced->addAction(cmd);
connect(d->m_openFindDialog, SIGNAL(triggered()), this, SLOT(openFindFilter()));
connect(d->m_openFindDialog, &QAction::triggered,
this, &FindPlugin::openFindFilter);
}
void FindPlugin::setupFilterMenuItems()
......@@ -240,8 +241,8 @@ void FindPlugin::setupFilterMenuItems()
cmd->setDefaultKeySequence(filter->defaultShortcut());
mfindadvanced->addAction(cmd);
d->m_filterActions.insert(filter, action);
connect(action, SIGNAL(triggered(bool)), this, SLOT(openFindFilter()));
connect(filter, SIGNAL(enabledChanged(bool)), this, SLOT(filterChanged()));
connect(action, &QAction::triggered, this, &FindPlugin::openFindFilter);
connect(filter, &IFindFilter::enabledChanged, this, &FindPlugin::filterChanged);
}
d->m_findDialog->setFindFilters(findInterfaces);
d->m_openFindDialog->setEnabled(haveEnabledFilters);
......
......@@ -92,10 +92,12 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
m_ui.findEdit->setAttribute(Qt::WA_MacShowFocusRect, false);
m_ui.replaceEdit->setAttribute(Qt::WA_MacShowFocusRect, false);
connect(m_ui.findEdit, SIGNAL(editingFinished()), this, SLOT(invokeResetIncrementalSearch()));
connect(m_ui.findEdit, &Utils::FancyLineEdit::editingFinished,
this, &FindToolBar::invokeResetIncrementalSearch);
setLightColoredIcon(false);
connect(m_ui.close, SIGNAL(clicked()), this, SLOT(hideAndResetFocus()));
connect(m_ui.close, &QToolButton::clicked,
this, &FindToolBar::hideAndResetFocus);
m_findCompleter->setModel(m_plugin->findCompletionModel());
m_replaceCompleter->setModel(m_plugin->replaceCompletionModel());
......@@ -108,35 +110,42 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
m_ui.findEdit->button(Utils::FancyLineEdit::Left)->setFocusPolicy(Qt::TabFocus);
m_ui.replaceEdit->setPlaceholderText(QString());
connect(m_ui.findEdit, SIGNAL(textChanged(QString)), this, SLOT(invokeFindIncremental()));
connect(m_ui.findEdit, SIGNAL(leftButtonClicked()),
this, SLOT(findEditButtonClicked()));
connect(m_ui.findEdit, &Utils::FancyLineEdit::textChanged,
this, &FindToolBar::invokeFindIncremental);
connect(m_ui.findEdit, &Utils::FancyLineEdit::leftButtonClicked,
this, &FindToolBar::findEditButtonClicked);
// invoke{Find,Replace}Helper change the completion model. QueuedConnection is used to perform these
// changes only after the completer's activated() signal is handled (QTCREATORBUG-8408)
connect(m_ui.findEdit, SIGNAL(returnPressed()), this, SLOT(invokeFindEnter()), Qt::QueuedConnection);
connect(m_ui.replaceEdit, SIGNAL(returnPressed()), this, SLOT(invokeReplaceEnter()), Qt::QueuedConnection);
connect(m_ui.findEdit, &Utils::FancyLineEdit::returnPressed,
this, &FindToolBar::invokeFindEnter, Qt::QueuedConnection);
connect(m_ui.replaceEdit, &Utils::FancyLineEdit::returnPressed,
this, &FindToolBar::invokeReplaceEnter, Qt::QueuedConnection);
QAction *shiftEnterAction = new QAction(m_ui.findEdit);
shiftEnterAction->setShortcut(QKeySequence(tr("Shift+Enter")));
shiftEnterAction->setShortcutContext(Qt::WidgetShortcut);
connect(shiftEnterAction, SIGNAL(triggered()), this, SLOT(invokeFindPrevious()));
connect(shiftEnterAction, &QAction::triggered,
this, &FindToolBar::invokeFindPrevious);
m_ui.findEdit->addAction(shiftEnterAction);
QAction *shiftReturnAction = new QAction(m_ui.findEdit);
shiftReturnAction->setShortcut(QKeySequence(tr("Shift+Return")));
shiftReturnAction->setShortcutContext(Qt::WidgetShortcut);
connect(shiftReturnAction, SIGNAL(triggered()), this, SLOT(invokeFindPrevious()));
connect(shiftReturnAction, &QAction::triggered,
this, &FindToolBar::invokeFindPrevious);
m_ui.findEdit->addAction(shiftReturnAction);
QAction *shiftEnterReplaceAction = new QAction(m_ui.replaceEdit);
shiftEnterReplaceAction->setShortcut(QKeySequence(tr("Shift+Enter")));
shiftEnterReplaceAction->setShortcutContext(Qt::WidgetShortcut);
connect(shiftEnterReplaceAction, SIGNAL(triggered()), this, SLOT(invokeReplacePrevious()));
connect(shiftEnterReplaceAction, &QAction::triggered,
this, &FindToolBar::invokeReplacePrevious);
m_ui.replaceEdit->addAction(shiftEnterReplaceAction);
QAction *shiftReturnReplaceAction = new QAction(m_ui.replaceEdit);
shiftReturnReplaceAction->setShortcut(QKeySequence(tr("Shift+Return")));
shiftReturnReplaceAction->setShortcutContext(Qt::WidgetShortcut);
connect(shiftReturnReplaceAction, SIGNAL(triggered()), this, SLOT(invokeReplacePrevious()));
connect(shiftReturnReplaceAction, &QAction::triggered,
this, &FindToolBar::invokeReplacePrevious);
m_ui.replaceEdit->addAction(shiftReturnReplaceAction);
// need to make sure QStringList is registered as metatype
......@@ -153,14 +162,16 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
m_goToCurrentFindAction = new QAction(this);
ActionManager::registerAction(m_goToCurrentFindAction, Constants::S_RETURNTOEDITOR,
findcontext);
connect(m_goToCurrentFindAction, SIGNAL(triggered()), this, SLOT(setFocusToCurrentFindSupport()));
connect(m_goToCurrentFindAction, &QAction::triggered,
this, &FindToolBar::setFocusToCurrentFindSupport);
QIcon icon = QIcon::fromTheme(QLatin1String("edit-find-replace"));
m_findInDocumentAction = new QAction(icon, tr("Find/Replace"), this);
cmd = ActionManager::registerAction(m_findInDocumentAction, Constants::FIND_IN_DOCUMENT, globalcontext);
cmd->setDefaultKeySequence(QKeySequence::Find);
mfind->addAction(cmd, Constants::G_FIND_CURRENTDOCUMENT);
connect(m_findInDocumentAction, SIGNAL(triggered()), this, SLOT(openFind()));
connect(m_findInDocumentAction, &QAction::triggered,
this, &FindToolBar::openFind);
// Pressing the find shortcut while focus is in the tool bar should not change the search text,
// so register a different find action for the tool bar
......@@ -175,7 +186,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
cmd = ActionManager::registerAction(m_enterFindStringAction, "Find.EnterFindString", globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E")));
mfind->addAction(cmd, Constants::G_FIND_ACTIONS);
connect(m_enterFindStringAction, SIGNAL(triggered()), this, SLOT(putSelectionToFindClipboard()));
connect(m_enterFindStringAction, &QAction::triggered, this, &FindToolBar::putSelectionToFindClipboard);
connect(QApplication::clipboard(), SIGNAL(findBufferChanged()), this, SLOT(updateFromFindClipboard()));
}
......@@ -183,7 +194,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
cmd = ActionManager::registerAction(m_findNextAction, Constants::FIND_NEXT, globalcontext);
cmd->setDefaultKeySequence(QKeySequence::FindNext);
mfind->addAction(cmd, Constants::G_FIND_ACTIONS);
connect(m_findNextAction, SIGNAL(triggered()), this, SLOT(invokeGlobalFindNext()));
connect(m_findNextAction, &QAction::triggered, this, &FindToolBar::invokeGlobalFindNext);
m_localFindNextAction = new QAction(m_findNextAction->text(), this);
cmd = ActionManager::registerAction(m_localFindNextAction, Constants::FIND_NEXT, findcontext);
cmd->augmentActionWithShortcutToolTip(m_localFindNextAction);
......@@ -194,7 +205,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
cmd = ActionManager::registerAction(m_findPreviousAction, Constants::FIND_PREVIOUS, globalcontext);
cmd->setDefaultKeySequence(QKeySequence::FindPrevious);
mfind->addAction(cmd, Constants::G_FIND_ACTIONS);
connect(m_findPreviousAction, SIGNAL(triggered()), this, SLOT(invokeGlobalFindPrevious()));
connect(m_findPreviousAction, &QAction::triggered, this, &FindToolBar::invokeGlobalFindPrevious);
m_localFindPreviousAction = new QAction(m_findPreviousAction->text(), this);
cmd = ActionManager::registerAction(m_localFindPreviousAction, Constants::FIND_PREVIOUS, findcontext);
cmd->augmentActionWithShortcutToolTip(m_localFindPreviousAction);
......@@ -205,19 +216,19 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
cmd = ActionManager::registerAction(m_findNextSelectedAction, Constants::FIND_NEXT_SELECTED, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+F3")));
mfind->addAction(cmd, Constants::G_FIND_ACTIONS);
connect(m_findNextSelectedAction, SIGNAL(triggered()), this, SLOT(findNextSelected()));
connect(m_findNextSelectedAction, &QAction::triggered, this, &FindToolBar::findNextSelected);
m_findPreviousSelectedAction = new QAction(tr("Find Previous (Selected)"), this);
cmd = ActionManager::registerAction(m_findPreviousSelectedAction, Constants::FIND_PREV_SELECTED, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F3")));
mfind->addAction(cmd, Constants::G_FIND_ACTIONS);
connect(m_findPreviousSelectedAction, SIGNAL(triggered()), this, SLOT(findPreviousSelected()));
connect(m_findPreviousSelectedAction, &QAction::triggered, this, &FindToolBar::findPreviousSelected);
m_replaceAction = new QAction(tr("Replace"), this);
cmd = ActionManager::registerAction(m_replaceAction, Constants::REPLACE, globalcontext);
cmd->setDefaultKeySequence(QKeySequence());
mfind->addAction(cmd, Constants::G_FIND_ACTIONS);
connect(m_replaceAction, SIGNAL(triggered()), this, SLOT(invokeGlobalReplace()));
connect(m_replaceAction, &QAction::triggered, this, &FindToolBar::invokeGlobalReplace);
m_localReplaceAction = new QAction(m_replaceAction->text(), this);
cmd = ActionManager::registerAction(m_localReplaceAction, Constants::REPLACE, findcontext);
cmd->augmentActionWithShortcutToolTip(m_localReplaceAction);
......@@ -228,7 +239,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
cmd = ActionManager::registerAction(m_replaceNextAction, Constants::REPLACE_NEXT, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+=")));