Gui: move to new style connect()
This commit is contained in:
@@ -69,10 +69,10 @@ bool Assistant::startAssistant()
|
||||
{
|
||||
if (!proc) {
|
||||
proc = new QProcess();
|
||||
connect(proc, SIGNAL(readyReadStandardOutput()),
|
||||
this, SLOT(readyReadStandardOutput()));
|
||||
connect(proc, SIGNAL(readyReadStandardError()),
|
||||
this, SLOT(readyReadStandardError()));
|
||||
connect(proc, &QProcess::readyReadStandardOutput,
|
||||
this, &Assistant::readyReadStandardOutput);
|
||||
connect(proc, &QProcess::readyReadStandardError,
|
||||
this, &Assistant::readyReadStandardError);
|
||||
}
|
||||
|
||||
if (proc->state() != QProcess::Running) {
|
||||
|
||||
@@ -1586,8 +1586,8 @@ void StdCmdAlignment::activated(int iMsg)
|
||||
std::vector<App::DocumentObject*> sel = Gui::Selection().getObjectsOfType
|
||||
(App::GeoFeature::getClassTypeId());
|
||||
ManualAlignment* align = ManualAlignment::instance();
|
||||
QObject::connect(align, SIGNAL(emitCanceled()), align, SLOT(deleteLater()));
|
||||
QObject::connect(align, SIGNAL(emitFinished()), align, SLOT(deleteLater()));
|
||||
QObject::connect(align, &ManualAlignment::emitCanceled, align, &QObject::deleteLater);
|
||||
QObject::connect(align, &ManualAlignment::emitFinished, align, &QObject::deleteLater);
|
||||
|
||||
// Get the fixed and moving meshes
|
||||
FixedGroup fixedGroup;
|
||||
|
||||
@@ -603,7 +603,7 @@ void CmdTestProgress5::activated(int iMsg)
|
||||
QEventLoop loop;
|
||||
|
||||
auto thr1 = new BarThread(2000);
|
||||
QObject::connect(thr1, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
QObject::connect(thr1, &QThread::finished, &loop, &QEventLoop::quit);
|
||||
thr1->start();
|
||||
loop.exec();
|
||||
|
||||
@@ -611,7 +611,7 @@ void CmdTestProgress5::activated(int iMsg)
|
||||
|
||||
QTimer timer;
|
||||
timer.setSingleShot(true);
|
||||
QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
|
||||
QObject::connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit);
|
||||
thr2->start();
|
||||
timer.start(2000); // 2s timeout
|
||||
loop.exec();
|
||||
|
||||
@@ -1863,8 +1863,8 @@ void StdViewScreenShot::activated(int iMsg)
|
||||
fd.setOptionsWidget(FileOptionsDialog::ExtensionRight, opt);
|
||||
fd.setOption(QFileDialog::DontConfirmOverwrite, false);
|
||||
opt->onSelectedFilter(fd.selectedNameFilter());
|
||||
QObject::connect(&fd, SIGNAL(filterSelected(const QString&)),
|
||||
opt, SLOT(onSelectedFilter(const QString&)));
|
||||
QObject::connect(&fd, &FileOptionsDialog::filterSelected,
|
||||
opt, &DlgSettingsImageImp::onSelectedFilter);
|
||||
|
||||
if (fd.exec() == QDialog::Accepted) {
|
||||
selFilter = fd.selectedNameFilter();
|
||||
|
||||
@@ -51,7 +51,7 @@ DemoMode::DemoMode(QWidget* /*parent*/, Qt::WindowFlags fl)
|
||||
|
||||
timer = new QTimer(this);
|
||||
timer->setInterval(1000 * ui->timeout->value());
|
||||
connect(timer, SIGNAL(timeout()), this, SLOT(onAutoPlay()));
|
||||
connect(timer, &QTimer::timeout, this, &DemoMode::onAutoPlay);
|
||||
oldvalue = ui->angleSlider->value();
|
||||
|
||||
wasHidden = false;
|
||||
|
||||
@@ -97,8 +97,8 @@ DlgCustomizeImp::DlgCustomizeImp(QWidget* parent, Qt::WindowFlags fl)
|
||||
|
||||
// connections
|
||||
//
|
||||
connect(buttonHelp, SIGNAL (clicked()), getMainWindow(), SLOT (whatsThis()));
|
||||
connect(buttonClose, SIGNAL (clicked()), this, SLOT (close()));
|
||||
connect(buttonHelp, &QPushButton::clicked, getMainWindow(), &MainWindow::whatsThis);
|
||||
connect(buttonClose, &QPushButton::clicked, this, &QDialog::close);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -660,8 +660,8 @@ ParameterValue::ParameterValue( QWidget * parent )
|
||||
newUlgAct = menuNew->addAction(tr("New unsigned item"), this, SLOT(onCreateUIntItem()));
|
||||
newBlnAct = menuNew->addAction(tr("New Boolean item"), this, SLOT(onCreateBoolItem()));
|
||||
|
||||
connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),
|
||||
this, SLOT(onChangeSelectedItem(QTreeWidgetItem*, int)));
|
||||
connect(this, &ParameterValue::itemDoubleClicked,
|
||||
this, qOverload<QTreeWidgetItem*, int>(&ParameterValue::onChangeSelectedItem));
|
||||
}
|
||||
|
||||
ParameterValue::~ParameterValue()
|
||||
|
||||
@@ -57,7 +57,8 @@ DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WindowFlags fl )
|
||||
ui->comboBoxScheme->addItem(item, i);
|
||||
}
|
||||
|
||||
connect(ui->ValueInput, SIGNAL(valueChanged(Base::Quantity)), this, SLOT(valueChanged(Base::Quantity)));
|
||||
connect(ui->ValueInput, qOverload<const Base::Quantity&>(&InputField::valueChanged),
|
||||
this, &DlgUnitsCalculator::valueChanged);
|
||||
connect(ui->ValueInput, &InputField::returnPressed,
|
||||
this, &DlgUnitsCalculator::returnPressed);
|
||||
connect(ui->ValueInput, &InputField::parseError, this, &DlgUnitsCalculator::parseError);
|
||||
|
||||
@@ -145,10 +145,10 @@ QDockWidget* DockWindowManager::addDockWindow(const char* name, QWidget* widget,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
connect(dw, SIGNAL(destroyed(QObject*)),
|
||||
this, SLOT(onDockWidgetDestroyed(QObject*)));
|
||||
connect(widget, SIGNAL(destroyed(QObject*)),
|
||||
this, SLOT(onWidgetDestroyed(QObject*)));
|
||||
connect(dw, &QObject::destroyed,
|
||||
this, &DockWindowManager::onDockWidgetDestroyed);
|
||||
connect(widget, &QObject::destroyed,
|
||||
this, &DockWindowManager::onWidgetDestroyed);
|
||||
|
||||
// add the widget to the dock widget
|
||||
widget->setParent(dw);
|
||||
@@ -205,10 +205,10 @@ QWidget* DockWindowManager::removeDockWindow(const char* name)
|
||||
widget = dw->widget();
|
||||
widget->setParent(nullptr);
|
||||
dw->setWidget(nullptr);
|
||||
disconnect(dw, SIGNAL(destroyed(QObject*)),
|
||||
this, SLOT(onDockWidgetDestroyed(QObject*)));
|
||||
disconnect(widget, SIGNAL(destroyed(QObject*)),
|
||||
this, SLOT(onWidgetDestroyed(QObject*)));
|
||||
disconnect(dw, &QObject::destroyed,
|
||||
this, &DockWindowManager::onDockWidgetDestroyed);
|
||||
disconnect(widget, &QObject::destroyed,
|
||||
this, &DockWindowManager::onWidgetDestroyed);
|
||||
delete dw; // destruct the QDockWidget, i.e. the parent of the widget
|
||||
break;
|
||||
}
|
||||
@@ -231,10 +231,10 @@ void DockWindowManager::removeDockWindow(QWidget* widget)
|
||||
// avoid to destruct the embedded widget
|
||||
widget->setParent(nullptr);
|
||||
dw->setWidget(nullptr);
|
||||
disconnect(dw, SIGNAL(destroyed(QObject*)),
|
||||
this, SLOT(onDockWidgetDestroyed(QObject*)));
|
||||
disconnect(widget, SIGNAL(destroyed(QObject*)),
|
||||
this, SLOT(onWidgetDestroyed(QObject*)));
|
||||
disconnect(dw, &QObject::destroyed,
|
||||
this, &DockWindowManager::onDockWidgetDestroyed);
|
||||
disconnect(widget, &QObject::destroyed,
|
||||
this, &DockWindowManager::onWidgetDestroyed);
|
||||
delete dw; // destruct the QDockWidget, i.e. the parent of the widget
|
||||
break;
|
||||
}
|
||||
@@ -427,8 +427,8 @@ void DockWindowManager::onWidgetDestroyed(QObject* widget)
|
||||
for (QList<QDockWidget*>::Iterator it = d->_dockedWindows.begin(); it != d->_dockedWindows.end(); ++it) {
|
||||
// make sure that the dock widget is not about to being deleted
|
||||
if ((*it)->metaObject() != &QDockWidget::staticMetaObject) {
|
||||
disconnect(*it, SIGNAL(destroyed(QObject*)),
|
||||
this, SLOT(onDockWidgetDestroyed(QObject*)));
|
||||
disconnect(*it, &QObject::destroyed,
|
||||
this, &DockWindowManager::onDockWidgetDestroyed);
|
||||
d->_dockedWindows.erase(it);
|
||||
break;
|
||||
}
|
||||
|
||||
+25
-25
@@ -160,10 +160,10 @@ void AutoSaver::saveIfNecessary()
|
||||
NetworkAccessManager::NetworkAccessManager(QObject *parent)
|
||||
: QNetworkAccessManager(parent)
|
||||
{
|
||||
connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
|
||||
SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
|
||||
connect(this, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)),
|
||||
SLOT(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)));
|
||||
connect(this, &QNetworkAccessManager::authenticationRequired,
|
||||
this, &NetworkAccessManager::authenticationRequired);
|
||||
connect(this, &QNetworkAccessManager::proxyAuthenticationRequired,
|
||||
this, &NetworkAccessManager::proxyAuthenticationRequired);
|
||||
|
||||
auto diskCache = new QNetworkDiskCache(this);
|
||||
QString location = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
|
||||
@@ -229,9 +229,9 @@ DownloadItem::DownloadItem(QNetworkReply *reply, bool requestFileName, QWidget *
|
||||
downloadInfoLabel->setPalette(p);
|
||||
progressBar->setMaximum(0);
|
||||
tryAgainButton->hide();
|
||||
connect(stopButton, SIGNAL(clicked()), this, SLOT(stop()));
|
||||
connect(openButton, SIGNAL(clicked()), this, SLOT(open()));
|
||||
connect(tryAgainButton, SIGNAL(clicked()), this, SLOT(tryAgain()));
|
||||
connect(stopButton, &QPushButton::clicked, this, &DownloadItem::stop);
|
||||
connect(openButton, &QPushButton::clicked, this, &DownloadItem::open);
|
||||
connect(tryAgainButton, &QPushButton::clicked, this, &DownloadItem::tryAgain);
|
||||
|
||||
init();
|
||||
}
|
||||
@@ -244,15 +244,15 @@ void DownloadItem::init()
|
||||
// attach to the m_reply
|
||||
m_url = m_reply->url();
|
||||
m_reply->setParent(this);
|
||||
connect(m_reply, SIGNAL(readyRead()), this, SLOT(downloadReadyRead()));
|
||||
connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)),
|
||||
this, SLOT(error(QNetworkReply::NetworkError)));
|
||||
connect(m_reply, SIGNAL(downloadProgress(qint64, qint64)),
|
||||
this, SLOT(downloadProgress(qint64, qint64)));
|
||||
connect(m_reply, SIGNAL(metaDataChanged()),
|
||||
this, SLOT(metaDataChanged()));
|
||||
connect(m_reply, SIGNAL(finished()),
|
||||
this, SLOT(finished()));
|
||||
connect(m_reply, &QNetworkReply::readyRead, this, &DownloadItem::downloadReadyRead);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,15,0)
|
||||
connect(m_reply, qOverload<QNetworkReply::NetworkError>(&QNetworkReply::error), this, &DownloadItem::error);
|
||||
#else
|
||||
connect(m_reply, &QNetworkReply::errorOccurred, this, &DownloadItem::error);
|
||||
#endif
|
||||
connect(m_reply, &QNetworkReply::downloadProgress, this, &DownloadItem::downloadProgress);
|
||||
connect(m_reply, &QNetworkReply::metaDataChanged, this, &DownloadItem::metaDataChanged);
|
||||
connect(m_reply, &QNetworkReply::finished, this, &DownloadItem::finished);
|
||||
|
||||
// reset info
|
||||
downloadInfoLabel->clear();
|
||||
@@ -496,15 +496,15 @@ void DownloadItem::metaDataChanged()
|
||||
if (url != redirectUrl) {
|
||||
url = redirectUrl;
|
||||
|
||||
disconnect(m_reply, SIGNAL(readyRead()), this, SLOT(downloadReadyRead()));
|
||||
disconnect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)),
|
||||
this, SLOT(error(QNetworkReply::NetworkError)));
|
||||
disconnect(m_reply, SIGNAL(downloadProgress(qint64, qint64)),
|
||||
this, SLOT(downloadProgress(qint64, qint64)));
|
||||
disconnect(m_reply, SIGNAL(metaDataChanged()),
|
||||
this, SLOT(metaDataChanged()));
|
||||
disconnect(m_reply, SIGNAL(finished()),
|
||||
this, SLOT(finished()));
|
||||
disconnect(m_reply, &QNetworkReply::readyRead, this, &DownloadItem::downloadReadyRead);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,15,0)
|
||||
disconnect(m_reply, qOverload<QNetworkReply::NetworkError>(&QNetworkReply::error), this, &DownloadItem::error);
|
||||
#else
|
||||
disconnect(m_reply, &QNetworkReply::errorOccurred, this, &DownloadItem::error);
|
||||
#endif
|
||||
disconnect(m_reply, &QNetworkReply::downloadProgress, this, &DownloadItem::downloadProgress);
|
||||
disconnect(m_reply, &QNetworkReply::metaDataChanged, this, &DownloadItem::metaDataChanged);
|
||||
disconnect(m_reply, &QNetworkReply::finished, this, &DownloadItem::finished);
|
||||
m_reply->close();
|
||||
m_reply->deleteLater();
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ DownloadManager::DownloadManager(QWidget *parent)
|
||||
ui->downloadsView->horizontalHeader()->setStretchLastSection(true);
|
||||
m_model = new DownloadModel(this);
|
||||
ui->downloadsView->setModel(m_model);
|
||||
connect(ui->cleanupButton, SIGNAL(clicked()), this, SLOT(cleanup()));
|
||||
connect(ui->cleanupButton, &QPushButton::clicked, this, &DownloadManager::cleanup);
|
||||
load();
|
||||
|
||||
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
|
||||
@@ -167,7 +167,7 @@ void DownloadManager::handleUnsupportedContent(QNetworkReply *reply, bool reques
|
||||
|
||||
void DownloadManager::addItem(DownloadItem *item)
|
||||
{
|
||||
connect(item, SIGNAL(statusChanged()), this, SLOT(updateRow()));
|
||||
connect(item, &DownloadItem::statusChanged, this, &DownloadManager::updateRow);
|
||||
int row = m_downloads.count();
|
||||
m_model->beginInsertRows(QModelIndex(), row, row);
|
||||
m_downloads.append(item);
|
||||
|
||||
+24
-23
@@ -60,7 +60,7 @@ using namespace Gui;
|
||||
namespace Gui {
|
||||
class EditorViewP {
|
||||
public:
|
||||
QPlainTextEdit* textEdit;
|
||||
TextEdit* textEdit;
|
||||
SearchBar* searchBar;
|
||||
QString fileName;
|
||||
EditorView::DisplayName displayName;
|
||||
@@ -83,8 +83,9 @@ TYPESYSTEM_SOURCE_ABSTRACT(Gui::EditorView, Gui::MDIView)
|
||||
* Constructs a EditorView which is a child of 'parent', with the
|
||||
* name 'name'.
|
||||
*/
|
||||
EditorView::EditorView(QPlainTextEdit* editor, QWidget* parent)
|
||||
: MDIView(nullptr,parent,Qt::WindowFlags()), WindowParameter( "Editor" )
|
||||
EditorView::EditorView(TextEdit* editor, QWidget* parent)
|
||||
: MDIView(nullptr, parent, Qt::WindowFlags())
|
||||
, WindowParameter( "Editor" )
|
||||
{
|
||||
d = new EditorViewP;
|
||||
d->lock = false;
|
||||
@@ -100,13 +101,13 @@ EditorView::EditorView(QPlainTextEdit* editor, QWidget* parent)
|
||||
|
||||
// update editor actions on request
|
||||
Gui::MainWindow* mw = Gui::getMainWindow();
|
||||
connect(editor, SIGNAL(undoAvailable(bool)), mw, SLOT(updateEditorActions()));
|
||||
connect(editor, SIGNAL(redoAvailable(bool)), mw, SLOT(updateEditorActions()));
|
||||
connect(editor, SIGNAL(copyAvailable(bool)), mw, SLOT(updateEditorActions()));
|
||||
connect(editor, &QPlainTextEdit::undoAvailable, mw, &MainWindow::updateEditorActions);
|
||||
connect(editor, &QPlainTextEdit::redoAvailable, mw, &MainWindow::updateEditorActions);
|
||||
connect(editor, &QPlainTextEdit::copyAvailable, mw, &MainWindow::updateEditorActions);
|
||||
|
||||
connect(editor, SIGNAL(showSearchBar()), d->searchBar, SLOT(activate()));
|
||||
connect(editor, SIGNAL(findNext()), d->searchBar, SLOT(findNext()));
|
||||
connect(editor, SIGNAL(findPrevious()), d->searchBar, SLOT(findPrevious()));
|
||||
connect(editor, &TextEdit::showSearchBar, d->searchBar, &SearchBar::activate);
|
||||
connect(editor, &TextEdit::findNext, d->searchBar, &SearchBar::findNext);
|
||||
connect(editor, &TextEdit::findPrevious, d->searchBar, &SearchBar::findPrevious);
|
||||
|
||||
// Create the layout containing the workspace and a tab bar
|
||||
auto hbox = new QFrame(this);
|
||||
@@ -131,16 +132,16 @@ EditorView::EditorView(QPlainTextEdit* editor, QWidget* parent)
|
||||
hPrefGrp->NotifyAll();
|
||||
|
||||
d->activityTimer = new QTimer(this);
|
||||
connect(d->activityTimer, SIGNAL(timeout()),
|
||||
this, SLOT(checkTimestamp()) );
|
||||
connect(d->textEdit->document(), SIGNAL(modificationChanged(bool)),
|
||||
this, SLOT(setWindowModified(bool)));
|
||||
connect(d->textEdit->document(), SIGNAL(undoAvailable(bool)),
|
||||
this, SLOT(undoAvailable(bool)));
|
||||
connect(d->textEdit->document(), SIGNAL(redoAvailable(bool)),
|
||||
this, SLOT(redoAvailable(bool)));
|
||||
connect(d->textEdit->document(), SIGNAL(contentsChange(int, int, int)),
|
||||
this, SLOT(contentsChange(int, int, int)));
|
||||
connect(d->activityTimer, &QTimer::timeout,
|
||||
this, &EditorView::checkTimestamp);
|
||||
connect(d->textEdit->document(), &QTextDocument::modificationChanged,
|
||||
this, &EditorView::setWindowModified);
|
||||
connect(d->textEdit->document(), &QTextDocument::undoAvailable,
|
||||
this, &EditorView::undoAvailable);
|
||||
connect(d->textEdit->document(), &QTextDocument::redoAvailable,
|
||||
this, &EditorView::redoAvailable);
|
||||
connect(d->textEdit->document(), &QTextDocument::contentsChange,
|
||||
this, &EditorView::contentsChange);
|
||||
}
|
||||
|
||||
/** Destroys the object and frees any allocated resources */
|
||||
@@ -451,8 +452,8 @@ void EditorView::printPreview()
|
||||
{
|
||||
QPrinter printer(QPrinter::ScreenResolution);
|
||||
QPrintPreviewDialog dlg(&printer, this);
|
||||
connect(&dlg, SIGNAL(paintRequested (QPrinter *)),
|
||||
this, SLOT(print(QPrinter *)));
|
||||
connect(&dlg, &QPrintPreviewDialog::paintRequested,
|
||||
this, qOverload<QPrinter *>(&EditorView::print));
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
@@ -591,8 +592,8 @@ TYPESYSTEM_SOURCE_ABSTRACT(Gui::PythonEditorView, Gui::EditorView)
|
||||
PythonEditorView::PythonEditorView(PythonEditor* editor, QWidget* parent)
|
||||
: EditorView(editor, parent), _pye(editor)
|
||||
{
|
||||
connect(this, SIGNAL(changeFileName(const QString&)),
|
||||
editor, SLOT(setFileName(const QString&)));
|
||||
connect(this, &PythonEditorView::changeFileName,
|
||||
editor, &PythonEditor::setFileName);
|
||||
}
|
||||
|
||||
PythonEditorView::~PythonEditorView()
|
||||
|
||||
@@ -40,6 +40,7 @@ QT_END_NAMESPACE
|
||||
namespace Gui {
|
||||
|
||||
class EditorViewP;
|
||||
class TextEdit;
|
||||
|
||||
/**
|
||||
* A special view class which sends the messages from the application to
|
||||
@@ -59,7 +60,7 @@ public:
|
||||
BaseName
|
||||
};
|
||||
|
||||
EditorView(QPlainTextEdit* editor, QWidget* parent);
|
||||
EditorView(TextEdit* editor, QWidget* parent);
|
||||
~EditorView() override;
|
||||
|
||||
QPlainTextEdit* getEditor() const;
|
||||
|
||||
@@ -451,7 +451,7 @@ FileOptionsDialog::FileOptionsDialog( QWidget* parent, Qt::WindowFlags fl )
|
||||
auto grid = this->findChild<QGridLayout*>();
|
||||
grid->addWidget(extensionButton, 4, 2, Qt::AlignLeft);
|
||||
|
||||
connect(extensionButton, SIGNAL(clicked()), this, SLOT(toggleExtension()));
|
||||
connect(extensionButton, &QPushButton::clicked, this, &FileOptionsDialog::toggleExtension);
|
||||
}
|
||||
|
||||
FileOptionsDialog::~FileOptionsDialog()
|
||||
@@ -685,7 +685,7 @@ FileChooser::FileChooser ( QWidget * parent )
|
||||
|
||||
layout->addWidget(button);
|
||||
|
||||
connect( button, SIGNAL(clicked()), this, SLOT(chooseFile()));
|
||||
connect(button, &QPushButton::clicked, this, &FileChooser::chooseFile);
|
||||
|
||||
setFocusProxy(lineEdit);
|
||||
}
|
||||
@@ -907,8 +907,12 @@ SelectModule::SelectModule (const QString& type, const SelectModule::Dict& types
|
||||
gridLayout->addLayout(hboxLayout, 2, 0, 1, 1);
|
||||
|
||||
// connections
|
||||
connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
|
||||
connect(group, SIGNAL(buttonClicked(int)), this, SLOT(onButtonClicked()));
|
||||
connect(okButton, &QPushButton::clicked, this, &SelectModule::accept);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,15,0)
|
||||
connect(group, qOverload<int>(&QButtonGroup::buttonClicked), this, &SelectModule::onButtonClicked);
|
||||
#else
|
||||
connect(group, &QButtonGroup::idClicked, this, &SelectModule::onButtonClicked);
|
||||
#endif
|
||||
}
|
||||
|
||||
SelectModule::~SelectModule()
|
||||
|
||||
@@ -248,10 +248,10 @@ GraphvizView::GraphvizView(App::Document & _doc, QWidget* parent)
|
||||
|
||||
// Create worker thread
|
||||
thread = new GraphvizWorker(this);
|
||||
connect(thread, SIGNAL(emitFinished()), this, SLOT(done()));
|
||||
connect(thread, SIGNAL(finished()), this, SLOT(done()));
|
||||
connect(thread, SIGNAL(error()), this, SLOT(error()));
|
||||
connect(thread, SIGNAL(svgFileRead(const QByteArray &)), this, SLOT(svgFileRead(const QByteArray &)));
|
||||
connect(thread, &GraphvizWorker::emitFinished, this, &GraphvizView::done);
|
||||
connect(thread, &GraphvizWorker::finished, this, &GraphvizView::done);
|
||||
connect(thread, &GraphvizWorker::error, this, &GraphvizView::error);
|
||||
connect(thread, &GraphvizWorker::svgFileRead, this, &GraphvizView::svgFileRead);
|
||||
|
||||
// Connect signal from document
|
||||
recomputeConnection = _doc.signalRecomputed.connect(boost::bind(&GraphvizView::updateSvgItem, this, bp::_1));
|
||||
@@ -556,8 +556,8 @@ void GraphvizView::printPreview()
|
||||
printer.setPageOrientation(QPageLayout::Landscape);
|
||||
|
||||
QPrintPreviewDialog dlg(&printer, this);
|
||||
connect(&dlg, SIGNAL(paintRequested (QPrinter *)),
|
||||
this, SLOT(print(QPrinter *)));
|
||||
connect(&dlg, &QPrintPreviewDialog::paintRequested,
|
||||
this, qOverload<QPrinter*>(&GraphvizView::print));
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ using namespace Gui;
|
||||
GUIApplication::GUIApplication(int & argc, char ** argv)
|
||||
: GUIApplicationNativeEventAware(argc, argv)
|
||||
{
|
||||
connect(this, SIGNAL(commitDataRequest(QSessionManager&)),
|
||||
SLOT(commitData(QSessionManager&)), Qt::DirectConnection);
|
||||
connect(this, &GUIApplication::commitDataRequest,
|
||||
this, &GUIApplication::commitData, Qt::DirectConnection);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
setFallbackSessionManagementEnabled(false);
|
||||
#endif
|
||||
@@ -200,8 +200,8 @@ public:
|
||||
{
|
||||
// Start a QLocalServer to listen for connections
|
||||
server = new QLocalServer();
|
||||
QObject::connect(server, SIGNAL(newConnection()),
|
||||
q_ptr, SLOT(receiveConnection()));
|
||||
QObject::connect(server, &QLocalServer::newConnection,
|
||||
q_ptr, &GUISingleApplication::receiveConnection);
|
||||
// first attempt
|
||||
if (!server->listen(serverName)) {
|
||||
if (server->serverError() == QAbstractSocket::AddressInUseError) {
|
||||
@@ -231,7 +231,7 @@ GUISingleApplication::GUISingleApplication(int & argc, char ** argv)
|
||||
d_ptr(new Private(this))
|
||||
{
|
||||
d_ptr->setupConnection();
|
||||
connect(d_ptr->timer, SIGNAL(timeout()), this, SLOT(processMessages()));
|
||||
connect(d_ptr->timer, &QTimer::timeout, this, &GUISingleApplication::processMessages);
|
||||
}
|
||||
|
||||
GUISingleApplication::~GUISingleApplication()
|
||||
@@ -274,8 +274,8 @@ void GUISingleApplication::receiveConnection()
|
||||
if (!socket)
|
||||
return;
|
||||
|
||||
connect(socket, SIGNAL(disconnected()),
|
||||
socket, SLOT(deleteLater()));
|
||||
connect(socket, &QLocalSocket::disconnected,
|
||||
socket, &QLocalSocket::deleteLater);
|
||||
if (socket->waitForReadyRead()) {
|
||||
QDataStream in(socket);
|
||||
if (!in.atEnd()) {
|
||||
|
||||
@@ -74,8 +74,8 @@ LocationWidget::LocationWidget (QWidget * parent)
|
||||
auto gridLayout = new QGridLayout(this);
|
||||
gridLayout->addLayout(box, 0, 0, 1, 2);
|
||||
|
||||
connect(dValue, SIGNAL(activated(int)),
|
||||
this, SLOT(on_direction_activated(int)));
|
||||
connect(dValue, qOverload<int>(&QComboBox::activated),
|
||||
this, &LocationWidget::on_direction_activated);
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -264,8 +264,8 @@ void MDIView::printPreview()
|
||||
{
|
||||
QPrinter printer(QPrinter::ScreenResolution);
|
||||
QPrintPreviewDialog dlg(&printer, this);
|
||||
connect(&dlg, SIGNAL(paintRequested (QPrinter *)),
|
||||
this, SLOT(print(QPrinter *)));
|
||||
connect(&dlg, &QPrintPreviewDialog::paintRequested,
|
||||
this, qOverload<QPrinter*>(&MDIView::print));
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
|
||||
@@ -820,7 +820,7 @@ void ManualAlignment::startAlignment(Base::Type mousemodel)
|
||||
: tr("Please, select at least %1 points in the left and the right view").arg(n);
|
||||
myViewer->myLabel->setText(msg);
|
||||
|
||||
connect(myViewer, SIGNAL(destroyed()), this, SLOT(reset()));
|
||||
connect(myViewer, &QObject::destroyed, this, &ManualAlignment::reset);
|
||||
|
||||
// show all aligned views in the 2nd view
|
||||
myFixedGroup.addToViewer(myViewer->getViewer(1));
|
||||
|
||||
@@ -91,11 +91,11 @@ NetworkRetriever::NetworkRetriever( QObject * parent )
|
||||
wget = new QProcess(this);
|
||||
|
||||
// if wgets exits emit signal
|
||||
connect(wget, SIGNAL(finished(int, QProcess::ExitStatus)),
|
||||
this, SLOT(wgetFinished(int, QProcess::ExitStatus)));
|
||||
connect(wget, qOverload<int, QProcess::ExitStatus>(&QProcess::finished),
|
||||
this, &NetworkRetriever::wgetFinished);
|
||||
|
||||
// if application quits kill wget immediately to avoid dangling processes
|
||||
connect( qApp, SIGNAL(lastWindowClosed()), wget, SLOT(kill()) );
|
||||
connect(qApp, &QApplication::lastWindowClosed, wget, &QProcess::kill);
|
||||
}
|
||||
|
||||
NetworkRetriever::~NetworkRetriever()
|
||||
@@ -406,7 +406,7 @@ StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp( QObject * parent)
|
||||
wget->setFollowRelative( false );
|
||||
wget->setNoParent( true );
|
||||
|
||||
connect( wget, SIGNAL( wgetExited() ), this, SLOT( wgetFinished() ) );
|
||||
connect(wget, &NetworkRetriever::wgetExited, this, &StdCmdDownloadOnlineHelp::wgetFinished);
|
||||
}
|
||||
|
||||
StdCmdDownloadOnlineHelp::~StdCmdDownloadOnlineHelp()
|
||||
|
||||
@@ -288,8 +288,8 @@ void HttpServer::incomingConnection(qintptr socket)
|
||||
// works asynchronously, this means that all the communication is done
|
||||
// in the two slots readClient() and discardClient().
|
||||
auto s = new QTcpSocket(this);
|
||||
connect(s, SIGNAL(readyRead()), this, SLOT(readClient()));
|
||||
connect(s, SIGNAL(disconnected()), this, SLOT(discardClient()));
|
||||
connect(s, &QTcpSocket::readyRead, this, &HttpServer::readClient);
|
||||
connect(s, &QTcpSocket::disconnected, this, &HttpServer::discardClient);
|
||||
s->setSocketDescriptor(socket);
|
||||
}
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@ ProgressBar::ProgressBar (SequencerBar* s, QWidget * parent)
|
||||
d->minimumDuration = 2000; // 2 seconds
|
||||
d->delayShowTimer = new QTimer(this);
|
||||
d->delayShowTimer->setSingleShot(true);
|
||||
connect(d->delayShowTimer, SIGNAL(timeout()), this, SLOT(delayedShow()));
|
||||
connect(d->delayShowTimer, &QTimer::timeout, this, &ProgressBar::delayedShow);
|
||||
d->observeEventFilter = 0;
|
||||
|
||||
setFixedWidth(120);
|
||||
@@ -410,7 +410,7 @@ ProgressBar::ProgressBar (SequencerBar* s, QWidget * parent)
|
||||
|
||||
ProgressBar::~ProgressBar ()
|
||||
{
|
||||
disconnect(d->delayShowTimer, SIGNAL(timeout()), this, SLOT(delayedShow()));
|
||||
disconnect(d->delayShowTimer, &QTimer::timeout, this, &ProgressBar::delayedShow);
|
||||
delete d->delayShowTimer;
|
||||
delete d;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ PropertyView::PropertyView(QWidget *parent)
|
||||
|
||||
timer = new QTimer(this);
|
||||
timer->setSingleShot(true);
|
||||
connect(timer, SIGNAL(timeout()), this, SLOT(onTimer()));
|
||||
connect(timer, &QTimer::timeout, this, &PropertyView::onTimer);
|
||||
|
||||
tabs = new QTabWidget (this);
|
||||
tabs->setObjectName(QString::fromUtf8("propertyTab"));
|
||||
@@ -99,7 +99,7 @@ PropertyView::PropertyView(QWidget *parent)
|
||||
tabs->setCurrentIndex(preferredTab);
|
||||
|
||||
// connect after adding all tabs, so adding doesn't thrash the parameter
|
||||
connect(tabs, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
|
||||
connect(tabs, &QTabWidget::currentChanged, this, &PropertyView::tabChanged);
|
||||
|
||||
this->connectPropData =
|
||||
App::GetApplication().signalChangedObject.connect(boost::bind
|
||||
|
||||
@@ -1429,7 +1429,7 @@ QString PythonConsole::readline( )
|
||||
printPrompt(PythonConsole::Special);
|
||||
this->_sourceDrain = &inputBuffer; //< enable source drain ...
|
||||
// ... and wait until we get notified about pendingSource
|
||||
QObject::connect( this, SIGNAL(pendingSource()), &loop, SLOT(quit()) );
|
||||
QObject::connect( this, &PythonConsole::pendingSource, &loop, &QEventLoop::quit);
|
||||
// application is about to quit
|
||||
if (loop.exec() != 0) {
|
||||
PyErr_SetInterrupt();
|
||||
|
||||
@@ -616,7 +616,7 @@ int PythonDebugger::tracer_callback(PyObject *obj, PyFrameObject *frame, int wha
|
||||
if (bp.checkLine(line)) {
|
||||
dbg->showDebugMarker(file, line);
|
||||
QEventLoop loop;
|
||||
QObject::connect(dbg, SIGNAL(signalNextStep()), &loop, SLOT(quit()));
|
||||
QObject::connect(dbg, &PythonDebugger::signalNextStep, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
dbg->hideDebugMarker(file);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ void ActionGroup::init(bool header)
|
||||
vbl->addWidget(myDummy);
|
||||
myDummy->hide();
|
||||
|
||||
connect(myHeader, SIGNAL(activated()), this, SLOT(showHide()));
|
||||
connect(myHeader, &TaskHeader::activated, this, &ActionGroup::showHide);
|
||||
}
|
||||
|
||||
void ActionGroup::setScheme(ActionPanelScheme *pointer)
|
||||
|
||||
@@ -37,7 +37,7 @@ TaskHeader::TaskHeader(const QIcon &icon, const QString &title, bool expandable,
|
||||
myTitle->setIcon(icon);
|
||||
myTitle->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
|
||||
|
||||
connect(myTitle, SIGNAL(clicked()), this, SLOT(fold()));
|
||||
connect(myTitle, &ActionLabel::clicked, this, &TaskHeader::fold);
|
||||
|
||||
QHBoxLayout *hbl = new QHBoxLayout();
|
||||
hbl->setContentsMargins(2, 2, 2, 2);
|
||||
|
||||
@@ -105,25 +105,25 @@ ContextMenu::ContextMenu(QuarterWidget * quarterwidget)
|
||||
functionsmenu->addAction(viewall);
|
||||
functionsmenu->addAction(seek);
|
||||
|
||||
QObject::connect(seek, SIGNAL(triggered()),
|
||||
this->quarterwidget, SLOT(seek()));
|
||||
QObject::connect(seek, &QAction::triggered,
|
||||
this->quarterwidget, &QuarterWidget::seek);
|
||||
|
||||
QObject::connect(viewall, SIGNAL(triggered()),
|
||||
this->quarterwidget, SLOT(viewAll()));
|
||||
QObject::connect(viewall, &QAction::triggered,
|
||||
this->quarterwidget, &QuarterWidget::viewAll);
|
||||
|
||||
// FIXME: It would be ideal to expose these actiongroups to Qt
|
||||
// Designer and be able to connect them to the appropriate slots on
|
||||
// QuarterWidget, but this is not possible in Qt. Exposing every
|
||||
// single action is supposed to work, but it doesn't at the
|
||||
// moment. (20081215 frodo)
|
||||
QObject::connect(rendermodegroup, SIGNAL(triggered(QAction *)),
|
||||
this, SLOT(changeRenderMode(QAction *)));
|
||||
QObject::connect(rendermodegroup, &QActionGroup::triggered,
|
||||
this, &ContextMenu::changeRenderMode);
|
||||
|
||||
QObject::connect(stereomodegroup, SIGNAL(triggered(QAction *)),
|
||||
this, SLOT(changeStereoMode(QAction *)));
|
||||
QObject::connect(stereomodegroup, &QActionGroup::triggered,
|
||||
this, &ContextMenu::changeStereoMode);
|
||||
|
||||
QObject::connect(transparencytypegroup, SIGNAL(triggered(QAction *)),
|
||||
this, SLOT(changeTransparencyType(QAction *)));
|
||||
QObject::connect(transparencytypegroup, &QActionGroup::triggered,
|
||||
this, &ContextMenu::changeTransparencyType);
|
||||
}
|
||||
|
||||
ContextMenu::~ContextMenu()
|
||||
|
||||
@@ -50,8 +50,8 @@ SensorManager::SensorManager()
|
||||
this->mainthreadid = cc_thread_id();
|
||||
this->signalthread = new SignalThread();
|
||||
|
||||
QObject::connect(this->signalthread, SIGNAL(triggerSignal()),
|
||||
this, SLOT(sensorQueueChanged()));
|
||||
QObject::connect(this->signalthread, &SignalThread::triggerSignal,
|
||||
this, &SensorManager::sensorQueueChanged);
|
||||
|
||||
this->idletimer = new QTimer;
|
||||
this->delaytimer = new QTimer;
|
||||
@@ -61,9 +61,9 @@ SensorManager::SensorManager()
|
||||
this->delaytimer->setSingleShot(true);
|
||||
this->timerqueuetimer->setSingleShot(true);
|
||||
|
||||
this->connect(this->idletimer, SIGNAL(timeout(void)), this, SLOT(idleTimeout()));
|
||||
this->connect(this->delaytimer, SIGNAL(timeout(void)), this, SLOT(delayTimeout()));
|
||||
this->connect(this->timerqueuetimer, SIGNAL(timeout(void)), this, SLOT(timerQueueTimeout()));
|
||||
this->connect(this->idletimer, &QTimer::timeout, this, &SensorManager::idleTimeout);
|
||||
this->connect(this->delaytimer, &QTimer::timeout, this, &SensorManager::delayTimeout);
|
||||
this->connect(this->timerqueuetimer, &QTimer::timeout, this, &SensorManager::timerQueueTimeout);
|
||||
|
||||
SoDB::getSensorManager()->setChangedCallback(SensorManager::sensorQueueChangedCB, this);
|
||||
this->timerEpsilon = 1.0 / 5000.0;
|
||||
|
||||
@@ -100,16 +100,15 @@ SelectionView::SelectionView(Gui::Document* pcDocument, QWidget *parent)
|
||||
|
||||
resize(200, 200);
|
||||
|
||||
connect(clearButton, SIGNAL(clicked()), searchBox, SLOT(clear()));
|
||||
connect(searchBox, SIGNAL(textChanged(QString)), this, SLOT(search(QString)));
|
||||
connect(searchBox, SIGNAL(editingFinished()), this, SLOT(validateSearch()));
|
||||
connect(selectionView, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(toggleSelect(QListWidgetItem*)));
|
||||
connect(selectionView, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(preselect(QListWidgetItem*)));
|
||||
connect(pickList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(toggleSelect(QListWidgetItem*)));
|
||||
connect(pickList, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(preselect(QListWidgetItem*)));
|
||||
connect(selectionView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onItemContextMenu(QPoint)));
|
||||
connect(enablePickList, SIGNAL(stateChanged(int)), this, SLOT(onEnablePickList()));
|
||||
|
||||
connect(clearButton, &QToolButton::clicked, searchBox, &QLineEdit::clear);
|
||||
connect(searchBox, &QLineEdit::textChanged, this, &SelectionView::search);
|
||||
connect(searchBox, &QLineEdit::editingFinished, this, &SelectionView::validateSearch);
|
||||
connect(selectionView, &QListWidget::itemDoubleClicked, this, &SelectionView::toggleSelect);
|
||||
connect(selectionView, &QListWidget::itemEntered, this, &SelectionView::preselect);
|
||||
connect(pickList, &QListWidget::itemDoubleClicked, this, &SelectionView::toggleSelect);
|
||||
connect(pickList, &QListWidget::itemEntered, this, &SelectionView::preselect);
|
||||
connect(selectionView, &QListWidget::customContextMenuRequested, this, &SelectionView::onItemContextMenu);
|
||||
connect(enablePickList, &QCheckBox::stateChanged, this, &SelectionView::onEnablePickList);
|
||||
}
|
||||
|
||||
SelectionView::~SelectionView()
|
||||
|
||||
@@ -101,8 +101,8 @@ void TaskCSysDragger::setupGui()
|
||||
incrementsBox->groupLayout()->addLayout(gridLayout);
|
||||
Content.push_back(incrementsBox);
|
||||
|
||||
connect(tSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onTIncrementSlot(double)));
|
||||
connect(rSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onRIncrementSlot(double)));
|
||||
connect(tSpinBox, qOverload<double>(&QuantitySpinBox::valueChanged), this, &TaskCSysDragger::onTIncrementSlot);
|
||||
connect(rSpinBox, qOverload<double>(&QuantitySpinBox::valueChanged), this, &TaskCSysDragger::onRIncrementSlot);
|
||||
}
|
||||
|
||||
void TaskCSysDragger::onTIncrementSlot(double freshValue)
|
||||
|
||||
@@ -48,8 +48,6 @@ TaskBoxPosition::TaskBoxPosition(QWidget *parent)
|
||||
QMetaObject::connectSlotsByName(this);
|
||||
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
||||
//QObject::connect(ui->horizontalSlider_Axis1,SIGNAL(sliderMoved(int)),this,SLOT(changeSliderA1(int)));
|
||||
}
|
||||
|
||||
TaskBoxPosition::~TaskBoxPosition()
|
||||
@@ -75,8 +73,6 @@ TaskBoxAngle::TaskBoxAngle(QWidget *parent)
|
||||
QMetaObject::connectSlotsByName(this);
|
||||
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
||||
//QObject::connect(ui->horizontalSlider_Axis1,SIGNAL(sliderMoved(int)),this,SLOT(changeSliderA1(int)));
|
||||
}
|
||||
|
||||
TaskBoxAngle::~TaskBoxAngle()
|
||||
@@ -95,20 +91,6 @@ TaskBoxAngle::~TaskBoxAngle()
|
||||
TaskDlgRelocation::TaskDlgRelocation()
|
||||
: TaskDialog()
|
||||
{
|
||||
/* rob = new TaskRobot6Axis(pcRobotObject);
|
||||
ctr = new TaskRobotControl(pcRobotObject);
|
||||
|
||||
trac = new TaskTrajectory(pcRobotObject,pcTrajectoryObject);
|
||||
msg = new TaskRobotMessages(pcRobotObject);
|
||||
|
||||
|
||||
QObject::connect(trac ,SIGNAL(axisChanged(float,float,float,float,float,float,const Base::Placement &)),
|
||||
rob ,SLOT (setAxis(float,float,float,float,float,float,const Base::Placement &)));
|
||||
|
||||
Content.push_back(rob);
|
||||
Content.push_back(ctr);
|
||||
Content.push_back(trac);
|
||||
Content.push_back(msg);*/
|
||||
}
|
||||
|
||||
TaskDlgRelocation::~TaskDlgRelocation()
|
||||
@@ -121,8 +103,6 @@ TaskDlgRelocation::~TaskDlgRelocation()
|
||||
|
||||
void TaskDlgRelocation::open()
|
||||
{
|
||||
//msg->hideGroupBox();
|
||||
//ctr->hideGroupBox();
|
||||
}
|
||||
|
||||
void TaskDlgRelocation::clicked(int)
|
||||
|
||||
@@ -482,14 +482,14 @@ void TaskView::showDialog(TaskDialog *dlg)
|
||||
TaskDialogAttorney::setButtonBox(dlg, ActiveCtrl->buttonBox);
|
||||
|
||||
// make connection to the needed signals
|
||||
connect(ActiveCtrl->buttonBox,SIGNAL(accepted()),
|
||||
this,SLOT(accept()));
|
||||
connect(ActiveCtrl->buttonBox,SIGNAL(rejected()),
|
||||
this,SLOT(reject()));
|
||||
connect(ActiveCtrl->buttonBox,SIGNAL(helpRequested()),
|
||||
this,SLOT(helpRequested()));
|
||||
connect(ActiveCtrl->buttonBox,SIGNAL(clicked(QAbstractButton *)),
|
||||
this,SLOT(clicked(QAbstractButton *)));
|
||||
connect(ActiveCtrl->buttonBox, &QDialogButtonBox::accepted,
|
||||
this, &TaskView::accept);
|
||||
connect(ActiveCtrl->buttonBox, &QDialogButtonBox::rejected,
|
||||
this, &TaskView::reject);
|
||||
connect(ActiveCtrl->buttonBox, &QDialogButtonBox::helpRequested,
|
||||
this, &TaskView::helpRequested);
|
||||
connect(ActiveCtrl->buttonBox, &QDialogButtonBox::clicked,
|
||||
this, &TaskView::clicked);
|
||||
|
||||
const std::vector<QWidget*>& cont = dlg->getDialogContent();
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@ TextDocumentEditorView::TextDocumentEditorView(
|
||||
|
||||
// update editor actions on request
|
||||
Gui::MainWindow* mw = Gui::getMainWindow();
|
||||
connect(editor, SIGNAL(undoAvailable(bool)), mw, SLOT(updateEditorActions()));
|
||||
connect(editor, SIGNAL(redoAvailable(bool)), mw, SLOT(updateEditorActions()));
|
||||
connect(editor, SIGNAL(copyAvailable(bool)), mw, SLOT(updateEditorActions()));
|
||||
connect(editor, &QPlainTextEdit::undoAvailable, mw, &MainWindow::updateEditorActions);
|
||||
connect(editor, &QPlainTextEdit::redoAvailable, mw, &MainWindow::updateEditorActions);
|
||||
connect(editor, &QPlainTextEdit::copyAvailable, mw, &MainWindow::updateEditorActions);
|
||||
}
|
||||
|
||||
TextDocumentEditorView::~TextDocumentEditorView()
|
||||
@@ -97,8 +97,8 @@ bool TextDocumentEditorView::event(QEvent *event)
|
||||
|
||||
void TextDocumentEditorView::setupEditor()
|
||||
{
|
||||
connect(getEditor()->document(), SIGNAL(modificationChanged(bool)),
|
||||
this, SLOT(setWindowModified(bool)));
|
||||
connect(getEditor()->document(), &QTextDocument::modificationChanged,
|
||||
this, &TextDocumentEditorView::setWindowModified);
|
||||
setWindowTitle(QString::fromUtf8(textDocument->Label.getValue())
|
||||
+ QString::fromLatin1("[*]"));
|
||||
getEditor()->setPlainText(
|
||||
|
||||
@@ -535,8 +535,8 @@ CompletionList::CompletionList(QPlainTextEdit* parent)
|
||||
pal.setColor(QPalette::Inactive, QPalette::HighlightedText, pal.color(QPalette::Active, QPalette::HighlightedText));
|
||||
parent->setPalette( pal );
|
||||
|
||||
connect(this, SIGNAL(itemActivated(QListWidgetItem *)),
|
||||
this, SLOT(completionItem(QListWidgetItem *)));
|
||||
connect(this, &CompletionList::itemActivated,
|
||||
this, &CompletionList::completionItem);
|
||||
}
|
||||
|
||||
CompletionList::~CompletionList()
|
||||
|
||||
@@ -298,12 +298,17 @@ Transform::Transform(QWidget* parent, Qt::WindowFlags fl)
|
||||
int id = 1;
|
||||
QList<Gui::QuantitySpinBox*> sb = this->findChildren<Gui::QuantitySpinBox*>();
|
||||
for (const auto & it : sb) {
|
||||
connect(it, SIGNAL(valueChanged(double)), signalMapper, SLOT(map()));
|
||||
connect(it, qOverload<double>(&QuantitySpinBox::valueChanged), signalMapper, qOverload<>(&QSignalMapper::map));
|
||||
signalMapper->setMapping(it, id++);
|
||||
}
|
||||
|
||||
connect(signalMapper, SIGNAL(mapped(int)),
|
||||
this, SLOT(onTransformChanged(int)));
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,15,0)
|
||||
connect(signalMapper, qOverload<int>(&QSignalMapper::mapped),
|
||||
this, &Transform::onTransformChanged);
|
||||
#else
|
||||
connect(signalMapper, &QSignalMapper::mappedInt,
|
||||
this, &Transform::onTransformChanged);
|
||||
#endif
|
||||
|
||||
setTransformStrategy(new DefaultTransformStrategy(this));
|
||||
}
|
||||
|
||||
+34
-34
@@ -404,63 +404,63 @@ TreeWidget::TreeWidget(const char* name, QWidget* parent)
|
||||
|
||||
this->showHiddenAction = new QAction(this);
|
||||
this->showHiddenAction->setCheckable(true);
|
||||
connect(this->showHiddenAction, SIGNAL(triggered()),
|
||||
this, SLOT(onShowHidden()));
|
||||
connect(this->showHiddenAction, &QAction::triggered,
|
||||
this, &TreeWidget::onShowHidden);
|
||||
|
||||
this->hideInTreeAction = new QAction(this);
|
||||
this->hideInTreeAction->setCheckable(true);
|
||||
connect(this->hideInTreeAction, SIGNAL(triggered()),
|
||||
this, SLOT(onHideInTree()));
|
||||
connect(this->hideInTreeAction, &QAction::triggered,
|
||||
this, &TreeWidget::onHideInTree);
|
||||
|
||||
this->createGroupAction = new QAction(this);
|
||||
connect(this->createGroupAction, SIGNAL(triggered()),
|
||||
this, SLOT(onCreateGroup()));
|
||||
connect(this->createGroupAction, &QAction::triggered,
|
||||
this, &TreeWidget::onCreateGroup);
|
||||
|
||||
this->relabelObjectAction = new QAction(this);
|
||||
#ifndef Q_OS_MAC
|
||||
this->relabelObjectAction->setShortcut(Qt::Key_F2);
|
||||
#endif
|
||||
connect(this->relabelObjectAction, SIGNAL(triggered()),
|
||||
this, SLOT(onRelabelObject()));
|
||||
connect(this->relabelObjectAction, &QAction::triggered,
|
||||
this, &TreeWidget::onRelabelObject);
|
||||
|
||||
this->finishEditingAction = new QAction(this);
|
||||
connect(this->finishEditingAction, SIGNAL(triggered()),
|
||||
this, SLOT(onFinishEditing()));
|
||||
connect(this->finishEditingAction, &QAction::triggered,
|
||||
this, &TreeWidget::onFinishEditing);
|
||||
|
||||
this->selectDependentsAction = new QAction(this);
|
||||
connect(this->selectDependentsAction, SIGNAL(triggered()),
|
||||
this, SLOT(onSelectDependents()));
|
||||
connect(this->selectDependentsAction, &QAction::triggered,
|
||||
this, &TreeWidget::onSelectDependents);
|
||||
|
||||
this->closeDocAction = new QAction(this);
|
||||
connect(this->closeDocAction, SIGNAL(triggered()),
|
||||
this, SLOT(onCloseDoc()));
|
||||
connect(this->closeDocAction, &QAction::triggered,
|
||||
this, &TreeWidget::onCloseDoc);
|
||||
|
||||
this->reloadDocAction = new QAction(this);
|
||||
connect(this->reloadDocAction, SIGNAL(triggered()),
|
||||
this, SLOT(onReloadDoc()));
|
||||
connect(this->reloadDocAction, &QAction::triggered,
|
||||
this, &TreeWidget::onReloadDoc);
|
||||
|
||||
this->skipRecomputeAction = new QAction(this);
|
||||
this->skipRecomputeAction->setCheckable(true);
|
||||
connect(this->skipRecomputeAction, SIGNAL(toggled(bool)),
|
||||
this, SLOT(onSkipRecompute(bool)));
|
||||
connect(this->skipRecomputeAction, &QAction::toggled,
|
||||
this, &TreeWidget::onSkipRecompute);
|
||||
|
||||
this->allowPartialRecomputeAction = new QAction(this);
|
||||
this->allowPartialRecomputeAction->setCheckable(true);
|
||||
connect(this->allowPartialRecomputeAction, SIGNAL(toggled(bool)),
|
||||
this, SLOT(onAllowPartialRecompute(bool)));
|
||||
connect(this->allowPartialRecomputeAction, &QAction::toggled,
|
||||
this, &TreeWidget::onAllowPartialRecompute);
|
||||
|
||||
this->markRecomputeAction = new QAction(this);
|
||||
connect(this->markRecomputeAction, SIGNAL(triggered()),
|
||||
this, SLOT(onMarkRecompute()));
|
||||
connect(this->markRecomputeAction, &QAction::triggered,
|
||||
this, &TreeWidget::onMarkRecompute);
|
||||
|
||||
this->recomputeObjectAction = new QAction(this);
|
||||
connect(this->recomputeObjectAction, SIGNAL(triggered()),
|
||||
this, SLOT(onRecomputeObject()));
|
||||
connect(this->recomputeObjectAction, &QAction::triggered,
|
||||
this, &TreeWidget::onRecomputeObject);
|
||||
this->searchObjectsAction = new QAction(this);
|
||||
this->searchObjectsAction->setText(tr("Search..."));
|
||||
this->searchObjectsAction->setStatusTip(tr("Search for objects"));
|
||||
connect(this->searchObjectsAction, SIGNAL(triggered()),
|
||||
this, SLOT(onSearchObjects()));
|
||||
connect(this->searchObjectsAction, &QAction::triggered,
|
||||
this, &TreeWidget::onSearchObjects);
|
||||
|
||||
// Setup connections
|
||||
connectNewDocument = Application::Instance->signalNewDocument.connect(boost::bind(&TreeWidget::slotNewDocument, this, bp::_1, bp::_2));
|
||||
@@ -782,8 +782,8 @@ void TreeWidget::contextMenuEvent(QContextMenuEvent* e)
|
||||
QMenu editMenu;
|
||||
QActionGroup subMenuGroup(&subMenu);
|
||||
subMenuGroup.setExclusive(true);
|
||||
connect(&subMenuGroup, SIGNAL(triggered(QAction*)),
|
||||
this, SLOT(onActivateDocument(QAction*)));
|
||||
connect(&subMenuGroup, &QActionGroup::triggered,
|
||||
this, &TreeWidget::onActivateDocument);
|
||||
MenuManager::getInstance()->setupContextMenu(&view, contextMenu);
|
||||
|
||||
// get the current item
|
||||
@@ -3027,8 +3027,8 @@ TreePanel::TreePanel(const char* name, QWidget* parent)
|
||||
pLayout->setSpacing(0);
|
||||
pLayout->setContentsMargins(0, 0, 0, 0);
|
||||
pLayout->addWidget(this->treeWidget);
|
||||
connect(this->treeWidget, SIGNAL(emitSearchObjects()),
|
||||
this, SLOT(showEditor()));
|
||||
connect(this->treeWidget, &TreeWidget::emitSearchObjects,
|
||||
this, &TreePanel::showEditor);
|
||||
|
||||
this->searchBox = new Gui::ExpressionLineEdit(this, true);
|
||||
static_cast<ExpressionLineEdit*>(this->searchBox)->setExactMatch(Gui::ExpressionParameter::instance()->isExactMatch());
|
||||
@@ -3036,10 +3036,10 @@ TreePanel::TreePanel(const char* name, QWidget* parent)
|
||||
this->searchBox->hide();
|
||||
this->searchBox->installEventFilter(this);
|
||||
this->searchBox->setPlaceholderText(tr("Search"));
|
||||
connect(this->searchBox, SIGNAL(returnPressed()),
|
||||
this, SLOT(accept()));
|
||||
connect(this->searchBox, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(itemSearch(QString)));
|
||||
connect(this->searchBox, &QLineEdit::returnPressed,
|
||||
this, &TreePanel::accept);
|
||||
connect(this->searchBox, &QLineEdit::textChanged,
|
||||
this, &TreePanel::itemSearch);
|
||||
}
|
||||
|
||||
TreePanel::~TreePanel()
|
||||
|
||||
@@ -230,14 +230,14 @@ VectorListEditor::VectorListEditor(int decimals, QWidget* parent)
|
||||
|
||||
ui->toolButtonMouse->setDisabled(true);
|
||||
|
||||
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &VectorListEditor::accept);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &VectorListEditor::reject);
|
||||
|
||||
connect(ui->spinBox, SIGNAL(valueChanged(int)), this, SLOT(setCurrentRow(int)));
|
||||
connect(ui->toolButtonAdd, SIGNAL(clicked(bool)), this, SLOT(addRow()));
|
||||
connect(ui->toolButtonRemove, SIGNAL(clicked(bool)), this, SLOT(removeRow()));
|
||||
connect(ui->toolButtonAccept, SIGNAL(clicked(bool)), this, SLOT(acceptCurrent()));
|
||||
connect(ui->tableWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(clickedRow(QModelIndex)));
|
||||
connect(ui->spinBox, qOverload<int>(&QSpinBox::valueChanged), this, &VectorListEditor::setCurrentRow);
|
||||
connect(ui->toolButtonAdd, &QToolButton::clicked, this, &VectorListEditor::addRow);
|
||||
connect(ui->toolButtonRemove, &QToolButton::clicked, this, &VectorListEditor::removeRow);
|
||||
connect(ui->toolButtonAccept, &QToolButton::clicked, this, &VectorListEditor::acceptCurrent);
|
||||
connect(ui->tableWidget, &QTableView::clicked, this, &VectorListEditor::clickedRow);
|
||||
}
|
||||
|
||||
VectorListEditor::~VectorListEditor()
|
||||
|
||||
@@ -172,7 +172,7 @@ View3DInventor::View3DInventor(Gui::Document* pcDocument, QWidget* parent,
|
||||
OnChange(*hGrp,"TransparentObjectRenderType");
|
||||
|
||||
stopSpinTimer = new QTimer(this);
|
||||
connect(stopSpinTimer, SIGNAL(timeout()), this, SLOT(stopAnimating()));
|
||||
connect(stopSpinTimer, &QTimer::timeout, this, &View3DInventor::stopAnimating);
|
||||
}
|
||||
|
||||
View3DInventor::~View3DInventor()
|
||||
@@ -501,8 +501,8 @@ void View3DInventor::printPreview()
|
||||
restorePrinterSettings(&printer);
|
||||
|
||||
QPrintPreviewDialog dlg(&printer, this);
|
||||
connect(&dlg, SIGNAL(paintRequested (QPrinter *)),
|
||||
this, SLOT(print(QPrinter *)));
|
||||
connect(&dlg, &QPrintPreviewDialog::paintRequested,
|
||||
this, qOverload<QPrinter*>(&View3DInventor::print));
|
||||
dlg.exec();
|
||||
savePrinterSettings(&printer);
|
||||
}
|
||||
|
||||
@@ -2635,7 +2635,7 @@ void View3DInventorViewer::moveCameraTo(const SbRotation& rot, const SbVec3f& po
|
||||
anim.setEndValue(steps);
|
||||
|
||||
QEventLoop loop;
|
||||
QObject::connect(&anim, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
QObject::connect(&anim, &CameraAnimation::finished, &loop, &QEventLoop::quit);
|
||||
anim.start();
|
||||
loop.exec(QEventLoop::ExcludeUserInputEvents);
|
||||
|
||||
@@ -2693,7 +2693,7 @@ void View3DInventorViewer::animatedViewAll(int steps, int ms)
|
||||
QEventLoop loop;
|
||||
QTimer timer;
|
||||
timer.setSingleShot(true);
|
||||
QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
|
||||
QObject::connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit);
|
||||
|
||||
for (int i=0; i<steps; i++) {
|
||||
float s = float(i)/float(steps);
|
||||
|
||||
@@ -377,8 +377,8 @@ ContainerDialog::ContainerDialog( QWidget* templChild )
|
||||
resize( QSize(307, 197).expandedTo(minimumSizeHint()) );
|
||||
|
||||
// signals and slots connections
|
||||
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
|
||||
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
|
||||
connect( buttonOk, &QPushButton::clicked, this, &QDialog::accept);
|
||||
connect( buttonCancel, &QPushButton::clicked, this, &QDialog::reject);
|
||||
}
|
||||
|
||||
/** Destroys the object and frees any allocated resources */
|
||||
|
||||
+9
-9
@@ -67,8 +67,8 @@ using namespace Base;
|
||||
CommandIconView::CommandIconView ( QWidget * parent )
|
||||
: QListWidget(parent)
|
||||
{
|
||||
connect(this, SIGNAL (currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
|
||||
this, SLOT (onSelectionChanged(QListWidgetItem *, QListWidgetItem *)) );
|
||||
connect(this, &QListWidget::currentItemChanged,
|
||||
this, &CommandIconView::onSelectionChanged);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -653,7 +653,7 @@ ColorButton::ColorButton(QWidget* parent)
|
||||
{
|
||||
d = new ColorButtonP();
|
||||
d->col = palette().color(QPalette::Active,QPalette::Midlight);
|
||||
connect(this, SIGNAL(clicked()), SLOT(onChooseColor()));
|
||||
connect(this, &ColorButton::clicked, this, &ColorButton::onChooseColor);
|
||||
|
||||
int e = style()->pixelMetric(QStyle::PM_ButtonIconSize);
|
||||
setIconSize(QSize(2*e, e));
|
||||
@@ -1254,7 +1254,7 @@ void StatusWidget::showText(int ms)
|
||||
show();
|
||||
QTimer timer;
|
||||
QEventLoop loop;
|
||||
QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
|
||||
QObject::connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit);
|
||||
timer.start(ms);
|
||||
loop.exec(QEventLoop::ExcludeUserInputEvents);
|
||||
hide();
|
||||
@@ -1451,8 +1451,8 @@ LabelEditor::LabelEditor (QWidget * parent)
|
||||
lineEdit = new QLineEdit(this);
|
||||
layout->addWidget(lineEdit);
|
||||
|
||||
connect(lineEdit, SIGNAL(textChanged(const QString &)),
|
||||
this, SLOT(validateText(const QString &)));
|
||||
connect(lineEdit, &QLineEdit::textChanged,
|
||||
this, &LabelEditor::validateText);
|
||||
|
||||
button = new QPushButton(QLatin1String("..."), this);
|
||||
#if defined (Q_OS_MAC)
|
||||
@@ -1460,7 +1460,7 @@ LabelEditor::LabelEditor (QWidget * parent)
|
||||
#endif
|
||||
layout->addWidget(button);
|
||||
|
||||
connect(button, SIGNAL(clicked()), this, SLOT(changeText()));
|
||||
connect(button, &QPushButton::clicked, this, &LabelEditor::changeText);
|
||||
|
||||
setFocusProxy(lineEdit);
|
||||
}
|
||||
@@ -1556,7 +1556,7 @@ ExpLineEdit::ExpLineEdit(QWidget* parent, bool expressionOnly)
|
||||
{
|
||||
makeLabel(this);
|
||||
|
||||
QObject::connect(iconLabel, SIGNAL(clicked()), this, SLOT(openFormulaDialog()));
|
||||
QObject::connect(iconLabel, &ExpressionLabel::clicked, this, &ExpLineEdit::openFormulaDialog);
|
||||
if (expressionOnly)
|
||||
QMetaObject::invokeMethod(this, "openFormulaDialog", Qt::QueuedConnection, QGenericReturnArgument());
|
||||
}
|
||||
@@ -1673,7 +1673,7 @@ void ExpLineEdit::openFormulaDialog()
|
||||
|
||||
auto box = new Gui::Dialog::DlgExpressionInput(
|
||||
getPath(), getExpression(),Unit(), this);
|
||||
connect(box, SIGNAL(finished(int)), this, SLOT(finishFormulaDialog()));
|
||||
connect(box, &Dialog::DlgExpressionInput::finished, this, &ExpLineEdit::finishFormulaDialog);
|
||||
box->show();
|
||||
|
||||
QPoint pos = mapToGlobal(QPoint(0,0));
|
||||
|
||||
@@ -1567,7 +1567,7 @@ VectorListWidget::VectorListWidget(int decimals, QWidget *parent)
|
||||
: PropertyEditorWidget(parent)
|
||||
, decimals(decimals)
|
||||
{
|
||||
connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()));
|
||||
connect(button, &QPushButton::clicked, this, &VectorListWidget::buttonClicked);
|
||||
}
|
||||
|
||||
void VectorListWidget::buttonClicked()
|
||||
@@ -2483,8 +2483,8 @@ void PlacementEditor::browse()
|
||||
}
|
||||
if (!_task) {
|
||||
_task = task;
|
||||
connect(task, SIGNAL(placementChanged(const QVariant &, bool, bool)),
|
||||
this, SLOT(updateValue(const QVariant&, bool, bool)));
|
||||
connect(task, &TaskPlacement::placementChanged,
|
||||
this, &PlacementEditor::updateValue);
|
||||
}
|
||||
task->setPlacement(value().value<Base::Placement>());
|
||||
task->setPropertyName(propertyname);
|
||||
@@ -4319,10 +4319,10 @@ LinkLabel::LinkLabel (QWidget * parent, const App::Property *prop)
|
||||
|
||||
// setLayout(layout);
|
||||
|
||||
connect(label, SIGNAL(linkActivated(const QString&)),
|
||||
this, SLOT(onLinkActivated(const QString&)));
|
||||
connect(editButton, SIGNAL(clicked()),
|
||||
this, SLOT(onEditClicked()));
|
||||
connect(label, &QLabel::linkActivated,
|
||||
this, &LinkLabel::onLinkActivated);
|
||||
connect(editButton, &QPushButton::clicked,
|
||||
this, &LinkLabel::onEditClicked);
|
||||
}
|
||||
|
||||
LinkLabel::~LinkLabel()
|
||||
|
||||
Reference in New Issue
Block a user