Skip to content

Commit 0af71d7

Browse files
author
Christian Feldmann
committed
Fix warnings
1 parent 803fe4d commit 0af71d7

File tree

13 files changed

+318
-349
lines changed

13 files changed

+318
-349
lines changed

YUViewLib/YUViewLib.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ QT += core gui widgets opengl xml concurrent network
22

33
TEMPLATE = lib
44
CONFIG += staticlib
5-
CONFIG +=20
5+
CONFIG += c++20
66
CONFIG -= debug_and_release
77
CONFIG += object_parallel_to_source
88

YUViewLib/src/common/Typedef.h

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -256,50 +256,3 @@ enum recacheIndicator
256256
// useless in the cache.
257257
};
258258
Q_DECLARE_METATYPE(recacheIndicator)
259-
260-
#if QT_VERSION <= 0x050700
261-
// copied from newer version of qglobal.h
262-
template <typename... Args> struct QNonConstOverload
263-
{
264-
template <typename R, typename T>
265-
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...)) const Q_DECL_NOTHROW->decltype(ptr)
266-
{
267-
return ptr;
268-
}
269-
template <typename R, typename T>
270-
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
271-
{
272-
return ptr;
273-
}
274-
};
275-
template <typename... Args> struct QConstOverload
276-
{
277-
template <typename R, typename T>
278-
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...) const) const Q_DECL_NOTHROW->decltype(ptr)
279-
{
280-
return ptr;
281-
}
282-
template <typename R, typename T>
283-
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...) const) Q_DECL_NOTHROW -> decltype(ptr)
284-
{
285-
return ptr;
286-
}
287-
};
288-
template <typename... Args> struct QOverload : QConstOverload<Args...>, QNonConstOverload<Args...>
289-
{
290-
using QConstOverload<Args...>::of;
291-
using QConstOverload<Args...>::operator();
292-
using QNonConstOverload<Args...>::of;
293-
using QNonConstOverload<Args...>::operator();
294-
template <typename R>
295-
Q_DECL_CONSTEXPR auto operator()(R (*ptr)(Args...)) const Q_DECL_NOTHROW->decltype(ptr)
296-
{
297-
return ptr;
298-
}
299-
template <typename R>
300-
static Q_DECL_CONSTEXPR auto of(R (*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
301-
{
302-
return ptr;
303-
}
304-
};
305-
#endif
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/* This file is part of YUView - The YUV player with advanced analytics toolset
2+
* <https://github.com/IENT/YUView>
3+
* Copyright (C) 2015 Institut für Nachrichtentechnik, RWTH Aachen University, GERMANY
4+
*
5+
* This program is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation; either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* In addition, as a special exception, the copyright holders give
11+
* permission to link the code of portions of this program with the
12+
* OpenSSL library under certain conditions as described in each
13+
* individual source file, and distribute linked combinations including
14+
* the two.
15+
*
16+
* You must obey the GNU General Public License in all respects for all
17+
* of the code used other than OpenSSL. If you modify file(s) with this
18+
* exception, you may extend this exception to your version of the
19+
* file(s), but you are not obligated to do so. If you do not wish to do
20+
* so, delete this exception statement from your version. If you delete
21+
* this exception statement from all source files in the program, then
22+
* also delete it here.
23+
*
24+
* This program is distributed in the hope that it will be useful,
25+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
26+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27+
* GNU General Public License for more details.
28+
*
29+
* You should have received a copy of the GNU General Public License
30+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
31+
*/
32+
33+
#pragma once
34+
35+
#include <QCheckBox>
36+
37+
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
38+
constexpr auto QCheckBoxStateChanged = &QCheckBox::checkStateChanged;
39+
#else
40+
constexpr auto QCheckBoxStateChanged = &QCheckBox::stateChanged;
41+
#endif
42+

YUViewLib/src/ffmpeg/AVPixFmtDescriptorWrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ bool AVPixFmtDescriptorWrapper::Flags::operator==(
380380
this->floatValues == other.floatValues;
381381
}
382382

383-
bool AVPixFmtDescriptorWrapper::operator==(const AVPixFmtDescriptorWrapper &other)
383+
bool AVPixFmtDescriptorWrapper::operator==(const AVPixFmtDescriptorWrapper &other) const
384384
{
385385
if (this->nb_components != other.nb_components)
386386
return false;

YUViewLib/src/ffmpeg/AVPixFmtDescriptorWrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class AVPixFmtDescriptorWrapper
103103
QString aliases{};
104104
AVComponentDescriptor comp[4];
105105

106-
bool operator==(const AVPixFmtDescriptorWrapper &a);
106+
bool operator==(const AVPixFmtDescriptorWrapper &a) const;
107107
};
108108

109109
} // namespace FFmpeg

YUViewLib/src/playlistitem/playlistItemStatisticsFile.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ InfoData playlistItemStatisticsFile::getInfo() const
103103
}
104104

105105
playlistItemStatisticsFile *playlistItemStatisticsFile::newplaylistItemStatisticsFile(
106-
const YUViewDomElement &root, const QString &playlistFilePath, OpenMode openMode)
106+
const YUViewDomElement &root, const QString &playlistFilePath, OpenMode openMode)
107107
{
108108
// Parse the DOM element. It should have all values of a playlistItemStatisticsFile
109109
auto absolutePath = root.findChildValue("absolutePath");
110110
auto relativePath = root.findChildValue("relativePath");
111111

112112
// check if file with absolute path exists, otherwise check relative path
113113
const auto filePath =
114-
functions::getAbsPathFromAbsAndRel(playlistFilePath, absolutePath, relativePath);
114+
functions::getAbsPathFromAbsAndRel(playlistFilePath, absolutePath, relativePath);
115115
if (filePath.isEmpty())
116116
return nullptr;
117117

@@ -299,12 +299,12 @@ void playlistItemStatisticsFile::openStatisticsFile()
299299
this->timer.start(1000, this);
300300
this->breakBackgroundAtomic.store(false);
301301
this->backgroundParserFuture = QtConcurrent::run(
302-
[=](stats::StatisticsFileBase *file)
303-
{ file->readFrameAndTypePositionsFromFile(std::ref(this->breakBackgroundAtomic)); },
304-
this->file.get());
302+
[this](stats::StatisticsFileBase *file)
303+
{ file->readFrameAndTypePositionsFromFile(std::ref(this->breakBackgroundAtomic)); },
304+
this->file.get());
305305

306306
DEBUG_STAT(
307-
"playlistItemStatisticsFile::openStatisticsFile File opened. Background parsing started.");
307+
"playlistItemStatisticsFile::openStatisticsFile File opened. Background parsing started.");
308308
}
309309

310310
// This timer event is called regularly when the background loading process is running.

YUViewLib/src/statistics/StatisticUIHandler.cpp

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@
4040
#endif
4141
#include <QtMath>
4242

43+
#include <common/FunctionsGui.h>
44+
#include <common/TypedefQtDeprecated.h>
4345
#include <statistics/StatisticsData.h>
4446
#include <statistics/StatisticsType.h>
45-
#include <common/FunctionsGui.h>
4647

4748
namespace stats
4849
{
@@ -64,15 +65,18 @@ StatisticUIHandler::StatisticUIHandler()
6465
Qt::QueuedConnection);
6566
}
6667

67-
void StatisticUIHandler::setStatisticsData(StatisticsData *data) { this->statisticsData = data; }
68+
void StatisticUIHandler::setStatisticsData(StatisticsData *data)
69+
{
70+
this->statisticsData = data;
71+
}
6872

6973
QLayout *StatisticUIHandler::createStatisticsHandlerControls(bool recreateControlsOnly)
7074
{
7175
if (!recreateControlsOnly)
7276
{
7377
// Absolutely always only do this once
7478
Q_ASSERT_X(
75-
!ui.created(), Q_FUNC_INFO, "The primary statistics controls must only be created once.");
79+
!ui.created(), Q_FUNC_INFO, "The primary statistics controls must only be created once.");
7680
ui.setupUi();
7781
}
7882

