Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
ebeb1bb3
Commit
ebeb1bb3
authored
Apr 24, 2018
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Remove QT4 ifdefs from interfaces
refs #141
parent
c1696b74
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
21 additions
and
111 deletions
+21
-111
libs_required/ACG/QtWidgets/QtGLGraphicsScene.cc
libs_required/ACG/QtWidgets/QtGLGraphicsScene.cc
+0
-11
libs_required/ACG/Scenegraph/TextNode.cc
libs_required/ACG/Scenegraph/TextNode.cc
+0
-11
widgets/aboutWidget/aboutWidget.hh
widgets/aboutWidget/aboutWidget.hh
+2
-5
widgets/addEmptyWidget/addEmptyWidget.hh
widgets/addEmptyWidget/addEmptyWidget.hh
+1
-8
widgets/glWidget/QtBaseViewer.cc
widgets/glWidget/QtBaseViewer.cc
+1
-4
widgets/glWidget/QtBaseViewer.hh
widgets/glWidget/QtBaseViewer.hh
+4
-10
widgets/glWidget/QtBaseViewerPicking.cc
widgets/glWidget/QtBaseViewerPicking.cc
+2
-4
widgets/glWidget/QtGLGraphicsScene.cc
widgets/glWidget/QtGLGraphicsScene.cc
+0
-11
widgets/glWidget/simpleGLGraphicsScene.cc
widgets/glWidget/simpleGLGraphicsScene.cc
+0
-11
widgets/rendererWidget/TextBrowserWidget.cc
widgets/rendererWidget/TextBrowserWidget.cc
+2
-5
widgets/rendererWidget/renderObjectHighLighter.cc
widgets/rendererWidget/renderObjectHighLighter.cc
+1
-6
widgets/rendererWidget/rendererObjectWidget.cc
widgets/rendererWidget/rendererObjectWidget.cc
+1
-5
widgets/rendererWidget/rendererWidget.cc
widgets/rendererWidget/rendererWidget.cc
+2
-5
widgets/snapshotDialog/SnapshotDialog.hh
widgets/snapshotDialog/SnapshotDialog.hh
+1
-5
widgets/stereoSettingsWidget/stereoSettingsWidget.hh
widgets/stereoSettingsWidget/stereoSettingsWidget.hh
+2
-5
widgets/videoCaptureDialog/VideoCaptureDialog.hh
widgets/videoCaptureDialog/VideoCaptureDialog.hh
+2
-5
No files found.
libs_required/ACG/QtWidgets/QtGLGraphicsScene.cc
View file @
ebeb1bb3
...
...
@@ -81,37 +81,26 @@ QtGLGraphicsScene::QtGLGraphicsScene(QtBaseViewer* _w) :
void
QtGLGraphicsScene
::
drawBackground
(
QPainter
*
_painter
,
const
QRectF
&
_rect
)
{
// Check for switch in qt4.6 to OpenGL2
#if QT_VERSION >= 0x040600
if
(
_painter
->
paintEngine
()
->
type
()
!=
QPaintEngine
::
OpenGL
&&
_painter
->
paintEngine
()
->
type
()
!=
QPaintEngine
::
OpenGL2
)
{
std
::
cerr
<<
"QtGLGraphicsScene: drawBackground needs a QGLWidget to be set as viewport on the graphics view
\n
"
;
return
;
}
#else
if
(
_painter
->
paintEngine
()
->
type
()
!=
QPaintEngine
::
OpenGL
)
{
std
::
cerr
<<
"QtGLGraphicsScene: drawBackground needs a QGLWidget to be set as viewport on the graphics view
\n
"
;
return
;
}
#endif
// Initialize background first
_painter
->
setBackground
(
QApplication
::
palette
().
window
());
_painter
->
eraseRect
(
_rect
);
// From now on we do OpenGL direct painting on the scene
#if QT_VERSION >= 0x040600
// Tell Qt that we directly use OpenGL
_painter
->
beginNativePainting
();
#endif
// Clear the depth buffer (This is required since QT4.6 Otherwise we get an emtpty scene!
glClear
(
GL_DEPTH_BUFFER_BIT
);
w_
->
paintGL
();
#if QT_VERSION >= 0x040600
// The rest is painting through QT again.
_painter
->
endNativePainting
();
#endif
}
...
...
libs_required/ACG/Scenegraph/TextNode.cc
View file @
ebeb1bb3
...
...
@@ -466,17 +466,6 @@ updateVBO() {
#ifdef WIN32
metricWidth
+=
leftBearing
+
rightBearing
;
#elif QT_VERSION < 0x050000
// QFontMetrics does not seem to always give the correct width
// therefore we add a margin so that characters are not cut off
if
(
leftBearing
+
rightBearing
<
0.1
*
maxFontWidth_
)
{
if
(
metricWidth
+
0.25
*
maxFontWidth_
<
maxFontWidth_
)
metricWidth
+=
0.25
*
maxFontWidth_
;
else
metricWidth
=
maxFontWidth_
;
}
else
{
metricWidth
+=
leftBearing
+
rightBearing
;
}
#endif
float
widthTx
=
(
float
)
metricWidth
/
(
float
)
imageWidth_
;
...
...
widgets/aboutWidget/aboutWidget.hh
View file @
ebeb1bb3
...
...
@@ -50,11 +50,8 @@
#include "ui_aboutWidget.hh"
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QtWidgets>
class
AboutWidget
:
public
QMainWindow
,
public
Ui
::
AboutWidget
...
...
widgets/addEmptyWidget/addEmptyWidget.hh
View file @
ebeb1bb3
...
...
@@ -57,14 +57,7 @@
#include "ui_addEmpty.hh"
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QtWidgets>
class
addEmptyWidget
:
public
QDialog
,
public
Ui
::
addEmpty
{
...
...
widgets/glWidget/QtBaseViewer.cc
View file @
ebeb1bb3
...
...
@@ -91,11 +91,8 @@
#include <QImageWriter>
#if QT_VERSION < 0x050000
#include <QGLFramebufferObject>
#else
#include <QOpenGLFramebufferObject>
#endif
#ifdef max
# undef max
...
...
widgets/glWidget/QtBaseViewer.hh
View file @
ebeb1bb3
...
...
@@ -111,13 +111,10 @@ class QtShiftPopupMenu;
class
CursorPainter
;
class
PostProcessing
;
#if QT_VERSION < 0x050000
class
QGLFramebufferObject
;
class
QGLFramebufferObjectFormat
;
#else
class
QOpenGLFramebufferObject
;
class
QOpenGLFramebufferObjectFormat
;
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5,1,0))
class
QOpenGLDebugLogger
;
...
...
@@ -881,13 +878,10 @@ private:
private:
#if QT_VERSION < 0x050000
typedef
QGLFramebufferObjectFormat
QFramebufferObjectFormat
;
typedef
QGLFramebufferObject
QFramebufferObject
;
#else
typedef
QOpenGLFramebufferObjectFormat
QFramebufferObjectFormat
;
typedef
QOpenGLFramebufferObject
QFramebufferObject
;
#endif
/// Framebuffer object that holds the pick cache
QFramebufferObject
*
pickCache_
;
...
...
widgets/glWidget/QtBaseViewerPicking.cc
View file @
ebeb1bb3
...
...
@@ -65,11 +65,9 @@
#include "OpenFlipper/common/GlobalOptions.hh"
#if QT_VERSION < 0x050000
#include <QGLFramebufferObject>
#else
#include <QOpenGLFramebufferObject>
#endif
//== NAMESPACES ===============================================================
...
...
widgets/glWidget/QtGLGraphicsScene.cc
View file @
ebeb1bb3
...
...
@@ -86,17 +86,10 @@ QtGLGraphicsScene::QtGLGraphicsScene(std::vector< glViewer *> *_views,
void
QtGLGraphicsScene
::
drawBackground
(
QPainter
*
_painter
,
const
QRectF
&
_rect
)
{
// Check for switch in qt4.6 to OpenGL2
#if QT_VERSION >= 0x040600
if
(
_painter
->
paintEngine
()
->
type
()
!=
QPaintEngine
::
OpenGL
&&
_painter
->
paintEngine
()
->
type
()
!=
QPaintEngine
::
OpenGL2
)
{
std
::
cerr
<<
"QtGLGraphicsScene: drawBackground needs a QGLWidget to be set as viewport on the graphics view
\n
"
;
return
;
}
#else
if
(
_painter
->
paintEngine
()
->
type
()
!=
QPaintEngine
::
OpenGL
)
{
std
::
cerr
<<
"QtGLGraphicsScene: drawBackground needs a QGLWidget to be set as viewport on the graphics view
\n
"
;
return
;
}
#endif
// Initialize background first
_painter
->
setBackground
(
QApplication
::
palette
().
window
());
...
...
@@ -107,10 +100,8 @@ void QtGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_rect)
_painter
->
eraseRect
(
_rect
);
// From now on we do OpenGL direct painting on the scene
#if QT_VERSION >= 0x040600
// Tell Qt that we directly use OpenGL
_painter
->
beginNativePainting
();
#endif
static
bool
initialized
=
false
;
if
(
!
initialized
)
...
...
@@ -163,10 +154,8 @@ void QtGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_rect)
views_
->
at
(
i
)
->
paintGL
();
}
#if QT_VERSION >= 0x040600
// The rest is painting through QT again.
_painter
->
endNativePainting
();
#endif
// Draw red box around active examiner
if
(
layout_
->
mode
()
!=
QtMultiViewLayout
::
SingleView
)
...
...
widgets/glWidget/simpleGLGraphicsScene.cc
View file @
ebeb1bb3
...
...
@@ -87,17 +87,10 @@ void SimpleGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_re
{
// Check for switch in qt4.6 to OpenGL2
#if QT_VERSION >= 0x040600
if
(
_painter
->
paintEngine
()
->
type
()
!=
QPaintEngine
::
OpenGL
&&
_painter
->
paintEngine
()
->
type
()
!=
QPaintEngine
::
OpenGL2
)
{
std
::
cerr
<<
"QtGLGraphicsScene: drawBackground needs a QGLWidget to be set as viewport on the graphics view
\n
"
;
return
;
}
#else
if
(
_painter
->
paintEngine
()
->
type
()
!=
QPaintEngine
::
OpenGL
)
{
std
::
cerr
<<
"QtGLGraphicsScene: drawBackground needs a QGLWidget to be set as viewport on the graphics view
\n
"
;
return
;
}
#endif
// Initialize background first
_painter
->
setBackground
(
QApplication
::
palette
().
window
());
...
...
@@ -107,10 +100,8 @@ void SimpleGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_re
return
;
// From now on we do OpenGL direct painting on the scene
#if QT_VERSION >= 0x040600
// Tell Qt that we directly use OpenGL
_painter
->
beginNativePainting
();
#endif
if
(
!
initialized_
)
{
...
...
@@ -149,10 +140,8 @@ void SimpleGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_re
view_
->
paintGL
();
#if QT_VERSION >= 0x040600
// The rest is painting through QT again.
_painter
->
endNativePainting
();
#endif
}
...
...
widgets/rendererWidget/TextBrowserWidget.cc
View file @
ebeb1bb3
...
...
@@ -49,11 +49,8 @@
\*===========================================================================*/
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QtWidgets>
#include "TextBrowserWidget.hh"
...
...
widgets/rendererWidget/renderObjectHighLighter.cc
View file @
ebeb1bb3
...
...
@@ -48,12 +48,7 @@
\*===========================================================================*/
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QtWidgets>
#include "renderObjectHighLighter.hh"
...
...
widgets/rendererWidget/rendererObjectWidget.cc
View file @
ebeb1bb3
...
...
@@ -49,11 +49,7 @@
#include "rendererObjectWidget.hh"
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QtWidgets>
#include <OpenFlipper/common/GlobalOptions.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
...
...
widgets/rendererWidget/rendererWidget.cc
View file @
ebeb1bb3
...
...
@@ -49,11 +49,8 @@
#include "rendererWidget.hh"
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QtWidgets>
#include <OpenFlipper/common/GlobalOptions.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
...
...
widgets/snapshotDialog/SnapshotDialog.hh
View file @
ebeb1bb3
...
...
@@ -49,11 +49,7 @@
#include "ui_SnapshotDialog.hh"
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QtWidgets>
class
SnapshotDialog
:
public
QDialog
,
public
Ui
::
SnapshotDialog
{
...
...
widgets/stereoSettingsWidget/stereoSettingsWidget.hh
View file @
ebeb1bb3
...
...
@@ -57,11 +57,8 @@
#include "ui_stereoSettingsWidget.hh"
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QtWidgets>
class
StereoSettingsWidget
:
public
QWidget
,
public
Ui
::
StereoSettingsWidget
...
...
widgets/videoCaptureDialog/VideoCaptureDialog.hh
View file @
ebeb1bb3
...
...
@@ -49,11 +49,8 @@
#include "ui_VideoCaptureDialog.hh"
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QtWidgets>
class
VideoCaptureDialog
:
public
QDialog
,
public
Ui
::
VideoCaptureDialog
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment