Fix backwards-compatible Qt6 warnings
This commit is contained in:
committed by
Chris Hennes
parent
5b4eeb29a9
commit
33e91421b5
@@ -100,7 +100,7 @@ CmdDrawingNewPage::CmdDrawingNewPage()
|
||||
void CmdDrawingNewPage::activated(int iMsg)
|
||||
{
|
||||
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(_pcAction);
|
||||
QAction* a = qAsConst(pcAction)->actions()[iMsg];
|
||||
QAction* a = std::as_const(pcAction)->actions()[iMsg];
|
||||
|
||||
std::string FeatName = getUniqueObjectName(
|
||||
QCoreApplication::translate("Drawing_NewPage", "Page").toStdString().c_str());
|
||||
@@ -204,7 +204,7 @@ Gui::Action* CmdDrawingNewPage::createAction(void)
|
||||
pcAction->setProperty("defaultAction", QVariant(defaultId));
|
||||
}
|
||||
else if (!pcAction->actions().isEmpty()) {
|
||||
pcAction->setIcon(qAsConst(pcAction)->actions()[0]->icon());
|
||||
pcAction->setIcon(std::as_const(pcAction)->actions()[0]->icon());
|
||||
pcAction->setProperty("defaultAction", QVariant(0));
|
||||
}
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ QString Material::getAuthorAndLicense() const
|
||||
|
||||
void Material::addModel(const QString& uuid)
|
||||
{
|
||||
for (const auto& modelUUID : qAsConst(_allUuids)) {
|
||||
for (const auto& modelUUID : std::as_const(_allUuids)) {
|
||||
if (modelUUID == uuid) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -285,7 +285,8 @@ void EditDatumDialog::drivingToggled(bool state)
|
||||
|
||||
void EditDatumDialog::datumChanged()
|
||||
{
|
||||
if (ui_ins_datum->labelEdit->text() != qAsConst(ui_ins_datum->labelEdit)->getHistory()[0]) {
|
||||
if (ui_ins_datum->labelEdit->text()
|
||||
!= std::as_const(ui_ins_datum->labelEdit)->getHistory()[0]) {
|
||||
ui_ins_datum->cbDriving->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -833,7 +833,7 @@ TaskSketcherConstraints::TaskSketcherConstraints(ViewProviderSketch* sketchView)
|
||||
QWidgetAction* action = new QWidgetAction(this);
|
||||
filterList = new ConstraintFilterList(this);
|
||||
action->setDefaultWidget(filterList);
|
||||
qAsConst(ui->filterButton)->addAction(action);
|
||||
std::as_const(ui->filterButton)->addAction(action);
|
||||
|
||||
// Create local settings menu
|
||||
// FIXME there is probably a smarter way to handle this menu
|
||||
@@ -862,7 +862,7 @@ TaskSketcherConstraints::TaskSketcherConstraints(ViewProviderSketch* sketchView)
|
||||
}
|
||||
hGrp->Attach(this);
|
||||
|
||||
auto settingsBut = qAsConst(ui->settingsButton);
|
||||
auto settingsBut = std::as_const(ui->settingsButton);
|
||||
|
||||
settingsBut->addAction(action1);
|
||||
settingsBut->addAction(action2);
|
||||
@@ -1040,8 +1040,8 @@ void TaskSketcherConstraints::onChangedSketchView(const Gui::ViewProvider& vp,
|
||||
{
|
||||
if (sketchView == &vp) {
|
||||
if (&sketchView->Autoconstraints == &prop) {
|
||||
QSignalBlocker block(qAsConst(ui->settingsButton)->actions()[0]);
|
||||
qAsConst(ui->settingsButton)
|
||||
QSignalBlocker block(std::as_const(ui->settingsButton)->actions()[0]);
|
||||
std::as_const(ui->settingsButton)
|
||||
->actions()[0]
|
||||
->setChecked(sketchView->Autoconstraints.getValue());
|
||||
}
|
||||
@@ -1425,7 +1425,7 @@ void TaskSketcherConstraints::OnChange(Base::Subject<const char*>& rCaller, cons
|
||||
}
|
||||
if (actNum >= 0) {
|
||||
assert(actNum < static_cast<int>(ui->settingsButton->actions().size()));
|
||||
qAsConst(ui->settingsButton)->actions()[actNum]->setChecked(hGrp->GetBool(rcReason, false));
|
||||
std::as_const(ui->settingsButton)->actions()[actNum]->setChecked(hGrp->GetBool(rcReason, false));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -492,7 +492,7 @@ private:
|
||||
{
|
||||
int hue, sat, val, alp;
|
||||
QIcon Normal = Gui::BitmapFactory().iconFromTheme(name);
|
||||
QImage imgConstr(Normal.pixmap(qAsConst(Normal).availableSizes()[0]).toImage());
|
||||
QImage imgConstr(Normal.pixmap(std::as_const(Normal).availableSizes()[0]).toImage());
|
||||
QImage imgExt(imgConstr);
|
||||
QImage imgInt(imgConstr);
|
||||
|
||||
@@ -1230,7 +1230,7 @@ void TaskSketcherElements::connectSignals()
|
||||
&TaskSketcherElements::onFilterBoxStateChanged);
|
||||
QObject::connect(
|
||||
ui->settingsButton, &QToolButton::clicked, ui->settingsButton, &QToolButton::showMenu);
|
||||
QObject::connect(qAsConst(ui->settingsButton)->actions()[0],
|
||||
QObject::connect(std::as_const(ui->settingsButton)->actions()[0],
|
||||
&QAction::changed,
|
||||
this,
|
||||
&TaskSketcherElements::onSettingsExtendedInformationChanged);
|
||||
@@ -1250,7 +1250,7 @@ void TaskSketcherElements::createFilterButtonActions()
|
||||
auto* action = new QWidgetAction(this);
|
||||
filterList = new ElementFilterList(this);
|
||||
action->setDefaultWidget(filterList);
|
||||
qAsConst(ui->filterButton)->addAction(action);
|
||||
std::as_const(ui->filterButton)->addAction(action);
|
||||
}
|
||||
|
||||
void TaskSketcherElements::onFilterBoxStateChanged(int val)
|
||||
|
||||
@@ -102,7 +102,7 @@ TaskSketcherMessages::TaskSketcherMessages(ViewProviderSketch* sketchView)
|
||||
action->setChecked(state);
|
||||
ui->manualUpdate->addAction(action);
|
||||
|
||||
QObject::connect(qAsConst(ui->manualUpdate)->actions()[0],
|
||||
QObject::connect(std::as_const(ui->manualUpdate)->actions()[0],
|
||||
&QAction::changed,
|
||||
this,
|
||||
&TaskSketcherMessages::onAutoUpdateStateChanged);
|
||||
@@ -175,7 +175,7 @@ void TaskSketcherMessages::onLabelConstrainStatusLinkClicked(const QString& str)
|
||||
|
||||
void TaskSketcherMessages::onAutoUpdateStateChanged()
|
||||
{
|
||||
bool state = qAsConst(ui->manualUpdate)->actions()[0]->isChecked();
|
||||
bool state = std::as_const(ui->manualUpdate)->actions()[0]->isChecked();
|
||||
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
|
||||
"User parameter:BaseApp/Preferences/Mod/Sketcher");
|
||||
|
||||
@@ -119,7 +119,7 @@ QSize FlowLayout::sizeHint() const
|
||||
QSize FlowLayout::minimumSize() const
|
||||
{
|
||||
QSize size;
|
||||
for (auto item : qAsConst(itemList)) {
|
||||
for (auto item : std::as_const(itemList)) {
|
||||
size = size.expandedTo(item->minimumSize());
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ int FlowLayout::doLayout(const QRect& rect, bool testOnly) const
|
||||
int y = effectiveRect.y();
|
||||
int lineHeight = 0;
|
||||
|
||||
for (auto item : qAsConst(itemList)) {
|
||||
for (auto item : std::as_const(itemList)) {
|
||||
QWidget* wid = item->widget();
|
||||
int spaceX = horizontalSpacing();
|
||||
if (spaceX == -1) {
|
||||
|
||||
@@ -720,7 +720,7 @@ void MDIViewPage::sceneSelectionManager()
|
||||
//add to m_qgSceneSelected anything that is in q_sceneSel
|
||||
for (auto qts : sceneSel) {
|
||||
bool found = false;
|
||||
for (auto ms : qAsConst(m_qgSceneSelected)) {
|
||||
for (auto ms : std::as_const(m_qgSceneSelected)) {
|
||||
if (qts == ms) {
|
||||
found = true;
|
||||
break;
|
||||
@@ -734,7 +734,7 @@ void MDIViewPage::sceneSelectionManager()
|
||||
|
||||
//remove items from m_qgSceneSelected that are not in q_sceneSel
|
||||
QList<QGraphicsItem*> m_new;
|
||||
for (auto m : qAsConst(m_qgSceneSelected)) {
|
||||
for (auto m : std::as_const(m_qgSceneSelected)) {
|
||||
for (auto q : sceneSel) {
|
||||
if (m == q) {
|
||||
m_new.push_back(m);
|
||||
|
||||
Reference in New Issue
Block a user