-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#if !defined WNT
+#if !defined WIN32
#define QT_CLEAN_NAMESPACE /* avoid definition of INT32 and INT8 */
#endif
#include <stdlib.h>
-#if !defined WNT
+#if !defined WIN32 && !defined __APPLE__
#include <QX11Info>
#include <GL/glx.h>
#include <X11/Xlib.h>
//cout << "Choosing cmap for vID = " << vi->visualid << endl;
//#endif
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
{
#ifdef DEBUG
#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 )
{
Atom hp_cmaps = XInternAtom( dpy, "_HP_RGB_SMOOTH_MAP_LIST", true );
setBackgroundRole( QPalette::NoRole );//NoBackground );
// set focus policy to threat QContextMenuEvent from keyboard
setFocusPolicy( Qt::StrongFocus );
+#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0) && OCC_VERSION_LARGE < 0x07000000) || QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
setAttribute( Qt::WA_PaintOnScreen );
+#endif
setAttribute( Qt::WA_NoSystemBackground );
}
*/
void OCCViewer_ViewPort::selectVisualId()
{
-#if !defined WNT
+#if !defined WIN32 && !defined __APPLE__
XVisualInfo* pVisualInfo;
if ( QX11Info::display() )
{
return 0;
}
-/*!
- Creates the popup. [ virtual protected ]
-*/
-/*void OCCViewer_ViewPort::onCreatePopup( QPopupMenu* popup )
-{
- if ( popup )
- {
- QtxAction* a = new QtxAction( "", tr( "MEN_VP_CHANGEBGR" ), 0, this );
- a->setStatusTip( tr( "PRP_VP_CHANGEBGR" ) );
- connect( a, SIGNAL( activated() ), SLOT( onChangeBgColor()));
- myPopupActions.append( a );
- a->addTo( popup );
- }
-}*/
-
-/*!
- Destroys the popup. [ virtual protected ]
-*/
-/*void OCCViewer_ViewPort::onDestroyPopup( QPopupMenu* popup )
-{
- if ( popup )
- {
- for ( QtxAction* a = myPopupActions.first(); a; a = myPopupActions.next() )
- a->removeFrom( popup );
- //while (!myPopupActions.isEmpty())
- // delete myPopupActions.takeFirst();
- myPopupActions.clear();
- }
-}*/
-
/*!
Performs synchronization of view parameters with the specified view.
Returns \c true if synchronization is done successfully or \c false otherwise.