@@ -83,6 +83,12 @@ if (Qt5Widgets_FOUND)
endif()
+ if(Qt5Widgets_VERSION VERSION_LESS "5.15")
+
+ set(QT_VERSION_LESS_5_15 TRUE)
+
+ endif()
+
endif (Qt5Widgets_FOUND)
find_package (Boost COMPONENTS unit_test_framework)
@@ -31,6 +31,7 @@
/** Qt - old version detected. */
#cmakedefine QT_VERSION_LESS_5_11
+#cmakedefine QT_VERSION_LESS_5_15
/** Location of the KernelShark tests. */
#cmakedefine KS_TEST_DIR "@KS_TEST_DIR@"
@@ -345,10 +345,18 @@ void KsGLWidget::wheelEvent(QWheelEvent * event)
* Use the position of the mouse as a focus point for the
* zoom.
*/
- zoomFocus = event->pos().x() - _bin0Offset();
+#ifdef QT_VERSION_LESS_5_15
+
+ zoomFocus = event->pos().x() - _bin0Offset();
+
+#else
+
+ zoomFocus = event->position().x() - _bin0Offset();
+
+#endif // QT_VERSION_LESS_5_15
}
- if (event->delta() > 0) {
+ if (event->angleDelta().y() > 0) {
_model.zoomIn(.05, zoomFocus);
} else {
_model.zoomOut(.05, zoomFocus);
@@ -486,7 +486,7 @@ QString getSaveFile(QWidget *parent,
*/
QStringList splitArguments(QString cmd)
{
- QString::SplitBehavior opt = QString::SkipEmptyParts;
+ auto opt = KS_SPLIT_SkipEmptyParts;
int i, progress = 0, size;
QStringList argv;
QChar quote = 0;
@@ -527,7 +527,7 @@ QStringList splitArguments(QString cmd)
*/
QVector<int> parseIdList(QString v_str)
{
- QStringList list = v_str.split(",", QString::SkipEmptyParts);
+ QStringList list = v_str.split(",", KS_SPLIT_SkipEmptyParts);
QVector<int> v;
for (auto item: list) {
@@ -553,7 +553,7 @@ QVector<int> parseIdList(QString v_str)
*/
QMap<int, QVector<int>> parseTaskList(QString v_str)
{
- QStringList taskList = v_str.split(",", QString::SkipEmptyParts);
+ QStringList taskList = v_str.split(",", KS_SPLIT_SkipEmptyParts);
QVector<int> streamIds, allPids;
kshark_context *kshark_ctx(nullptr);
QMap<int, QVector<int>> ret;
@@ -86,6 +86,16 @@ typedef std::chrono::high_resolution_clock::time_point hd_time;
std::chrono::duration_cast<std::chrono::duration<double>>( \
std::chrono::high_resolution_clock::now() - t0).count()
+#ifdef QT_VERSION_LESS_5_15
+
+ #define KS_SPLIT_SkipEmptyParts QString::SkipEmptyParts
+
+#else
+
+ #define KS_SPLIT_SkipEmptyParts Qt::SkipEmptyParts
+
+#endif // QT_VERSION_LESS_5_15
+
//! @endcond
namespace KsUtils {
@@ -87,7 +87,7 @@ int main(int argc, char **argv)
break;
case 'a':
- appInputFiles << QString(optarg).split(" ", QString::SkipEmptyParts);
+ appInputFiles << QString(optarg).split(" ", KS_SPLIT_SkipEmptyParts);
break;
case 'p':
Couple of APIs used by KernelShark have been marked as deprecated in the recent version of Qt. Fix all compilation warnings caused by the usage of these deprecated APIs. Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> --- CMakeLists.txt | 6 ++++++ build/deff.h.cmake | 1 + src/KsGLWidget.cpp | 12 ++++++++++-- src/KsUtils.cpp | 6 +++--- src/KsUtils.hpp | 10 ++++++++++ src/kernelshark.cpp | 2 +- 6 files changed, 31 insertions(+), 6 deletions(-)