Convert some signals and slots to the new syntax.
This commit is contained in:
parent
36caff20f6
commit
5a408305f2
|
@ -61,7 +61,6 @@ find_package(KF5 5.16 REQUIRED
|
|||
|
||||
# use sane compile flags
|
||||
add_definitions(
|
||||
# -fexceptions
|
||||
-DQT_USE_QSTRINGBUILDER
|
||||
-DQT_NO_CAST_TO_ASCII
|
||||
-DQT_NO_CAST_FROM_ASCII
|
||||
|
|
|
@ -126,9 +126,9 @@ void ApplyProgressDialog::setupConnections()
|
|||
connect(&timer(), SIGNAL(timeout()), SLOT(onSecondElapsed()));
|
||||
connect(&detailsWidget().buttonSave(), SIGNAL(clicked()), SLOT(saveReport()));
|
||||
connect(&detailsWidget().buttonBrowser(), SIGNAL(clicked()), SLOT(browserReport()));
|
||||
connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
connect(detailsButton, SIGNAL(clicked()), this, SLOT(toggleDetails()));
|
||||
connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &ApplyProgressDialog::accept);
|
||||
connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &ApplyProgressDialog::reject);
|
||||
connect(detailsButton, &QPushButton::clicked, this, &ApplyProgressDialog::toggleDetails);
|
||||
}
|
||||
|
||||
/** Shows the dialog */
|
||||
|
@ -277,8 +277,8 @@ void ApplyProgressDialog::onOpStarted(int num, Operation* op)
|
|||
dialogWidget().progressSub().setValue(0);
|
||||
dialogWidget().progressSub().setRange(0, op->totalProgress());
|
||||
|
||||
connect(op, SIGNAL(jobStarted(Job*, Operation*)), SLOT(onJobStarted(Job*, Operation*)));
|
||||
connect(op, SIGNAL(jobFinished(Job*, Operation*)), SLOT(onJobFinished(Job*, Operation*)));
|
||||
connect(op, &Operation::jobStarted, this, &ApplyProgressDialog::onJobStarted);
|
||||
connect(op, &Operation::jobFinished, this, &ApplyProgressDialog::onJobFinished);
|
||||
}
|
||||
|
||||
void ApplyProgressDialog::onJobStarted(Job* job, Operation* op)
|
||||
|
|
|
@ -73,15 +73,16 @@ protected Q_SLOTS:
|
|||
void onOkButton();
|
||||
void onOpStarted(int num, Operation* op);
|
||||
void onOpFinished(int num, Operation* op);
|
||||
void onJobStarted(Job* job, Operation* op);
|
||||
void onJobFinished(Job* job, Operation* op);
|
||||
void onSecondElapsed();
|
||||
void saveReport();
|
||||
void toggleDetails();
|
||||
void browserReport();
|
||||
void updateReport(bool force = false);
|
||||
|
||||
protected:
|
||||
void onJobStarted(Job* job, Operation* op);
|
||||
void onJobFinished(Job* job, Operation* op);
|
||||
void toggleDetails();
|
||||
|
||||
void closeEvent(QCloseEvent* e) override;
|
||||
void keyPressEvent(QKeyEvent* e) override;
|
||||
|
||||
|
|
|
@ -45,8 +45,8 @@ CreatePartitionTableDialog::CreatePartitionTableDialog(QWidget* parent, const De
|
|||
mainLayout->addWidget(dialogButtonBox);
|
||||
|
||||
connect(&widget().radioMSDOS(), SIGNAL(toggled(bool)), SLOT(onMSDOSToggled(bool)));
|
||||
connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &CreatePartitionTableDialog::accept);
|
||||
connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &CreatePartitionTableDialog::reject);
|
||||
}
|
||||
|
||||
PartitionTable::TableType CreatePartitionTableDialog::type() const
|
||||
|
|
|
@ -76,8 +76,8 @@ void DevicePropsDialog::setupDialog()
|
|||
okButton->setEnabled(false);
|
||||
cancelButton->setFocus();
|
||||
cancelButton->setDefault(true);
|
||||
connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &DevicePropsDialog::accept);
|
||||
connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &DevicePropsDialog::reject);
|
||||
|
||||
QString type = QStringLiteral("---");
|
||||
QString maxPrimaries = QStringLiteral("---");
|
||||
|
|
|
@ -107,7 +107,7 @@ void FileSystemSupportDialog::setupDialog()
|
|||
|
||||
void FileSystemSupportDialog::setupConnections()
|
||||
{
|
||||
connect(dialogButtonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), SLOT(close()));
|
||||
connect(dialogButtonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &FileSystemSupportDialog::close);
|
||||
connect(&dialogWidget().buttonRescan(), SIGNAL(clicked()), SLOT(onButtonRescanClicked()));
|
||||
}
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ void MainWindow::init()
|
|||
{
|
||||
treeLog().init();
|
||||
|
||||
connect(GlobalLog::instance(), SIGNAL(newMessage(Log::Level, const QString&)), &treeLog(), SLOT(onNewLogMessage(Log::Level, const QString&)));
|
||||
connect(GlobalLog::instance(), &GlobalLog::newMessage, &treeLog(), &TreeLog::onNewLogMessage);
|
||||
|
||||
setupActions();
|
||||
setupStatusBar();
|
||||
|
@ -657,7 +657,7 @@ void MainWindow::updateSeletedDeviceMenu()
|
|||
action->setCheckable(true);
|
||||
action->setChecked(d->deviceNode() == pmWidget().selectedDevice()->deviceNode());
|
||||
action->setData(d->deviceNode());
|
||||
connect(action, SIGNAL(triggered(bool)), SLOT(onSelectedDeviceMenuTriggered(bool)));
|
||||
connect(action, &QAction::triggered, this, &MainWindow::onSelectedDeviceMenuTriggered);
|
||||
devicesMenu->addAction(action);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -211,6 +211,8 @@ protected:
|
|||
return *m_ScanProgressDialog;
|
||||
}
|
||||
|
||||
void onSelectedDeviceMenuTriggered(bool);
|
||||
|
||||
protected Q_SLOTS:
|
||||
void on_m_PartitionManagerWidget_selectedPartitionChanged(const Partition* p);
|
||||
void on_m_PartitionManagerWidget_contextMenuRequested(const QPoint& pos);
|
||||
|
@ -251,7 +253,6 @@ protected Q_SLOTS:
|
|||
|
||||
void onSmartStatusDevice();
|
||||
void onPropertiesDevice(const QString& device_node = QString());
|
||||
void onSelectedDeviceMenuTriggered(bool);
|
||||
|
||||
private:
|
||||
OperationStack* m_OperationStack;
|
||||
|
|
|
@ -153,7 +153,7 @@ void PartitionManagerWidget::saveConfig() const
|
|||
|
||||
void PartitionManagerWidget::setupConnections()
|
||||
{
|
||||
connect(treePartitions().header(), SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(onHeaderContextMenu(const QPoint&)));
|
||||
connect(treePartitions().header(), &QHeaderView::customContextMenuRequested, this, &PartitionManagerWidget::onHeaderContextMenu);
|
||||
}
|
||||
|
||||
void PartitionManagerWidget::clear()
|
||||
|
|
|
@ -135,6 +135,8 @@ protected:
|
|||
return *m_TreePartitions;
|
||||
}
|
||||
|
||||
void onHeaderContextMenu(const QPoint& p);
|
||||
|
||||
protected Q_SLOTS:
|
||||
void on_m_TreePartitions_currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous);
|
||||
void on_m_TreePartitions_customContextMenuRequested(const QPoint& pos);
|
||||
|
@ -144,8 +146,6 @@ protected Q_SLOTS:
|
|||
void on_m_PartTableWidget_customContextMenuRequested(const QPoint& pos);
|
||||
void on_m_PartTableWidget_itemDoubleClicked();
|
||||
|
||||
void onHeaderContextMenu(const QPoint& p);
|
||||
|
||||
private:
|
||||
OperationStack* m_OperationStack;
|
||||
Device* m_SelectedDevice;
|
||||
|
|
|
@ -107,8 +107,8 @@ void PartPropsDialog::setupDialog()
|
|||
okButton->setEnabled(false);
|
||||
cancelButton->setFocus();
|
||||
cancelButton->setDefault(true);
|
||||
connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &PartPropsDialog::accept);
|
||||
connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &PartPropsDialog::reject);
|
||||
|
||||
dialogWidget().partWidget().init(&partition());
|
||||
|
||||
|
|
|
@ -71,9 +71,9 @@ SizeDialogBase::SizeDialogBase(QWidget* parent, Device& d, Partition& part, qint
|
|||
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||
mainLayout->addWidget(dialogButtonBox);
|
||||
|
||||
connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
connect(detailsButton, SIGNAL(clicked()), this, SLOT(toggleDetails()));
|
||||
connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &SizeDialogBase::accept);
|
||||
connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &SizeDialogBase::reject);
|
||||
connect(detailsButton, &QPushButton::clicked, this, &SizeDialogBase::toggleDetails);
|
||||
}
|
||||
|
||||
void SizeDialogBase::setupDialog()
|
||||
|
|
|
@ -127,9 +127,9 @@ protected Q_SLOTS:
|
|||
void onSpinLastSectorChanged(double newLast);
|
||||
void onAlignToggled(bool);
|
||||
|
||||
protected:
|
||||
void toggleDetails();
|
||||
|
||||
protected:
|
||||
SizeDialogWidget* m_SizeDialogWidget;
|
||||
SizeDetailsWidget* m_SizeDetailsWidget;
|
||||
Device& m_Device;
|
||||
|
|
|
@ -141,8 +141,8 @@ void SmartDialog::setupDialog()
|
|||
|
||||
void SmartDialog::setupConnections()
|
||||
{
|
||||
connect(buttonBox->button(QDialogButtonBox::Save), SIGNAL(clicked()), SLOT(saveSmartReport()));
|
||||
connect(buttonBox->button(QDialogButtonBox::Close), SIGNAL(clicked()), SLOT(close()));
|
||||
connect(buttonBox->button(QDialogButtonBox::Save), &QPushButton::clicked, this, &SmartDialog::saveSmartReport);
|
||||
connect(buttonBox->button(QDialogButtonBox::Close), &QPushButton::clicked, this, &SmartDialog::close);
|
||||
}
|
||||
|
||||
QString SmartDialog::toHtml() const
|
||||
|
|
|
@ -38,17 +38,15 @@ class QDialogButtonBox;
|
|||
*/
|
||||
class SmartDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(SmartDialog)
|
||||
|
||||
public:
|
||||
SmartDialog(QWidget* parent, Device& d);
|
||||
~SmartDialog();
|
||||
|
||||
protected Q_SLOTS:
|
||||
protected:
|
||||
void saveSmartReport();
|
||||
|
||||
protected:
|
||||
void setupDialog();
|
||||
void setupConnections();
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ void SmartDialogWidget::saveConfig() const
|
|||
|
||||
void SmartDialogWidget::setupConnections()
|
||||
{
|
||||
connect(treeSmartAttributes().header(), SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(onHeaderContextMenu(const QPoint&)));
|
||||
connect(treeSmartAttributes().header(), &QHeaderView::customContextMenuRequested, this, &SmartDialogWidget::onHeaderContextMenu);
|
||||
}
|
||||
|
||||
void SmartDialogWidget::onHeaderContextMenu(const QPoint& p)
|
||||
|
|
|
@ -29,8 +29,6 @@ class QPoint;
|
|||
*/
|
||||
class SmartDialogWidget : public QWidget, public Ui::SmartDialogWidgetBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SmartDialogWidget(QWidget* parent);
|
||||
~SmartDialogWidget();
|
||||
|
@ -95,8 +93,6 @@ protected:
|
|||
void setupConnections();
|
||||
void loadConfig();
|
||||
void saveConfig() const;
|
||||
|
||||
protected Q_SLOTS:
|
||||
void onHeaderContextMenu(const QPoint& p);
|
||||
|
||||
private:
|
||||
|
|
|
@ -51,7 +51,7 @@ TreeLog::TreeLog(QWidget* parent) :
|
|||
setupUi(this);
|
||||
|
||||
treeLog().header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(treeLog().header(), SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(onHeaderContextMenu(const QPoint&)));
|
||||
connect(treeLog().header(), &QHeaderView::customContextMenuRequested, this, &TreeLog::onHeaderContextMenu);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -44,15 +44,16 @@ Q_SIGNALS:
|
|||
|
||||
public:
|
||||
void init();
|
||||
void onNewLogMessage(Log::Level logLevel, const QString& s);
|
||||
|
||||
protected Q_SLOTS:
|
||||
void onNewLogMessage(Log::Level logLevel, const QString& s);
|
||||
void onHeaderContextMenu(const QPoint& pos);
|
||||
void onClearLog();
|
||||
void onSaveLog();
|
||||
void on_m_TreeLog_customContextMenuRequested(const QPoint& pos);
|
||||
|
||||
protected:
|
||||
void onHeaderContextMenu(const QPoint& pos);
|
||||
|
||||
QTreeWidget& treeLog() {
|
||||
Q_ASSERT(m_TreeLog);
|
||||
return *m_TreeLog;
|
||||
|
|
Loading…
Reference in New Issue