Gui: fix -Wclazy-connect-by-name

This commit is contained in:
wmayer
2023-04-03 16:40:22 +02:00
committed by wwmayer
parent ad29f1628a
commit 457fac38dd
24 changed files with 262 additions and 123 deletions

View File

@@ -106,6 +106,8 @@ Clipping::Clipping(Gui::View3DInventor* view, QWidget* parent)
{
// create widgets
d->ui.setupUi(this);
setupConnections();
d->ui.clipView->setRange(-INT_MAX,INT_MAX);
d->ui.clipView->setSingleStep(0.1f);
d->ui.clipX->setRange(-INT_MAX,INT_MAX);
@@ -207,6 +209,42 @@ Clipping::~Clipping()
delete d;
}
void Clipping::setupConnections()
{
connect(d->ui.groupBoxX, &QGroupBox::toggled,
this, &Clipping::onGroupBoxXToggled);
connect(d->ui.groupBoxY, &QGroupBox::toggled,
this, &Clipping::onGroupBoxYToggled);
connect(d->ui.groupBoxZ, &QGroupBox::toggled,
this, &Clipping::onGroupBoxZToggled);
connect(d->ui.clipX, qOverload<double>(&QDoubleSpinBox::valueChanged),
this, &Clipping::onClipXValueChanged);
connect(d->ui.clipY, qOverload<double>(&QDoubleSpinBox::valueChanged),
this, &Clipping::onClipYValueChanged);
connect(d->ui.clipZ, qOverload<double>(&QDoubleSpinBox::valueChanged),
this, &Clipping::onClipZValueChanged);
connect(d->ui.flipClipX, &QPushButton::clicked,
this, &Clipping::onFlipClipXClicked);
connect(d->ui.flipClipY, &QPushButton::clicked,
this, &Clipping::onFlipClipYClicked);
connect(d->ui.flipClipZ, &QPushButton::clicked,
this, &Clipping::onFlipClipZClicked);
connect(d->ui.groupBoxView, &QGroupBox::toggled,
this, &Clipping::onGroupBoxViewToggled);
connect(d->ui.clipView, qOverload<double>(&QDoubleSpinBox::valueChanged),
this, &Clipping::onClipViewValueChanged);
connect(d->ui.fromView, &QPushButton::clicked,
this, &Clipping::onFromViewClicked);
connect(d->ui.adjustViewdirection, &QCheckBox::toggled,
this, &Clipping::onAdjustViewdirectionToggled);
connect(d->ui.dirX, qOverload<double>(&QDoubleSpinBox::valueChanged),
this, &Clipping::onDirXValueChanged);
connect(d->ui.dirY, qOverload<double>(&QDoubleSpinBox::valueChanged),
this, &Clipping::onDirYValueChanged);
connect(d->ui.dirZ, qOverload<double>(&QDoubleSpinBox::valueChanged),
this, &Clipping::onDirZValueChanged);
}
void Clipping::reject()
{
QDialog::reject();
@@ -216,7 +254,7 @@ void Clipping::reject()
}
}
void Clipping::on_groupBoxX_toggled(bool on)
void Clipping::onGroupBoxXToggled(bool on)
{
if (on) {
d->ui.groupBoxView->setChecked(false);
@@ -225,7 +263,7 @@ void Clipping::on_groupBoxX_toggled(bool on)
d->clipX->on.setValue(on);
}
void Clipping::on_groupBoxY_toggled(bool on)
void Clipping::onGroupBoxYToggled(bool on)
{
if (on) {
d->ui.groupBoxView->setChecked(false);
@@ -234,7 +272,7 @@ void Clipping::on_groupBoxY_toggled(bool on)
d->clipY->on.setValue(on);
}
void Clipping::on_groupBoxZ_toggled(bool on)
void Clipping::onGroupBoxZToggled(bool on)
{
if (on) {
d->ui.groupBoxView->setChecked(false);
@@ -243,46 +281,46 @@ void Clipping::on_groupBoxZ_toggled(bool on)
d->clipZ->on.setValue(on);
}
void Clipping::on_clipX_valueChanged(double val)
void Clipping::onClipXValueChanged(double val)
{
SbPlane pln = d->clipX->plane.getValue();
d->clipX->plane.setValue(SbPlane(pln.getNormal(),d->flipX ? -val : val));
}
void Clipping::on_clipY_valueChanged(double val)
void Clipping::onClipYValueChanged(double val)
{
SbPlane pln = d->clipY->plane.getValue();
d->clipY->plane.setValue(SbPlane(pln.getNormal(),d->flipY ? -val : val));
}
void Clipping::on_clipZ_valueChanged(double val)
void Clipping::onClipZValueChanged(double val)
{
SbPlane pln = d->clipZ->plane.getValue();
d->clipZ->plane.setValue(SbPlane(pln.getNormal(),d->flipZ ? -val : val));
}
void Clipping::on_flipClipX_clicked()
void Clipping::onFlipClipXClicked()
{
d->flipX = !d->flipX;
SbPlane pln = d->clipX->plane.getValue();
d->clipX->plane.setValue(SbPlane(-pln.getNormal(),-pln.getDistanceFromOrigin()));
}
void Clipping::on_flipClipY_clicked()
void Clipping::onFlipClipYClicked()
{
d->flipY = !d->flipY;
SbPlane pln = d->clipY->plane.getValue();
d->clipY->plane.setValue(SbPlane(-pln.getNormal(),-pln.getDistanceFromOrigin()));
}
void Clipping::on_flipClipZ_clicked()
void Clipping::onFlipClipZClicked()
{
d->flipZ = !d->flipZ;
SbPlane pln = d->clipZ->plane.getValue();
d->clipZ->plane.setValue(SbPlane(-pln.getNormal(),-pln.getDistanceFromOrigin()));
}
void Clipping::on_groupBoxView_toggled(bool on)
void Clipping::onGroupBoxViewToggled(bool on)
{
if (on) {
d->ui.groupBoxX->setChecked(false);
@@ -293,13 +331,13 @@ void Clipping::on_groupBoxView_toggled(bool on)
d->clipView->on.setValue(on);
}
void Clipping::on_clipView_valueChanged(double val)
void Clipping::onClipViewValueChanged(double val)
{
SbPlane pln = d->clipView->plane.getValue();
d->clipView->plane.setValue(SbPlane(pln.getNormal(),val));
}
void Clipping::on_fromView_clicked()
void Clipping::onFromViewClicked()
{
if (d->view) {
Gui::View3DInventorViewer* view = d->view->getViewer();
@@ -309,7 +347,7 @@ void Clipping::on_fromView_clicked()
}
}
void Clipping::on_adjustViewdirection_toggled(bool on)
void Clipping::onAdjustViewdirectionToggled(bool on)
{
d->ui.dirX->setDisabled(on);
d->ui.dirY->setDisabled(on);
@@ -322,7 +360,7 @@ void Clipping::on_adjustViewdirection_toggled(bool on)
d->sensor->unschedule();
}
void Clipping::on_dirX_valueChanged(double)
void Clipping::onDirXValueChanged(double)
{
double x = d->ui.dirX->value();
double y = d->ui.dirY->value();
@@ -334,7 +372,7 @@ void Clipping::on_dirX_valueChanged(double)
d->clipView->plane.setValue(SbPlane(normal,pln.getDistanceFromOrigin()));
}
void Clipping::on_dirY_valueChanged(double)
void Clipping::onDirYValueChanged(double)
{
double x = d->ui.dirX->value();
double y = d->ui.dirY->value();
@@ -346,7 +384,7 @@ void Clipping::on_dirY_valueChanged(double)
d->clipView->plane.setValue(SbPlane(normal,pln.getDistanceFromOrigin()));
}
void Clipping::on_dirZ_valueChanged(double)
void Clipping::onDirZValueChanged(double)
{
double x = d->ui.dirX->value();
double y = d->ui.dirY->value();

View File

@@ -25,6 +25,7 @@
#define GUI_DIALOG_CLIPPING_H
#include <QDialog>
#include <FCGlobal.h>
namespace Gui {
class View3DInventor;
@@ -42,23 +43,24 @@ public:
Clipping(Gui::View3DInventor* view, QWidget* parent = nullptr);
~Clipping();
protected Q_SLOTS:
void on_groupBoxX_toggled(bool);
void on_groupBoxY_toggled(bool);
void on_groupBoxZ_toggled(bool);
void on_clipX_valueChanged(double);
void on_clipY_valueChanged(double);
void on_clipZ_valueChanged(double);
void on_flipClipX_clicked();
void on_flipClipY_clicked();
void on_flipClipZ_clicked();
void on_groupBoxView_toggled(bool);
void on_clipView_valueChanged(double);
void on_fromView_clicked();
void on_adjustViewdirection_toggled(bool);
void on_dirX_valueChanged(double);
void on_dirY_valueChanged(double);
void on_dirZ_valueChanged(double);
protected:
void setupConnections();
void onGroupBoxXToggled(bool);
void onGroupBoxYToggled(bool);
void onGroupBoxZToggled(bool);
void onClipXValueChanged(double);
void onClipYValueChanged(double);
void onClipZValueChanged(double);
void onFlipClipXClicked();
void onFlipClipYClicked();
void onFlipClipZClicked();
void onGroupBoxViewToggled(bool);
void onClipViewValueChanged(double);
void onFromViewClicked();
void onAdjustViewdirectionToggled(bool);
void onDirXValueChanged(double);
void onDirYValueChanged(double);
void onDirZValueChanged(double);
public:
void reject();

View File

@@ -47,6 +47,7 @@ DemoMode::DemoMode(QWidget* /*parent*/, Qt::WindowFlags fl)
{
// create widgets
ui->setupUi(this);
setupConnections();
ui->playButton->setCheckable(true);
timer = new QTimer(this);
@@ -66,9 +67,25 @@ DemoMode::~DemoMode()
delete ui;
}
void DemoMode::setupConnections()
{
connect(ui->playButton, &QPushButton::clicked,
this, &DemoMode::onPlayButtonToggled);
connect(ui->fullscreen, &QCheckBox::toggled,
this, &DemoMode::onFullscreenToggled);
connect(ui->timerCheck, &QCheckBox::toggled,
this, &DemoMode::onTimerCheckToggled);
connect(ui->speedSlider, &QSlider::valueChanged,
this, &DemoMode::onSpeedSliderValueChanged);
connect(ui->angleSlider, &QSlider::valueChanged,
this, &DemoMode::onAngleSliderValueChanged);
connect(ui->timeout, qOverload<int>(&QSpinBox::valueChanged),
this, &DemoMode::onTimeoutValueChanged);
}
void DemoMode::reset()
{
on_fullscreen_toggled(false);
onFullscreenToggled(false);
Gui::View3DInventor* view = activeView();
if (view)
view->getViewer()->stopAnimating();
@@ -152,7 +169,7 @@ SbVec3f DemoMode::getDirection(Gui::View3DInventor* view) const
return vec;
}
void DemoMode::on_angleSlider_valueChanged(int v)
void DemoMode::onAngleSliderValueChanged(int v)
{
Gui::View3DInventor* view = activeView();
if (view) {
@@ -185,7 +202,7 @@ void DemoMode::reorientCamera(SoCamera * cam, const SbRotation & rot)
cam->position = focalpoint - cam->focalDistance.getValue() * direction;
}
void DemoMode::on_speedSlider_valueChanged(int v)
void DemoMode::onSpeedSliderValueChanged(int v)
{
Q_UNUSED(v);
Gui::View3DInventor* view = activeView();
@@ -194,7 +211,7 @@ void DemoMode::on_speedSlider_valueChanged(int v)
}
}
void DemoMode::on_playButton_toggled(bool pressed)
void DemoMode::onPlayButtonToggled(bool pressed)
{
Gui::View3DInventor* view = activeView();
if (view) {
@@ -218,7 +235,7 @@ void DemoMode::on_playButton_toggled(bool pressed)
}
}
void DemoMode::on_fullscreen_toggled(bool on)
void DemoMode::onFullscreenToggled(bool on)
{
Gui::View3DInventor* view = activeView();
if (view) {
@@ -238,7 +255,7 @@ void DemoMode::on_fullscreen_toggled(bool on)
}
}
void DemoMode::on_timeout_valueChanged(int v)
void DemoMode::onTimeoutValueChanged(int v)
{
timer->setInterval(v * 1000);
}
@@ -259,7 +276,7 @@ void DemoMode::startAnimation(Gui::View3DInventor* view)
getSpeed(ui->speedSlider->value()));
}
void DemoMode::on_timerCheck_toggled(bool on)
void DemoMode::onTimerCheckToggled(bool on)
{
if (on)
timer->start();

View File

@@ -24,10 +24,12 @@
#define GUI_DIALOG_DEMOMODE_H
#include <QDialog>
#include <FCGlobal.h>
class QTimer;
class SoCamera;
class SbVec3f;
class SbRotation;
namespace Gui {
@@ -49,13 +51,14 @@ public:
void accept();
void reject();
protected Q_SLOTS:
void on_playButton_toggled(bool);
void on_fullscreen_toggled(bool);
void on_timerCheck_toggled(bool);
void on_speedSlider_valueChanged(int);
void on_angleSlider_valueChanged(int);
void on_timeout_valueChanged(int);
protected:
void setupConnections();
void onPlayButtonToggled(bool);
void onFullscreenToggled(bool);
void onTimerCheckToggled(bool);
void onSpeedSliderValueChanged(int);
void onAngleSliderValueChanged(int);
void onTimeoutValueChanged(int);
void onAutoPlay();
private:

View File

@@ -97,7 +97,7 @@ void DlgOnlineHelpImp::changeEvent(QEvent *e)
}
}
void DlgOnlineHelpImp::on_lineEditDownload_fileNameSelected( const QString& url )
void DlgOnlineHelpImp::onLineEditDownloadFileNameSelected( const QString& url )
{
QDir dir(url);
if (dir.exists() && dir.count() == 0) {

View File

@@ -53,7 +53,7 @@ protected:
void changeEvent(QEvent *e) override;
protected:
void on_lineEditDownload_fileNameSelected(const QString&);
void onLineEditDownloadFileNameSelected(const QString&);
private:
std::unique_ptr<Ui_DlgOnlineHelp> ui;

View File

@@ -175,6 +175,8 @@ DocumentRecovery::DocumentRecovery(const QList<QFileInfo>& dirs, QWidget* parent
: QDialog(parent), d_ptr(new DocumentRecoveryPrivate())
{
d_ptr->ui.setupUi(this);
connect(d_ptr->ui.buttonCleanup, &QPushButton::clicked,
this, &DocumentRecovery::onButtonCleanupClicked);
d_ptr->ui.buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Start Recovery"));
d_ptr->ui.treeWidget->header()->setSectionResizeMode(QHeaderView::Stretch);
@@ -535,7 +537,7 @@ void DocumentRecovery::onDeleteSection()
}
}
void DocumentRecovery::on_buttonCleanup_clicked()
void DocumentRecovery::onButtonCleanupClicked()
{
QMessageBox msgBox(this);
msgBox.setIcon(QMessageBox::Warning);

View File

@@ -55,8 +55,8 @@ protected:
QString createProjectFile(const QString&);
void cleanup(QDir&, const QList<QFileInfo>&, const QString&);
protected Q_SLOTS:
void on_buttonCleanup_clicked();
protected:
void onButtonCleanupClicked();
void onDeleteSection();
private:

View File

@@ -75,7 +75,7 @@ LocationWidget::LocationWidget (QWidget * parent)
gridLayout->addLayout(box, 0, 0, 1, 2);
connect(dValue, qOverload<int>(&QComboBox::activated),
this, &LocationWidget::on_direction_activated);
this, &LocationWidget::onDirectionActivated);
retranslateUi();
}
@@ -202,7 +202,7 @@ Base::Vector3d LocationWidget::getUserDirection(bool* ok) const
return dir;
}
void LocationWidget::on_direction_activated(int index)
void LocationWidget::onDirectionActivated(int index)
{
// last item is selected to define direction by user
if (index+1 == dValue->count()) {
@@ -253,7 +253,7 @@ Base::Vector3d LocationDialog::getUserDirection(bool* ok) const
return dir;
}
void LocationDialog::on_direction_activated(int index)
void LocationDialog::onDirectionActivated(int index)
{
directionActivated(index);
}

View File

@@ -52,8 +52,8 @@ public:
Base::Vector3d getDirection() const;
Base::Vector3d getUserDirection(bool* ok=nullptr) const;
private Q_SLOTS:
void on_direction_activated(int);
private:
void onDirectionActivated(int);
private:
void changeEvent(QEvent*) override;
@@ -86,8 +86,8 @@ protected:
protected:
void changeEvent(QEvent *e) override = 0;
private Q_SLOTS:
void on_direction_activated(int);
private:
void onDirectionActivated(int);
public:
virtual Base::Vector3d getDirection() const = 0;

View File

@@ -135,6 +135,8 @@ DlgInspector::DlgInspector(QWidget* parent, Qt::WindowFlags fl)
: QDialog(parent, fl), ui(new Ui_SceneInspector())
{
ui->setupUi(this);
connect(ui->refreshButton, &QPushButton::clicked,
this, &DlgInspector::onRefreshButtonClicked);
setWindowTitle(tr("Scene Inspector"));
auto model = new SceneModel(this);
@@ -208,7 +210,7 @@ void DlgInspector::changeEvent(QEvent *e)
QDialog::changeEvent(e);
}
void DlgInspector::on_refreshButton_clicked()
void DlgInspector::onRefreshButtonClicked()
{
Gui::Document* doc = Application::Instance->activeDocument();
if (doc) {

View File

@@ -76,8 +76,8 @@ public:
void setDocument(Gui::Document* doc);
private Q_SLOTS:
void on_refreshButton_clicked();
private:
void onRefreshButtonClicked();
protected:
void changeEvent(QEvent *e) override;

View File

@@ -243,6 +243,8 @@ AboutDialog::AboutDialog(bool showLic, QWidget* parent)
setModal(true);
ui->setupUi(this);
connect(ui->copyButton, &QPushButton::clicked,
this, &AboutDialog::copyToClipboard);
// remove the automatic help button in dialog title since we don't use it
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
@@ -718,7 +720,7 @@ void AboutDialog::linkActivated(const QUrl& link)
licenseView->setSource(link);
}
void AboutDialog::on_copyButton_clicked()
void AboutDialog::copyToClipboard()
{
QString data;
QTextStream str(&data);

View File

@@ -107,8 +107,8 @@ protected:
void showCollectionInformation();
void showOrHideImage(const QRect& rect);
protected Q_SLOTS:
virtual void on_copyButton_clicked();
protected:
virtual void copyToClipboard();
void linkActivated(const QUrl& link);
private:

View File

@@ -313,18 +313,22 @@ ElementColors::ElementColors(ViewProviderDocumentObject* vp, bool noHide)
:d(new Private(vp))
{
d->ui->setupUi(this);
setupConnections();
d->ui->objectLabel->setText(QString::fromUtf8(vp->getObject()->Label.getValue()));
d->ui->elementList->setMouseTracking(true); // needed for itemEntered() to work
if(noHide)
if (noHide) {
d->ui->hideSelection->setVisible(false);
}
ParameterGrp::handle hPart = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/View");
d->ui->recompute->setChecked(hPart->GetBool("ColorRecompute",true));
d->ui->onTop->setChecked(hPart->GetBool("ColorOnTop",true));
if(d->ui->onTop->isChecked())
if (d->ui->onTop->isChecked()) {
d->vpParent->OnTopWhenSelected.setValue(3);
}
Selection().addSelectionGate(d, ResolveMode::NoResolve);
@@ -343,13 +347,39 @@ ElementColors::~ElementColors()
Selection().rmvSelectionGate();
}
void ElementColors::on_recompute_clicked(bool checked) {
void ElementColors::setupConnections()
{
connect(d->ui->removeSelection, &QPushButton::clicked,
this, &ElementColors::onRemoveSelectionClicked);
connect(d->ui->addSelection, &QPushButton::clicked,
this, &ElementColors::onAddSelectionClicked);
connect(d->ui->removeAll, &QPushButton::clicked,
this, &ElementColors::onRemoveAllClicked);
connect(d->ui->elementList, &QListWidget::itemDoubleClicked,
this, &ElementColors::onElementListItemDoubleClicked);
connect(d->ui->elementList, &QListWidget::itemSelectionChanged,
this, &ElementColors::onElementListItemSelectionChanged);
connect(d->ui->elementList, &QListWidget::itemEntered,
this, &ElementColors::onElementListItemEntered);
connect(d->ui->recompute, &QCheckBox::clicked,
this, &ElementColors::onRecomputeClicked);
connect(d->ui->onTop, &QCheckBox::clicked,
this, &ElementColors::onTopClicked);
connect(d->ui->hideSelection, &QPushButton::clicked,
this, &ElementColors::onHideSelectionClicked);
connect(d->ui->boxSelect, &QPushButton::clicked,
this, &ElementColors::onBoxSelectClicked);
}
void ElementColors::onRecomputeClicked(bool checked)
{
ParameterGrp::handle hPart = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/View");
hPart->SetBool("ColorRecompute",checked);
}
void ElementColors::on_onTop_clicked(bool checked) {
void ElementColors::onTopClicked(bool checked)
{
ParameterGrp::handle hPart = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/View");
hPart->SetBool("ColorOnTop",checked);
@@ -368,19 +398,19 @@ void ElementColors::slotDeleteObject(const ViewProvider& obj)
Control().closeDialog();
}
void ElementColors::on_removeSelection_clicked()
void ElementColors::onRemoveSelectionClicked()
{
d->removeItems();
}
void ElementColors::on_boxSelect_clicked()
void ElementColors::onBoxSelectClicked()
{
auto cmd = Application::Instance->commandManager().getCommandByName("Std_BoxElementSelection");
if(cmd)
cmd->invoke(0);
}
void ElementColors::on_hideSelection_clicked() {
void ElementColors::onHideSelectionClicked() {
auto sels = Selection().getSelectionEx(d->editDoc.c_str(), App::DocumentObject::getClassTypeId(), ResolveMode::NoResolve);
for(auto &sel : sels) {
if(d->editObj!=sel.getFeatName())
@@ -400,7 +430,7 @@ void ElementColors::on_hideSelection_clicked() {
}
}
void ElementColors::on_addSelection_clicked()
void ElementColors::onAddSelectionClicked()
{
auto sels = Selection().getSelectionEx(d->editDoc.c_str(), App::DocumentObject::getClassTypeId(), ResolveMode::NoResolve);
d->items.clear();
@@ -440,7 +470,7 @@ void ElementColors::on_addSelection_clicked()
}
}
void ElementColors::on_removeAll_clicked()
void ElementColors::onRemoveAllClicked()
{
d->removeAll();
}
@@ -476,7 +506,7 @@ void ElementColors::leaveEvent(QEvent *e) {
}
}
void ElementColors::on_elementList_itemEntered(QListWidgetItem *item) {
void ElementColors::onElementListItemEntered(QListWidgetItem *item) {
std::string name(qPrintable(item->data(Qt::UserRole+1).value<QString>()));
if(!d->hiddenSub.empty()) {
d->vp->partialRender({d->hiddenSub},false);
@@ -493,7 +523,7 @@ void ElementColors::on_elementList_itemEntered(QListWidgetItem *item) {
: Gui::SelectionChanges::MsgSource::Internal);
}
void ElementColors::on_elementList_itemSelectionChanged() {
void ElementColors::onElementListItemSelectionChanged() {
d->onSelectionChanged();
}
@@ -502,7 +532,7 @@ void ElementColors::onSelectionChanged(const SelectionChanges& msg)
d->onSelectionChanged(msg);
}
void ElementColors::on_elementList_itemDoubleClicked(QListWidgetItem *item) {
void ElementColors::onElementListItemDoubleClicked(QListWidgetItem *item) {
d->editItem(this,item);
}

View File

@@ -44,17 +44,18 @@ public:
bool accept();
bool reject();
private Q_SLOTS:
void on_removeSelection_clicked();
void on_addSelection_clicked();
void on_removeAll_clicked();
void on_elementList_itemDoubleClicked(QListWidgetItem *item);
void on_elementList_itemSelectionChanged();
void on_elementList_itemEntered(QListWidgetItem *item);
void on_recompute_clicked(bool checked);
void on_onTop_clicked(bool checked);
void on_hideSelection_clicked();
void on_boxSelect_clicked();
private:
void setupConnections();
void onRemoveSelectionClicked();
void onAddSelectionClicked();
void onRemoveAllClicked();
void onElementListItemDoubleClicked(QListWidgetItem *item);
void onElementListItemSelectionChanged();
void onElementListItemEntered(QListWidgetItem *item);
void onRecomputeClicked(bool checked);
void onTopClicked(bool checked);
void onHideSelectionClicked();
void onBoxSelectClicked();
protected:
void onSelectionChanged(const SelectionChanges& msg) override;

View File

@@ -46,6 +46,8 @@ TaskAppearance::TaskAppearance(QWidget *parent)
proxy = new QWidget(this);
ui = new Ui_TaskAppearance();
ui->setupUi(proxy);
setupConnections();
ui->textLabel1_3->hide();
ui->changePlot->hide();
QMetaObject::connectSlotsByName(this);
@@ -65,6 +67,27 @@ TaskAppearance::~TaskAppearance()
Gui::Selection().Detach(this);
}
void TaskAppearance::setupConnections()
{
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
connect(ui->changeMode, qOverload<const QString&>(&QComboBox::activated),
this, &TaskAppearance::onChangeModeActivated);
connect(ui->changePlot, qOverload<const QString&>(&QComboBox::activated),
this, &TaskAppearance::onChangePlotActivated);
#else
connect(ui->changeMode, &QComboBox::textActivated,
this, &TaskAppearance::onChangeModeActivated);
connect(ui->changePlot, &QComboBox::textActivated,
this, &TaskAppearance::onChangePlotActivated);
#endif
connect(ui->spinTransparency, qOverload<int>(&QSpinBox::valueChanged),
this, &TaskAppearance::onTransparencyValueChanged);
connect(ui->spinPointSize, qOverload<int>(&QSpinBox::valueChanged),
this, &TaskAppearance::onPointSizeValueChanged);
connect(ui->spinLineWidth, qOverload<int>(&QSpinBox::valueChanged),
this, &TaskAppearance::onLineWidthValueChanged);
}
void TaskAppearance::changeEvent(QEvent *e)
{
TaskBox::changeEvent(e);
@@ -132,7 +155,7 @@ void TaskAppearance::slotChangedObject(const Gui::ViewProvider& obj,
/**
* Sets the 'Display' property of all selected view providers.
*/
void TaskAppearance::on_changeMode_activated(const QString& s)
void TaskAppearance::onChangeModeActivated(const QString& s)
{
Gui::WaitCursor wc;
std::vector<Gui::ViewProvider*> Provider = getSelection();
@@ -145,7 +168,7 @@ void TaskAppearance::on_changeMode_activated(const QString& s)
}
}
void TaskAppearance::on_changePlot_activated(const QString&s)
void TaskAppearance::onChangePlotActivated(const QString&s)
{
Base::Console().Log("Plot = %s\n",(const char*)s.toLatin1());
}
@@ -153,7 +176,7 @@ void TaskAppearance::on_changePlot_activated(const QString&s)
/**
* Sets the 'Transparency' property of all selected view providers.
*/
void TaskAppearance::on_spinTransparency_valueChanged(int transparency)
void TaskAppearance::onTransparencyValueChanged(int transparency)
{
std::vector<Gui::ViewProvider*> Provider = getSelection();
for (const auto & It : Provider) {
@@ -168,7 +191,7 @@ void TaskAppearance::on_spinTransparency_valueChanged(int transparency)
/**
* Sets the 'PointSize' property of all selected view providers.
*/
void TaskAppearance::on_spinPointSize_valueChanged(int pointsize)
void TaskAppearance::onPointSizeValueChanged(int pointsize)
{
std::vector<Gui::ViewProvider*> Provider = getSelection();
for (const auto & It : Provider) {
@@ -183,7 +206,7 @@ void TaskAppearance::on_spinPointSize_valueChanged(int pointsize)
/**
* Sets the 'LineWidth' property of all selected view providers.
*/
void TaskAppearance::on_spinLineWidth_valueChanged(int linewidth)
void TaskAppearance::onLineWidthValueChanged(int linewidth)
{
std::vector<Gui::ViewProvider*> Provider = getSelection();
for (const auto & It : Provider) {

View File

@@ -52,11 +52,12 @@ public:
Gui::SelectionSingleton::MessageType Reason) override;
private Q_SLOTS:
void on_changeMode_activated(const QString&);
void on_changePlot_activated(const QString&);
void on_spinTransparency_valueChanged(int);
void on_spinPointSize_valueChanged(int);
void on_spinLineWidth_valueChanged(int);
void setupConnections();
void onChangeModeActivated(const QString&);
void onChangePlotActivated(const QString&);
void onTransparencyValueChanged(int);
void onPointSizeValueChanged(int);
void onLineWidthValueChanged(int);
protected:
void changeEvent(QEvent *e) override;

View File

@@ -44,8 +44,7 @@ TaskSelectLinkProperty::TaskSelectLinkProperty(const char *sFilter,App::Property
proxy = new QWidget(this);
ui = new Ui_TaskSelectLinkProperty();
ui->setupUi(proxy);
QMetaObject::connectSlotsByName(this);
setupConnections();
this->groupLayout()->addWidget(proxy);
Gui::Selection().Attach(this);
@@ -84,6 +83,18 @@ TaskSelectLinkProperty::~TaskSelectLinkProperty()
Gui::Selection().Detach(this);
}
void TaskSelectLinkProperty::setupConnections()
{
connect(ui->Remove, &QToolButton::clicked,
this, &TaskSelectLinkProperty::onRemoveClicked);
connect(ui->Add, &QToolButton::clicked,
this, &TaskSelectLinkProperty::onAddClicked);
connect(ui->Invert, &QToolButton::clicked,
this, &TaskSelectLinkProperty::onInvertClicked);
connect(ui->Help, &QToolButton::clicked,
this, &TaskSelectLinkProperty::onHelpClicked);
}
void TaskSelectLinkProperty::changeEvent(QEvent *e)
{
TaskBox::changeEvent(e);
@@ -222,19 +233,19 @@ void TaskSelectLinkProperty::OnChange(Gui::SelectionSingleton::SubjectType &rCal
}
/// @endcond
void TaskSelectLinkProperty::on_Remove_clicked(bool)
void TaskSelectLinkProperty::onRemoveClicked(bool)
{
}
void TaskSelectLinkProperty::on_Add_clicked(bool)
void TaskSelectLinkProperty::onAddClicked(bool)
{
}
void TaskSelectLinkProperty::on_Invert_clicked(bool)
void TaskSelectLinkProperty::onInvertClicked(bool)
{
}
void TaskSelectLinkProperty::on_Help_clicked(bool)
void TaskSelectLinkProperty::onHelpClicked(bool)
{
}

View File

@@ -77,11 +77,12 @@ public:
/// checks if the filter is currently met
inline bool isSelectionValid() const {return Filter->match();}
private Q_SLOTS:
void on_Remove_clicked(bool);
void on_Add_clicked(bool);
void on_Invert_clicked(bool);
void on_Help_clicked(bool);
private:
void setupConnections();
void onRemoveClicked(bool);
void onAddClicked(bool);
void onInvertClicked(bool);
void onHelpClicked(bool);
Q_SIGNALS:
void emitSelectionFit();

View File

@@ -51,6 +51,11 @@ TextureMapping::TextureMapping(QWidget* parent, Qt::WindowFlags fl)
{
ui = new Ui_TextureMapping();
ui->setupUi(this);
connect(ui->fileChooser, &FileChooser::fileNameSelected,
this, &TextureMapping::onFileChooserFileNameSelected);
connect(ui->checkEnv, &QCheckBox::toggled,
this, &TextureMapping::onCheckEnvToggled);
ui->checkGlobal->hide();
// set a dummy string which is not a valid file name
@@ -74,7 +79,7 @@ TextureMapping::TextureMapping(QWidget* parent, Qt::WindowFlags fl)
if (!path.empty()) {
QString file = QString::fromUtf8(path.c_str());
ui->fileChooser->setFileName(file);
on_fileChooser_fileNameSelected(file);
onFileChooserFileNameSelected(file);
}
}
@@ -119,7 +124,7 @@ void TextureMapping::keyPressEvent(QKeyEvent *e)
e->ignore();
}
void TextureMapping::on_fileChooser_fileNameSelected(const QString& s)
void TextureMapping::onFileChooserFileNameSelected(const QString& s)
{
QImage image;
if (!image.load(s)) {
@@ -161,7 +166,7 @@ void TextureMapping::on_fileChooser_fileNameSelected(const QString& s)
App::GetApplication().Config()["TextureImage"] = (const char*)s.toUtf8();
}
void TextureMapping::on_checkEnv_toggled(bool b)
void TextureMapping::onCheckEnvToggled(bool b)
{
if (!this->grp)
return;

View File

@@ -44,9 +44,9 @@ public:
void accept();
void reject();
private Q_SLOTS:
void on_fileChooser_fileNameSelected(const QString&);
void on_checkEnv_toggled(bool);
private:
void onFileChooserFileNameSelected(const QString&);
void onCheckEnvToggled(bool);
protected:
void changeEvent(QEvent *e);

View File

@@ -285,6 +285,9 @@ Transform::Transform(QWidget* parent, Qt::WindowFlags fl)
{
ui = new Ui_Placement();
ui->setupUi(this);
connect(ui->applyButton, &QPushButton::clicked,
this, &Transform::onApplyButtonClicked);
ui->resetButton->hide();
ui->applyIncrementalPlacement->hide();
@@ -348,7 +351,7 @@ void Transform::onTransformChanged(int)
void Transform::accept()
{
on_applyButton_clicked();
onApplyButtonClicked();
QDialog::accept();
}
@@ -358,7 +361,7 @@ void Transform::reject()
QDialog::reject();
}
void Transform::on_applyButton_clicked()
void Transform::onApplyButtonClicked()
{
Gui::WaitCursor wc;
Base::Placement plm = this->getPlacementData();
@@ -461,7 +464,7 @@ bool TaskTransform::reject()
void TaskTransform::clicked(int id)
{
if (id == QDialogButtonBox::Apply) {
dialog->on_applyButton_clicked();
dialog->onApplyButtonClicked();
}
}

View File

@@ -84,13 +84,11 @@ protected:
Base::Vector3d getDirection() const;
void changeEvent(QEvent *e) override;
public Q_SLOTS:
void on_applyButton_clicked();
private Q_SLOTS:
void onTransformChanged(int);
public:
void onApplyButtonClicked();
private:
void onTransformChanged(int);
Base::Placement getPlacementData() const;
private: