Skip to content

Commit 92293d3

Browse files
committed
Add QtUtilities.h header
1 parent 0e2f1ea commit 92293d3

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

include/QtUtilities.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* @file
3+
* @brief Header file for QtUtilities (compatibiity overlay)
4+
* @author FeRD (Frank Dana) <[email protected]>
5+
*/
6+
7+
/* LICENSE
8+
*
9+
* Copyright (c) 2008-2020 OpenShot Studios, LLC
10+
* <http://www.openshotstudios.com/>. This file is part of
11+
* OpenShot Library (libopenshot), an open-source project dedicated to
12+
* delivering high quality video editing and animation solutions to the
13+
* world. For more information visit <http://www.openshot.org/>.
14+
*
15+
* OpenShot Library (libopenshot) is free software: you can redistribute it
16+
* and/or modify it under the terms of the GNU Lesser General Public License
17+
* as published by the Free Software Foundation, either version 3 of the
18+
* License, or (at your option) any later version.
19+
*
20+
* OpenShot Library (libopenshot) is distributed in the hope that it will be
21+
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+
* GNU Lesser General Public License for more details.
24+
*
25+
* You should have received a copy of the GNU Lesser General Public License
26+
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
27+
*/
28+
29+
#ifndef OPENSHOT_QT_UTILITIES_H
30+
#define OPENSHOT_QT_UTILITIES_H
31+
32+
#include <Qt>
33+
#include <QTextStream>
34+
35+
// Fix Qt::endl for older Qt versions
36+
// From: https://bugreports.qt.io/browse/QTBUG-82680
37+
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
38+
namespace Qt {
39+
using TextStreamFunction = QTextStream& (*)(QTextStream&);
40+
constexpr TextStreamFunction endl = ::endl;
41+
}
42+
#endif
43+
44+
#endif // OPENSHOT_QT_UTILITIES_H

src/CacheDisk.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*/
3030

3131
#include "../include/CacheDisk.h"
32+
#include "../include/QtUtilities.h"
3233
#include <Qt>
3334
#include <QString>
3435
#include <QTextStream>

0 commit comments

Comments
 (0)