Gui: Use auto and range-based for (#7481)

* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
This commit is contained in:
berniev
2022-09-15 04:25:13 +10:00
committed by GitHub
parent f7c84dfd09
commit ae53c9b0a4
175 changed files with 2051 additions and 2057 deletions

View File

@@ -65,7 +65,7 @@ void ActionFunction::triggered()
{
Q_D(ActionFunction);
QAction* a = qobject_cast<QAction*>(sender());
auto a = qobject_cast<QAction*>(sender());
QMap<QAction*, std::function<void()> >::iterator it = d->triggerMap.find(a);
if (it != d->triggerMap.end()) {
// invoke the class function here
@@ -85,7 +85,7 @@ void ActionFunction::toggled(bool on)
{
Q_D(ActionFunction);
QAction* a = qobject_cast<QAction*>(sender());
auto a = qobject_cast<QAction*>(sender());
QMap<QAction*, std::function<void(bool)> >::iterator it = d->toggleMap.find(a);
if (it != d->toggleMap.end()) {
// invoke the class function here
@@ -105,7 +105,7 @@ void ActionFunction::hovered()
{
Q_D(ActionFunction);
QAction* a = qobject_cast<QAction*>(sender());
auto a = qobject_cast<QAction*>(sender());
QMap<QAction*, std::function<void()> >::iterator it = d->hoverMap.find(a);
if (it != d->hoverMap.end()) {
// invoke the class function here