Skip to content

Commit

Permalink
qt5: Remove the use of deprecated QOpenGL module
Browse files Browse the repository at this point in the history
QOpenGL module is marked as deprecated since a while now so it is time
to remove its use from the Talipot codebase and promote the use of
QOpenGL* classes directly integrated in the QtGui module.

The big difference between QOpenGL and QtOpenGL from Qt5 is that all
rendering is performed in framebuffer objects, there is no more direct
rendering in the underlying os windows with its own OpenGL context.

Talipot OpenGL rendering also follows that idiom, all renderings are performed
offscreen using a shared OpenGL context. This also means that there is no
more QGLWidget as viewport for QGraphicsView. Talipot OpenGL scene are
now converted to QImage in order to display them using the default Qt raster
rendering engine. This should fixes the numerous rendering glitches observed
on MacOS.

First thing observed after the migration is a consequent performance boost
in OpenGL rendering when using an Intel GPU on a Linux host machine (especially
when selecting elements, it is now 10 times faster on debian stable).
  • Loading branch information
anlambert committed Oct 21, 2019
1 parent 529b7a4 commit 1d1505a
Show file tree
Hide file tree
Showing 49 changed files with 357 additions and 780 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ jobs:
- libcppunit-dev
- binutils-dev
- qt5-default
- libqt5opengl5-dev
- libqt5webkit5-dev
- libquazip5-dev
- libglew-dev
Expand Down Expand Up @@ -202,7 +201,6 @@ jobs:
- libcppunit-dev
- binutils-dev
- qt5-default
- libqt5opengl5-dev
- libqt5webkit5-dev
- libquazip5-dev
- libglew-dev
Expand Down
7 changes: 1 addition & 6 deletions cmake/FindQtX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
UNSET(Qt5Core_FOUND CACHE)
UNSET(Qt5Gui_FOUND CACHE)
UNSET(Qt5Widgets_FOUND CACHE)
UNSET(Qt5OpenGL_FOUND CACHE)
UNSET(Qt5Xml_FOUND CACHE)
UNSET(Qt5XmlPatterns_FOUND CACHE)
UNSET(Qt5Network_FOUND CACHE)
Expand All @@ -28,7 +27,6 @@ UNSET(Qt5WebChannel_FOUND CACHE)
UNSET(Qt5Core_DIR CACHE)
UNSET(Qt5Gui_DIR CACHE)
UNSET(Qt5Widgets_DIR CACHE)
UNSET(Qt5OpenGL_DIR CACHE)
UNSET(Qt5Xml_DIR CACHE)
UNSET(Qt5XmlPatterns_DIR CACHE)
UNSET(Qt5Network_DIR CACHE)
Expand Down Expand Up @@ -64,7 +62,6 @@ MACRO(SETUP_QT_LIBRARIES QtModule LIBRARIES)
ENDMACRO(SETUP_QT_LIBRARIES)

FIND_PACKAGE(Qt5Widgets 5.5 REQUIRED)
FIND_PACKAGE(Qt5OpenGL 5.5 REQUIRED)
FIND_PACKAGE(Qt5Network 5.5 REQUIRED)

STRING(REGEX MATCH "[0-9]\\.[0-9]+" QT_VERSION "${Qt5Widgets_VERSION_STRING}")
Expand Down Expand Up @@ -116,7 +113,7 @@ ELSE()
ENDIF()
ENDIF()

SET(QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5Network_LIBRARIES})
SET(QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES})

GET_FILENAME_COMPONENT(QT_CMAKE_DIR "${Qt5Core_DIR}" DIRECTORY)

Expand Down Expand Up @@ -171,10 +168,8 @@ SET(LAST_FOUND_QT_WEB_COMPONENT "${QT_WEB_COMPONENT}" CACHE INTERNAL "")

MACRO(QTX_SET_INCLUDES_AND_DEFINITIONS)
INCLUDE_DIRECTORIES(${Qt5Widgets_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${Qt5OpenGL_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${Qt5Network_INCLUDE_DIRS})
ADD_DEFINITIONS(${Qt5Widgets_DEFINITIONS})
ADD_DEFINITIONS(${Qt5OpenGL_DEFINITIONS})
ADD_DEFINITIONS(${Qt5Network_DEFINITIONS})
ENDMACRO()

Expand Down
82 changes: 20 additions & 62 deletions library/talipot-gui/include/talipot/GlMainWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifndef TALIPOT_GL_MAIN_WIDGET_H
#define TALIPOT_GL_MAIN_WIDGET_H

#include <QGLWidget>
#include <QOpenGLWidget>
#include <QWindow>

#include <talipot/config.h>
Expand Down Expand Up @@ -52,10 +52,9 @@ class GlCompositeHierarchyManager;
* After scene construction you can perform some operation on GlMainWidget :
* - Selection with selectGlEntities()
* - Image output with getImage(), createPicture()
* - Texture output with createTexture()
* - others operation on GlScene and QGlWidget
* - others operation on GlScene and QOpenGLWidget
*/
class TLP_QT_SCOPE GlMainWidget : public QGLWidget {
class TLP_QT_SCOPE GlMainWidget : public QOpenGLWidget {
Q_OBJECT

public:
Expand Down Expand Up @@ -126,26 +125,26 @@ class TLP_QT_SCOPE GlMainWidget : public QGLWidget {
* @param a measure in screen coordinates specified as an integer
* @return the converted measure in viewport coordinates as an integer
*/
int screenToViewport(int l) {
return l * windowHandle()->devicePixelRatio();
inline int screenToViewport(int l) {
return l * devicePixelRatio();
}

/**
* @brief convert a screen measure into a viewport measure
* @param a measure in screen coordinates specified as a double
* @return the converted measure in viewport coordinates as a double
*/
double screenToViewport(double l) {
return l * windowHandle()->devicePixelRatio();
inline double screenToViewport(double l) {
return l * devicePixelRatio();
}

/**
* @brief convert a screen point into a viewport point
* @param a point in screen coordinates
* @return the converted point in viewport coordinates
*/
Coord screenToViewport(const Coord &point) {
qreal dpr = windowHandle()->devicePixelRatio();
inline Coord screenToViewport(const Coord &point) {
qreal dpr = devicePixelRatio();
return Coord(point.x() * dpr, point.y() * dpr);
}

Expand All @@ -154,17 +153,17 @@ class TLP_QT_SCOPE GlMainWidget : public QGLWidget {
* @param a measure in viewport coordinates specified as a double
* @return the converted measure in screen coordinates as a double
*/
double viewportToScreen(double l) {
return l / windowHandle()->devicePixelRatio();
inline double viewportToScreen(double l) {
return l / devicePixelRatio();
}

/**
* @brief convert a viewport point into a screen point
* @param a point in viewport coordinates
* @return the converted point in screen coordinates
*/
Coord viewportToScreen(const Coord &point) {
qreal dpr = windowHandle()->devicePixelRatio();
inline Coord viewportToScreen(const Coord &point) {
qreal dpr = devicePixelRatio();
return Coord(point.x() / dpr, point.y() / dpr);
}

Expand All @@ -176,14 +175,6 @@ class TLP_QT_SCOPE GlMainWidget : public QGLWidget {
static void getTextureRealSize(int width, int height, int &textureRealWidth,
int &textureRealHeight);

/**
* @brief Take a snapshot of the Widget and put it in an OpenGl texture
* @param width power of two number (for example 256)
* @param height power of two number (for example 256)
* You can use this texture with Tulip texture system
* @see GlTextureManager
*/
QOpenGLFramebufferObject *createTexture(const std::string &textureName, int width, int height);
/**
* @brief Take a snapshot of the Widget and put it in a picture
* @param width size
Expand Down Expand Up @@ -226,10 +217,11 @@ class TLP_QT_SCOPE GlMainWidget : public QGLWidget {
tlp::GlLayer *layer = nullptr);

/**
* Extend makeCurrent function of QGLWidget to inform TextureManager and DisplayListManager of
* context changement
* Override default makeCurrent/doneCurrent behavior to activate deactivate
* adequate OpenGL context based on the QOpenGLWidget visibility
*/
virtual void makeCurrent();
void makeCurrent();
void doneCurrent();

/**
* Resize openGL view
Expand Down Expand Up @@ -270,43 +262,21 @@ class TLP_QT_SCOPE GlMainWidget : public QGLWidget {
*/
bool keepScenePointOfViewOnSubgraphChanging() const;

/**
* @brief Specify if an advanced technique for better scene anti-aliasing has to be activated
*
* That option allows to obtain a better scene antialiasing through the use of offscreen rendering
* and sampling.
* The result rendering will look better while the performance will be slightly altered.
* That option is deactivated by default. Use it with caution as it could cause crashes with some
* buggy OpenGL drivers.
*/
void setAdvancedAntiAliasing(bool advancedAntiAliasing) {
this->advancedAntiAliasing = advancedAntiAliasing;
}

/**
* Returns the advanced anti-aliasing technique state
*/
bool advancedAntiAliasingActivated() const {
return advancedAntiAliasing;
}

private:
void setupOpenGlContext();
void createRenderingStore(int width, int height);
void deleteRenderingStore();
void createFramebuffers(int width, int height);
void deleteFramebuffers();

tlp::GlScene scene;
QRegion _visibleArea;
View *view;
int widthStored;
int heightStored;
unsigned char *renderingStore;
bool frameBufferStored;
bool useFramebufferObject;
QOpenGLFramebufferObject *glFrameBuf, *glFrameBuf2;
static bool inRendering;
bool keepPointOfViewOnSubgraphChanging;
bool advancedAntiAliasing;
std::string sceneTextureId;

public slots:
/**
Expand Down Expand Up @@ -359,18 +329,6 @@ protected slots:
void glResized(int w, int h);

void graphChanged();

public:
/**
* This function return the first QGLWidget created
* This function is use to share OpenGL context
*/
static QGLWidget *getFirstQGLWidget();

static void clearFirstQGLWidget();

private:
static QGLWidget *firstQGLWidget;
};
}

Expand Down
12 changes: 12 additions & 0 deletions library/talipot-gui/include/talipot/GlOffscreenRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@

#include <QImage>

class QOpenGLContext;
class QOffscreenSurface;
class QOpenGLFramebufferObject;

namespace tlp {

class GlSimpleEntity;
class GlGraphComposite;
class GlMainWidget;

/**
* @brief Render a scene in an image or in a texture.
Expand Down Expand Up @@ -109,6 +112,8 @@ class TLP_QT_SCOPE GlOffscreenRenderer {

void renderExternalScene(GlScene *scene, const bool antialiased = false);

void renderGlMainWidget(GlMainWidget *glWidget, bool redrawNeeded = true);

/**
* @brief Generate a QImage from the scene. You need to call the renderScene function before this
*function.
Expand All @@ -120,13 +125,20 @@ class TLP_QT_SCOPE GlOffscreenRenderer {
**/
GLuint getGLTexture(const bool generateMipMaps = false);

QOpenGLContext *getOpenGLContext();
void makeOpenGLContextCurrent();
void doneOpenGLContextCurrent();

private:
GlOffscreenRenderer();

void initFrameBuffers(const bool antialiased);

static GlOffscreenRenderer *instance;

QOpenGLContext *glContext;
QOffscreenSurface *offscreenSurface;

unsigned int vPWidth, vPHeight;
QOpenGLFramebufferObject *glFrameBuf, *glFrameBuf2;
GlScene scene;
Expand Down
54 changes: 0 additions & 54 deletions library/talipot-gui/include/talipot/QGlBufferManager.h

This file was deleted.

4 changes: 1 addition & 3 deletions library/talipot-gui/include/talipot/ViewActionsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class TLP_QT_SCOPE ViewActionsManager : public QObject {
QAction *_snapshotAction;

public:
ViewActionsManager(View *view, GlMainWidget *widget, bool keepRatio,
bool showAdvancedAntiAliasing = true);
ViewActionsManager(View *view, GlMainWidget *widget, bool keepRatio);

// the function below must be called by the associated view
// when overloading the View class corresponding method
Expand All @@ -48,7 +47,6 @@ protected slots:
void redraw();
void openSnapshotDialog();
void setAntiAliasing(bool);
void setAdvancedAntiAliasing(bool);
};
}

Expand Down
Loading

4 comments on commit 1d1505a

@p-mary
Copy link

@p-mary p-mary commented on 1d1505a Jan 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to a be a great job.
Unfortunately the QtWebEngine version of the Geographic View is always segfaulting when created:

on LINUX

TLP_PLATEFORM linux
TLP_ARCH x86_64
TLP_COMPILER gcc
TLP_VERSION 1.0.0-dev
TLP_STACK_BEGIN
#00 0x00007f61e5ded7b5 in QOpenGLContextPrivate::maxTextureSize() (+0x115) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Gui.so.5
#1 0x00007f61e60d04ae in QOpenGL2PaintEngineEx::drawImage(QRectF const&, QImage const&, QRectF const&, QFlagsQt::ImageConversionFlag) (+0x2e) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Gui.so.5
#2 0x00007f61e5ff656c in QPainter::drawImage(QRectF const&, QImage const&, QRectF const&, QFlagsQt::ImageConversionFlag) (+0x22c) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Gui.so.5
#3 0x00007f61e66262d4 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) (+0xfd4) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#4 0x00007f61e662671f in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) (+0x3ff) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#5 0x00007f61e6625421 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) (+0x121) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#6 0x00007f61e66295a7 in QWidgetPrivate::render(QPaintDevice*, QPoint const&, QRegion const&, QFlagsQWidget::RenderFlag) (+0x267) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#7 0x00007f61e6629af6 in QWidget::render(QPainter*, QPoint const&, QRegion const&, QFlagsQWidget::RenderFlag) (+0x396) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#8 0x00007f619cbac7f8 in tlp::GeographicViewGraphicsView::updateMapTexture() (+0x308) at /code/talipot/src/plugins/view/GeographicView/GeographicViewGraphicsView.cpp:1265 from /code/talipot/install/lib/talipot/view/libGeographicView-1.0.0-dev.so
Tulip-Dev#9 0x00007f619cbaa100 in tlp::GeographicViewGraphicsView::refreshMap() (+0x28) at /code/talipot/src/plugins/view/GeographicView/GeographicViewGraphicsView.cpp:929 from /code/talipot/install/lib/talipot/view/libGeographicView-1.0.0-dev.so
Tulip-Dev#10 0x00007f619cbaa0d0 in tlp::GeographicViewGraphicsView::timerEvent(QTimerEvent*) (+0x5e) at /code/talipot/src/plugins/view/GeographicView/GeographicViewGraphicsView.cpp:923 from /code/talipot/install/lib/talipot/view/libGeographicView-1.0.0-dev.so
Tulip-Dev#11 0x00007f61e577389b in QObject::event(QEvent*) (+0x7b) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Core.so.5
Tulip-Dev#12 0x00007f61e662cc13 in QWidget::event(QEvent*) (+0x9a3) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#13 0x00007f61e66d076e in QFrame::event(QEvent*) (+0x1e) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#14 0x00007f61e66d33a3 in QAbstractScrollArea::event(QEvent*) (+0x343) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#15 0x00007f61e65ee6fc in QApplicationPrivate::notify_helper(QObject*, QEvent*) (+0x9c) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#16 0x00007f61e65f57f0 in QApplication::notify(QObject*, QEvent*) (+0x2b0) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#17 0x00007f61e5746e98 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (+0x108) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Core.so.5
Tulip-Dev#18 0x00007f61e579d789 in QTimerInfoList::activateTimers() (+0x469) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Core.so.5
Tulip-Dev#19 0x00007f61e579df61 in ?? (+0x2c9f61) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Core.so.5
Tulip-Dev#20 0x00007f61dfefc417 in g_main_context_dispatch (+0x2e7) from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
Tulip-Dev#21 0x00007f61dfefc650 in ?? (+0x4c650) from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
Tulip-Dev#22 0x00007f61dfefc6dc in g_main_context_iteration (+0x2c) from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
Tulip-Dev#23 0x00007f61e579e2cf in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) (+0x5f) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Core.so.5
Tulip-Dev#24 0x00007f61e57457fa in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) (+0xea) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Core.so.5
Tulip-Dev#25 0x00007f619cba28de in tlp::JsCallback::waitForCallback() (+0x9e) at /code/talipot/src/plugins/view/GeographicView/LeafletMaps.h:173 from /code/talipot/install/lib/talipot/view/libGeographicView-1.0.0-dev.so
Tulip-Dev#26 0x00007f619cb9efe5 in tlp::LeafletMaps::executeJavascript(QString const&) (+0xa1) at /code/talipot/src/plugins/view/GeographicView/LeafletMaps.cpp:203 from /code/talipot/install/lib/talipot/view/libGeographicView-1.0.0-dev.so
Tulip-Dev#27 0x00007f619cb9f2e6 in tlp::LeafletMaps::switchToOpenStreetMap() (+0x46) at /code/talipot/src/plugins/view/GeographicView/LeafletMaps.cpp:236 from /code/talipot/install/lib/talipot/view/libGeographicView-1.0.0-dev.so
Tulip-Dev#28 0x00007f619cbaa7da in tlp::GeographicViewGraphicsView::switchViewType() (+0xa4) at /code/talipot/src/plugins/view/GeographicView/GeographicViewGraphicsView.cpp:1020 from /code/talipot/install/lib/talipot/view/libGeographicView-1.0.0-dev.so
Tulip-Dev#29 0x00007f619cb7dac8 in tlp::GeographicView::viewTypeChanged(QString) (+0xaa) at /code/talipot/src/plugins/view/GeographicView/GeographicView.cpp:99 from /code/talipot/install/lib/talipot/view/libGeographicView-1.0.0-dev.so
Tulip-Dev#30 0x00007f619cb7e1bf in tlp::GeographicView::setState(tlp::DataSet const&) (+0x363) at /code/talipot/src/plugins/view/GeographicView/GeographicView.cpp:146 from /code/talipot/install/lib/talipot/view/libGeographicView-1.0.0-dev.so
Tulip-Dev#31 0x000056482a498fe1 in PanelSelectionWizard::createView() (+0xd1) at /code/talipot/src/software/talipot/src/PanelSelectionWizard.cpp:75 from /code/talipot/build/../install/bin/talipot
Tulip-Dev#32 0x000056482a499260 in PanelSelectionWizard::done(int) (+0x2e) at /code/talipot/src/software/talipot/src/PanelSelectionWizard.cpp:97 from /code/talipot/build/../install/bin/talipot
Tulip-Dev#33 0x00007f61e5772989 in QMetaObject::activate(QObject*, int, int, void**) (+0x659) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Core.so.5
Tulip-Dev#34 0x00007f61e66d4ff2 in QAbstractButton::clicked(bool) (+0x32) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#35 0x00007f61e66d51f4 in ?? (+0x2471f4) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#36 0x00007f61e66d5e15 in QAbstractButton::click() (+0x65) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#37 0x00007f61e66d7645 in ?? (+0x249645) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#38 0x00007f61e5772989 in QMetaObject::activate(QObject*, int, int, void**) (+0x659) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Core.so.5
Tulip-Dev#39 0x00007f61e68221d5 in QAbstractItemView::doubleClicked(QModelIndex const&) (+0x25) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#40 0x00007f61e682e626 in QAbstractItemView::mouseDoubleClickEvent(QMouseEvent*) (+0x126) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#41 0x00007f61e662ce91 in QWidget::event(QEvent*) (+0xc21) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#42 0x00007f61e66d076e in QFrame::event(QEvent*) (+0x1e) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#43 0x00007f61e682e30c in QAbstractItemView::viewportEvent(QEvent*) (+0x19c) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#44 0x00007f61e5746c2d in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) (+0x8d) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Core.so.5
Tulip-Dev#45 0x00007f61e65ee6d5 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (+0x75) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
Tulip-Dev#46 0x00007f61e65f5dcf in QApplication::notify(QObject*, QEvent*) (+0x88f) from /code/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5
TLP_STACK_END
Erreur de segmentation (core dumped)

and MacOS

Crashed Thread: 0 CrBrowserMain Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000028
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]

VM Regions Near 0x28:
-->
__TEXT 000000010c582000-000000010c644000 [ 776K] r-x/rwx SM=COW /Users/USER/*

Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0 org.qt-project.QtGui 0x000000010e202a8a QOpenGLContextPrivate::maxTextureSize() + 650
1 org.qt-project.QtGui 0x000000010e4c7876 QOpenGL2PaintEngineEx::drawImage(QRectF const&, QImage const&, QRectF const&, QFlagsQt::ImageConversionFlag) + 54
2 org.qt-project.QtGui 0x000000010e3fc24d QPainter::drawImage(QRectF const&, QImage const&, QRectF const&, QFlagsQt::ImageConversionFlag) + 925
3 org.qt-project.QtWidgets 0x000000010dc30873 QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) + 3027
4 org.qt-project.QtWidgets 0x000000010dc31050 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) + 1120
5 org.qt-project.QtWidgets 0x000000010dc30a47 QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) + 3495
6 org.qt-project.QtWidgets 0x000000010dc2f359 QWidgetPrivate::render(QPaintDevice*, QPoint const&, QRegion const&, QFlagsQWidget::RenderFlag) + 745
7 org.qt-project.QtWidgets 0x000000010dc2e623 QWidget::render(QPainter*, QPoint const&, QRegion const&, QFlagsQWidget::RenderFlag) + 1027
8 libGeographicView-1.0.0-dev.dylib 0x00000001179ac756 tlp::GeographicViewGraphicsView::updateMapTexture() + 406
9 libGeographicView-1.0.0-dev.dylib 0x00000001179ac531 tlp::GeographicViewGraphicsView::timerEvent(QTimerEvent*) + 49 (GeographicViewGraphicsView.cpp:930)
10 org.qt-project.QtCore 0x000000010e95f576 QObject::event(QEvent*) + 102
11 org.qt-project.QtWidgets 0x000000010dc38aba QWidget::event(QEvent*) + 4746
12 org.qt-project.QtWidgets 0x000000010dcdeedd QFrame::event(QEvent*) + 45
13 org.qt-project.QtWidgets 0x000000010dbfbf7d QApplicationPrivate::notify_helper(QObject*, QEvent*) + 269
14 org.qt-project.QtWidgets 0x000000010dbfd382 QApplication::notify(QObject*, QEvent*) + 594
15 org.qt-project.QtCore 0x000000010e935fb4 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 212
16 org.qt-project.QtCore 0x000000010e98f2ef QTimerInfoList::activateTimers() + 991
17 libqcocoa.dylib 0x000000010f82c332 0x10f800000 + 181042
18 com.apple.CoreFoundation 0x00007fff506db941 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
19 com.apple.CoreFoundation 0x00007fff5079333c __CFRunLoopDoSource0 + 108
20 com.apple.CoreFoundation 0x00007fff506be930 __CFRunLoopDoSources0 + 208
21 com.apple.CoreFoundation 0x00007fff506bddad __CFRunLoopRun + 1293
22 com.apple.CoreFoundation 0x00007fff506bd607 CFRunLoopRunSpecific + 487
23 com.apple.HIToolbox 0x00007fff4f9d2866 RunCurrentEventLoopInMode + 286
24 com.apple.HIToolbox 0x00007fff4f9d25d6 ReceiveNextEventCommon + 613
25 com.apple.HIToolbox 0x00007fff4f9d2354 _BlockUntilNextEventMatchingListInModeWithFilter + 64
26 com.apple.AppKit 0x00007fff4dcd044f _DPSNextEvent + 2085
27 com.apple.AppKit 0x00007fff4e465508 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
28 libqcocoa.dylib 0x000000010f82d1be 0x10f800000 + 184766
29 org.qt-project.QtCore 0x000000010e93161f QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) + 431
30 libGeographicView-1.0.0-dev.dylib 0x00000001179a24ef tlp::JsCallback::waitForCallback() + 79
31 libGeographicView-1.0.0-dev.dylib 0x00000001179a242c tlp::LeafletMaps::executeJavascript(QString const&) + 188
32 libGeographicView-1.0.0-dev.dylib 0x00000001179a2791 tlp::LeafletMaps::switchToOpenStreetMap() + 49
33 libGeographicView-1.0.0-dev.dylib 0x00000001179acf0b tlp::GeographicViewGraphicsView::switchViewType() + 75 (GeographicViewGraphicsView.cpp:1020)
34 libGeographicView-1.0.0-dev.dylib 0x000000011798fa43 tlp::GeographicView::viewTypeChanged(QString) + 99 (GeographicView.cpp:101)
35 libGeographicView-1.0.0-dev.dylib 0x00000001179902de tlp::GeographicView::setState(tlp::DataSet const&) + 750 (qstring.h:1135)
36 talipot 0x000000010c5c16b1 PanelSelectionWizard::createView() + 145
37 talipot 0x000000010c5c1934 PanelSelectionWizard::done(int) + 36 (PanelSelectionWizard.cpp:97)
38 org.qt-project.QtCore 0x000000010e96710c QMetaObject::activate(QObject*, int, int, void**) + 3132
39 org.qt-project.QtWidgets 0x000000010dce5acf 0x10dbec000 + 1022671
40 org.qt-project.QtWidgets 0x000000010dce5697 QAbstractButton::click() + 119
41 org.qt-project.QtCore 0x000000010e96710c QMetaObject::activate(QObject*, int, int, void**) + 3132
42 org.qt-project.QtWidgets 0x000000010de63e03 QAbstractItemView::mouseDoubleClickEvent(QMouseEvent*) + 563
43 org.qt-project.QtWidgets 0x000000010dc37a02 QWidget::event(QEvent*) + 466
44 org.qt-project.QtWidgets 0x000000010dcdeedd QFrame::event(QEvent*) + 45
45 org.qt-project.QtWidgets 0x000000010de62479 QAbstractItemView::viewportEvent(QEvent*) + 1417
46 org.qt-project.QtCore 0x000000010e936264 QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) + 148
47 org.qt-project.QtWidgets 0x000000010dbfbf68 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 248
48 org.qt-project.QtWidgets 0x000000010dbfedd8 QApplication::notify(QObject*, QEvent*) + 7336
49 org.qt-project.QtCore 0x000000010e935fb4 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 212
50 org.qt-project.QtWidgets 0x000000010dbfc8a0 QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&, bool, bool) + 896
51 org.qt-project.QtWidgets 0x000000010dc5735e 0x10dbec000 + 439134
52 org.qt-project.QtWidgets 0x000000010dc55cb5 0x10dbec000 + 433333
53 org.qt-project.QtWidgets 0x000000010dbfbf7d QApplicationPrivate::notify_helper(QObject*, QEvent*) + 269
54 org.qt-project.QtWidgets 0x000000010dbfd382 QApplication::notify(QObject*, QEvent*) + 594
55 org.qt-project.QtCore 0x000000010e935fb4 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 212
56 org.qt-project.QtGui 0x000000010e1bf3de QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 5294
57 org.qt-project.QtGui 0x000000010e1a5f9b QWindowSystemInterface::sendWindowSystemEvents(QFlagsQEventLoop::ProcessEventsFlag) + 219
58 libqcocoa.dylib 0x000000010f82db90 0x10f800000 + 187280
59 libqcocoa.dylib 0x000000010f82e400 0x10f800000 + 189440
60 com.apple.CoreFoundation 0x00007fff506db941 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
61 com.apple.CoreFoundation 0x00007fff5079333c __CFRunLoopDoSource0 + 108
62 com.apple.CoreFoundation 0x00007fff506be930 __CFRunLoopDoSources0 + 208
63 com.apple.CoreFoundation 0x00007fff506bddad __CFRunLoopRun + 1293
64 com.apple.CoreFoundation 0x00007fff506bd607 CFRunLoopRunSpecific + 487
65 com.apple.HIToolbox 0x00007fff4f9d2866 RunCurrentEventLoopInMode + 286
66 com.apple.HIToolbox 0x00007fff4f9d24df ReceiveNextEventCommon + 366
67 com.apple.HIToolbox 0x00007fff4f9d2354 _BlockUntilNextEventMatchingListInModeWithFilter + 64
68 com.apple.AppKit 0x00007fff4dcd044f _DPSNextEvent + 2085
69 com.apple.AppKit 0x00007fff4e465508 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
70 com.apple.AppKit 0x00007fff4df02a23 -[NSApplication _doModalLoop:peek:] + 476
71 com.apple.AppKit 0x00007fff4e0e85c9 __33-[NSApplication runModalSession:]_block_invoke_2 + 69
72 com.apple.AppKit 0x00007fff4e0e8571 __33-[NSApplication runModalSession:]_block_invoke + 83
73 com.apple.AppKit 0x00007fff4e5947dc _NSTryRunModal + 100
74 com.apple.AppKit 0x00007fff4e0e8462 -[NSApplication runModalSession:] + 133
75 libqcocoa.dylib 0x000000010f82d15b 0x10f800000 + 184667
76 org.qt-project.QtCore 0x000000010e93161f QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) + 431
77 org.qt-project.QtWidgets 0x000000010ddf806e QDialog::exec() + 526
78 talipot 0x000000010c5fab22 TalipotMainWindow::createPanel(tlp::Graph*) + 98 (TalipotMainWindow.cpp:861)
79 org.qt-project.QtCore 0x000000010e96710c QMetaObject::activate(QObject*, int, int, void**) + 3132
80 org.qt-project.QtWidgets 0x000000010dce5acf 0x10dbec000 + 1022671
81 org.qt-project.QtWidgets 0x000000010dce596c 0x10dbec000 + 1022316
82 org.qt-project.QtWidgets 0x000000010dce6a9f QAbstractButton::mouseReleaseEvent(QMouseEvent*) + 271
83 org.qt-project.QtWidgets 0x000000010dc379ed QWidget::event(QEvent*) + 445
84 org.qt-project.QtWidgets 0x000000010dbfbf7d QApplicationPrivate::notify_helper(QObject*, QEvent*) + 269
85 org.qt-project.QtWidgets 0x000000010dbfedd8 QApplication::notify(QObject*, QEvent*) + 7336
86 org.qt-project.QtCore 0x000000010e935fb4 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 212
87 org.qt-project.QtWidgets 0x000000010dbfc8a0 QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&, bool, bool) + 896
88 org.qt-project.QtWidgets 0x000000010dc5735e 0x10dbec000 + 439134
89 org.qt-project.QtWidgets 0x000000010dc55cb5 0x10dbec000 + 433333
90 org.qt-project.QtWidgets 0x000000010dbfbf7d QApplicationPrivate::notify_helper(QObject*, QEvent*) + 269
91 org.qt-project.QtWidgets 0x000000010dbfd382 QApplication::notify(QObject*, QEvent*) + 594
92 org.qt-project.QtCore 0x000000010e935fb4 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 212
93 org.qt-project.QtGui 0x000000010e1bec7c QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 3404
94 org.qt-project.QtGui 0x000000010e1a5f9b QWindowSystemInterface::sendWindowSystemEvents(QFlagsQEventLoop::ProcessEventsFlag) + 219
95 libqcocoa.dylib 0x000000010f82db90 0x10f800000 + 187280
96 libqcocoa.dylib 0x000000010f82e400 0x10f800000 + 189440
97 com.apple.CoreFoundation 0x00007fff506db941 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
98 com.apple.CoreFoundation 0x00007fff5079333c __CFRunLoopDoSource0 + 108
99 com.apple.CoreFoundation 0x00007fff506be930 __CFRunLoopDoSources0 + 208
100 com.apple.CoreFoundation 0x00007fff506bddad __CFRunLoopRun + 1293
101 com.apple.CoreFoundation 0x00007fff506bd607 CFRunLoopRunSpecific + 487
102 com.apple.HIToolbox 0x00007fff4f9d2866 RunCurrentEventLoopInMode + 286
103 com.apple.HIToolbox 0x00007fff4f9d24df ReceiveNextEventCommon + 366
104 com.apple.HIToolbox 0x00007fff4f9d2354 _BlockUntilNextEventMatchingListInModeWithFilter + 64
105 com.apple.AppKit 0x00007fff4dcd044f _DPSNextEvent + 2085
106 com.apple.AppKit 0x00007fff4e465508 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
107 com.apple.AppKit 0x00007fff4dcc525d -[NSApplication run] + 764
108 libqcocoa.dylib 0x000000010f82d25b 0x10f800000 + 184923
109 org.qt-project.QtCore 0x000000010e93161f QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) + 431
110 org.qt-project.QtCore 0x000000010e9365c2 QCoreApplication::exec() + 130
111 talipot 0x000000010c58a2a1 main + 1393
112 libdyld.dylib 0x00007fff77cd9145 start + 1

@anlambert
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the report.

Indeed I forgot to test with QtWebEngine as I prefer to use QtWebKit to build the Geographic view (well maintained on all platforms, easier to deploy).

Anyway, fixed in 491f56a. I improved the map rendering and the view seems to work great with both web frameworks.

@p-mary
Copy link

@p-mary p-mary commented on 1d1505a Jan 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for these fixes and improvements.
I agree with you about QtWebKit that I also prefer; but as far as I know it is no longer available with Homebrew.

@anlambert
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not use Homebrew to generate dmg bundles and prefer to rely on MacPorts packages as this is far more solid and rigorous in terms of open source software distributions. You should also do the same.

By the way, you have the right to copy and paste my work but I would appreciate that you properly cite it. You should add the links to my original commits in the commit message instead of citing my username.
Something like:

[commit  message title]

[commit message details]

ported from https://github.com/anlambert/talipot/commit/<commit_id>/, ...

I do it when I find something interesting to integrate in upstream Tulip, I intend you to do the same.
This is the basis of open source, you have the right to reuse code if the license allows you to but you
need to add attribution to the original author(s) by referencing the original work.

Please sign in to comment.