@@ -93,10 +97,8 @@ QLayout *StatisticUIHandler::createStatisticsHandlerControls(bool recreateContro
9397
itemNameCheck->setChecked(statType.render);
9498
itemNameCheck->setToolTip(statType.description);
9599
ui.gridLayout->addWidget(itemNameCheck, int(row + 2), 0);
96-
connect(itemNameCheck,
97-
&QCheckBox::stateChanged,
98-
this,
99-
&StatisticUIHandler::onStatisticsControlChanged);
100+
connect(
101+
itemNameCheck, QCheckBoxStateChanged, this, &StatisticUIHandler::onStatisticsControlChanged);
100102
itemNameCheckBoxes[0].push_back(itemNameCheck);
101103

102104
// Append the opacity slider
@@ -105,17 +107,16 @@ QLayout *StatisticUIHandler::createStatisticsHandlerControls(bool recreateContro
105107
opacitySlider->setMaximum(100);
106108
opacitySlider->setValue(statType.alphaFactor);
107109
ui.gridLayout->addWidget(opacitySlider, int(row + 2), 1);
108-
connect(opacitySlider,
109-
&QSlider::valueChanged,
110-
this,
111-
&StatisticUIHandler::onStatisticsControlChanged);
110+
connect(
111+
opacitySlider, &QSlider::valueChanged, this, &StatisticUIHandler::onStatisticsControlChanged);
112112
itemOpacitySliders[0].push_back(opacitySlider);
113113

114114
// Append the change style buttons
115115
QPushButton *pushButton = new QPushButton(
116-
functionsGui::convertIcon(":img_edit.png"), QString(), ui.scrollAreaWidgetContents);
116+
functionsGui::convertIcon(":img_edit.png"), QString(), ui.scrollAreaWidgetContents);
117117
ui.gridLayout->addWidget(pushButton, int(row + 2), 2);
118-
connect(pushButton, &QPushButton::released, this, [=] { onStyleButtonClicked(row); });
118+
connect(
119+
pushButton, &QPushButton::released, this, [this, row] { this->onStyleButtonClicked(row); });
119120
itemStyleButtons[0].push_back(pushButton);
120121
}
121122

@@ -144,7 +145,7 @@ QWidget *StatisticUIHandler::getSecondaryStatisticsHandlerControls(bool recreate
144145
if (!this->statisticsData)
145146
{
146147
DEBUG_STATUI(
147-
"StatisticUIHandler::getSecondaryStatisticsHandlerControls statisticsData not set");
148+
"StatisticUIHandler::getSecondaryStatisticsHandlerControls statisticsData not set");
148149
return {};
149150
}
150151

@@ -159,7 +160,7 @@ QWidget *StatisticUIHandler::getSecondaryStatisticsHandlerControls(bool recreate
159160
itemNameCheck->setChecked(statType.render);
160161
ui2.gridLayout->addWidget(itemNameCheck, int(row + 2), 0);
161162
connect(itemNameCheck,
162-
&QCheckBox::stateChanged,
163+
QCheckBoxStateChanged,
163164
this,
164165
&StatisticUIHandler::onSecondaryStatisticsControlChanged);
165166
itemNameCheckBoxes[1].push_back(itemNameCheck);
@@ -178,9 +179,10 @@ QWidget *StatisticUIHandler::getSecondaryStatisticsHandlerControls(bool recreate
178179

179180
// Append the change style buttons
180181
QPushButton *pushButton = new QPushButton(
181-
functionsGui::convertIcon(":img_edit.png"), QString(), ui2.scrollAreaWidgetContents);
182+
functionsGui::convertIcon(":img_edit.png"), QString(), ui2.scrollAreaWidgetContents);
182183
ui2.gridLayout->addWidget(pushButton, int(row + 2), 2);
183-
connect(pushButton, &QPushButton::released, this, [=] { onStyleButtonClicked(row); });
184+
connect(
185+
pushButton, &QPushButton::released, this, [this, row] { this->onStyleButtonClicked(row); });
184186
itemStyleButtons[1].push_back(pushButton);
185187
}
186188

@@ -190,7 +192,7 @@ QWidget *StatisticUIHandler::getSecondaryStatisticsHandlerControls(bool recreate
190192
if (true || ui2.created())
191193
{
192194
QSpacerItem *verticalSpacer =
193-
new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
195+
new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
194196
ui2.gridLayout->addItem(verticalSpacer, int(statTypes.size() + 2), 0, 1, 1);
195197
spacerItems[1] = verticalSpacer;
196198
}
@@ -321,8 +323,8 @@ void StatisticUIHandler::updateStatisticsHandlerControls()
321323
}
322324

323325
// First run a check if all statisticsTypes are identical
324-
bool controlsStillValid = true;
325-
auto &statTypes = this->statisticsData->getStatisticsTypes();
326+
bool controlsStillValid = true;
327+
auto &statTypes = this->statisticsData->getStatisticsTypes();
326328
if (statTypes.size() != itemNameCheckBoxes[0].size())
327329
// There are more or less statistics types as before
328330
controlsStillValid = false;

0 commit comments

Comments
 (0)