Commit a05b343b authored by François Bertel's avatar François Bertel
Browse files

COMP:Fix build with VTK_USE_TDX is OFF.

parent 847fd1be
......@@ -5,17 +5,28 @@ SET ( QVTKLibSrcs
QVTKApplication.cxx
QVTKInteractor.cxx
QVTKWidget.cxx
vtkTDxQtUnixDevices.cxx
)
IF(VTK_USE_TDX)
SET ( QVTKLibSrcs ${QVTKLibSrcs}
vtkTDxQtUnixDevices.cxx
)
ENDIF()
SET ( QVTKMocHeaders
QVTKApplication.h
QVTKInteractor.h
QVTKWidget.h
vtkQtConnection.h
vtkTDxQtUnixDevices.h
)
IF(VTK_USE_TDX)
SET ( QVTKMocHeaders ${QVTKMocHeaders}
vtkTDxQtUnixDevices.h
)
ENDIF()
SET ( QVTKNonMocHeaders
${CMAKE_CURRENT_SOURCE_DIR}/QVTKWin32Header.h
${CMAKE_CURRENT_SOURCE_DIR}/vtkEventQtSlotConnect.h
......
......@@ -46,11 +46,13 @@ bool QVTKApplication::x11EventFilter(XEvent *event)
}
#endif
#ifdef VTK_USE_TDX
void QVTKApplication::setDevice(vtkTDxDevice *device)
{
#if defined(VTK_USE_TDX) && defined(Q_WS_X11)
#ifdef Q_WS_X11
emit CreateDevice(device);
#else
(void)device; // to avoid warnings.
#endif
}
#endif
......@@ -51,7 +51,8 @@ public:
#if defined(VTK_USE_TDX) && defined(Q_WS_X11)
virtual bool x11EventFilter(XEvent *event);
#endif
#ifdef VTK_USE_TDX
public Q_SLOTS:
// Description:
// Slot to receive signal CreateDevice coming from vtkTDxQtUnixDevices.
......@@ -63,6 +64,7 @@ Q_SIGNALS:
// Description:
// Signal for VTKWidget slots.
void CreateDevice(vtkTDxDevice *device);
#endif
protected:
#if defined(VTK_USE_TDX) && defined(Q_WS_X11)
......
......@@ -667,11 +667,12 @@ QPaintEngine* QVTKWidget::paintEngine() const
#endif
#endif
#ifdef VTK_USE_TDX
// Description:
// Receive notification of the creation of the TDxDevice
void QVTKWidget::setDevice(vtkTDxDevice *device)
{
#if defined(VTK_USE_TDX) && defined(Q_WS_X11)
#ifdef Q_WS_X11
if(this->GetInteractor()->GetDevice()!=device)
{
this->GetInteractor()->SetDevice(device);
......@@ -680,6 +681,7 @@ void QVTKWidget::setDevice(vtkTDxDevice *device)
(void)device; // to avoid warnings.
#endif
}
#endif
void QVTKWidget::x11_setup_window()
{
......
......@@ -64,6 +64,8 @@ class vtkImageData;
#include "QVTKWin32Header.h"
#include "vtkTDxConfigure.h" // defines VTK_USE_TDX
//! QVTKWidget displays a VTK window in a Qt window.
class QVTK_EXPORT QVTKWidget : public QWidget
{
......@@ -177,7 +179,9 @@ public Q_SLOTS:
// Description:
// Receive notification of the creation of the TDxDevice.
// Only relevant for Unix.
#ifdef VTK_USE_TDX
void setDevice(vtkTDxDevice *device);
#endif
protected:
// overloaded resize handler
......
......@@ -49,7 +49,6 @@ vtkTDxQtUnixDevices::vtkTDxQtUnixDevices()
// ----------------------------------------------------------------------------
vtkTDxQtUnixDevices::~vtkTDxQtUnixDevices()
{
cout << "delete private" << endl;
delete this->Private;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment