From: imn Date: Thu, 10 Dec 2015 09:01:56 +0000 (+0300) Subject: Replased methods QX11Info::appVisual() and QX11Info::appColormap on XDefaultVisual... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cd8d7de27f49aa2fbf1c3b5aab3461d4b226379e;p=modules%2Fgui.git Replased methods QX11Info::appVisual() and QX11Info::appColormap on XDefaultVisual and XDefaultColorMap --- diff --git a/src/GLViewer/GLViewer_ViewPort.cxx b/src/GLViewer/GLViewer_ViewPort.cxx index cf55d26cd..7a528a576 100644 --- a/src/GLViewer/GLViewer_ViewPort.cxx +++ b/src/GLViewer/GLViewer_ViewPort.cxx @@ -122,7 +122,6 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi ) cout << "Choosing cmap for vID = " << vi->visualid << endl; #endif -// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) ) { @@ -131,6 +130,14 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi ) #endif return QX11Info::appColormap(); } +#else + if ( vi->visualid == XVisualIDFromVisual( XDefaultVisual( QX11Info::display(), -1 ) ) ) + { +#ifdef DEBUG + cout << "Using XDefaultColormap" << endl; +#endif + return XDefaultColormap( QX11Info::display(), -1 ); + } #endif if ( mesa_gl ) { diff --git a/src/OCCViewer/OCCViewer_ViewPort.cxx b/src/OCCViewer/OCCViewer_ViewPort.cxx index f14c8265a..7575a6a66 100755 --- a/src/OCCViewer/OCCViewer_ViewPort.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort.cxx @@ -114,7 +114,7 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi ) //#ifdef DEBUG //cout << "Choosing cmap for vID = " << vi->visualid << endl; //#endif -// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5 + #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) ) { @@ -123,6 +123,14 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi ) #endif return QX11Info::appColormap(); } +#else + if ( vi->visualid == XVisualIDFromVisual( XDefaultVisual( QX11Info::display(), -1 ) ) ) + { +#ifdef DEBUG +// cout << "Using XDefaultColormap" << endl; +#endif + return XDefaultColormap( QX11Info::display(), -1 ); + } #endif if ( mesa_gl ) {