modernize usage of connect()
This commit is contained in:
@@ -151,8 +151,7 @@ FileChooser::FileChooser( QWidget *parent )
|
||||
lineEdit = new QLineEdit( this );
|
||||
layout->addWidget( lineEdit );
|
||||
|
||||
connect(lineEdit, SIGNAL(textChanged(const QString &)),
|
||||
this, SIGNAL(fileNameChanged(const QString &)));
|
||||
connect(lineEdit, &QLineEdit::textChanged, this, &FileChooser::fileNameChanged);
|
||||
|
||||
button = new QPushButton( "...", this );
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
|
||||
@@ -162,7 +161,7 @@ FileChooser::FileChooser( QWidget *parent )
|
||||
#endif
|
||||
layout->addWidget( button );
|
||||
|
||||
connect(button, SIGNAL(clicked()), this, SLOT(chooseFile()));
|
||||
connect(button, &QPushButton::clicked, this, &FileChooser::chooseFile);
|
||||
|
||||
setFocusProxy( lineEdit );
|
||||
}
|
||||
@@ -877,10 +876,8 @@ QuantitySpinBox::QuantitySpinBox(QWidget *parent)
|
||||
{
|
||||
d_ptr->locale = locale();
|
||||
this->setContextMenuPolicy(Qt::DefaultContextMenu);
|
||||
QObject::connect(lineEdit(), SIGNAL(textChanged(QString)),
|
||||
this, SLOT(userInput(QString)));
|
||||
QObject::connect(this, SIGNAL(editingFinished()),
|
||||
this, SLOT(handlePendingEmit()));
|
||||
connect(lineEdit(), &QLineEdit::textChanged, this, &QuantitySpinBox::userInput);
|
||||
connect(this, &QuantitySpinBox::editingFinished, this, &QuantitySpinBox::handlePendingEmit);
|
||||
}
|
||||
|
||||
QuantitySpinBox::~QuantitySpinBox()
|
||||
@@ -1412,8 +1409,7 @@ void PrefQuantitySpinBox::setParamGrpPath(const QByteArray& name)
|
||||
CommandIconView::CommandIconView ( QWidget * parent )
|
||||
: QListWidget(parent)
|
||||
{
|
||||
connect(this, SIGNAL (currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
|
||||
this, SLOT (onSelectionChanged(QListWidgetItem *, QListWidgetItem *)) );
|
||||
connect(this, &QListWidget::currentItemChanged, this, &CommandIconView::onSelectionChanged);
|
||||
}
|
||||
|
||||
CommandIconView::~CommandIconView ()
|
||||
@@ -1439,7 +1435,7 @@ void CommandIconView::startDrag ( Qt::DropActions /*supportedActions*/ )
|
||||
|
||||
QDrag *drag = new QDrag(this);
|
||||
drag->setMimeData(mimeData);
|
||||
drag->setHotSpot(QPoint(pixmap.width()/2, pixmap.height()/2));
|
||||
drag->setHotSpot(QPoint(pixmap.width() / 2, pixmap.height() / 2));
|
||||
drag->setPixmap(pixmap);
|
||||
drag->exec(Qt::MoveAction);
|
||||
}
|
||||
@@ -1581,8 +1577,8 @@ UIntSpinBox::UIntSpinBox (QWidget* parent)
|
||||
{
|
||||
d = new UIntSpinBoxPrivate;
|
||||
d->mValidator = new UnsignedValidator(this->minimum(), this->maximum(), this);
|
||||
connect(this, SIGNAL(valueChanged(int)),
|
||||
this, SLOT(valueChange(int)));
|
||||
connect(this, qOverload<uint>(&UIntSpinBox::valueChanged),
|
||||
this, &UIntSpinBox::valueChange);
|
||||
setRange(0, 99);
|
||||
setValue(0);
|
||||
updateValidator();
|
||||
@@ -1768,7 +1764,7 @@ ColorButton::ColorButton(QWidget* parent)
|
||||
_allowTransparency(false)
|
||||
{
|
||||
_col = palette().color(QPalette::Active,QPalette::Midlight);
|
||||
connect( this, SIGNAL( clicked() ), SLOT( onChooseColor() ));
|
||||
connect(this, &ColorButton::clicked, this, &ColorButton::onChooseColor);
|
||||
}
|
||||
|
||||
ColorButton::~ColorButton()
|
||||
|
||||
Reference in New Issue
Block a user