Skip to content

Commit

Permalink
Version 8.5.0. Porting Qt 6/VTK 9.
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles PIGNEROL committed Dec 13, 2023
1 parent 174de00 commit 87e7747
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.15)

# Rem : langage C ajouté pour VTK 9 car sinon il refuse de charger MPI_C demandé par ParallelMPI ...
project (QtVtk CXX C)
Expand Down
4 changes: 2 additions & 2 deletions cmake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#

set (QT_VTK_MAJOR_VERSION "8")
set (QT_VTK_MINOR_VERSION "4")
set (QT_VTK_RELEASE_VERSION "1")
set (QT_VTK_MINOR_VERSION "5")
set (QT_VTK_RELEASE_VERSION "0")
set (QT_VTK_VERSION ${QT_VTK_MAJOR_VERSION}.${QT_VTK_MINOR_VERSION}.${QT_VTK_RELEASE_VERSION})


3 changes: 2 additions & 1 deletion src/QtVtk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ find_package (GUIToolkitsVariables)

include (${CMAKE_SOURCE_DIR}/cmake/version.cmake)
include (${GUIToolkitsVariables_CMAKE_DIR}/common.cmake)
include (${GUIToolkitsVariables_CMAKE_DIR}/common_qt.cmake)
include (${GUIToolkitsVariables_CMAKE_DIR}/workarounds.cmake)

find_package (VtkContrib 5 REQUIRED)
include (${CMAKE_SOURCE_DIR}/cmake/qtvtk_common.cmake) # Après VtkContrib qui positionne les variables VTK_7, VTK_8 et VTK_9
find_package (QtUtil 6 REQUIRED)
find_package(Qt5Core NO_CMAKE_SYSTEM_PATH) # In order to enable moc ...
find_package(Qt${QT_MAJOR}Core NO_CMAKE_SYSTEM_PATH) # In order to enable moc ...
if (VTK_9)
find_package (VTK COMPONENTS GUISupportQt IOExportGL2PS FiltersExtraction)
endif (VTK_9)
Expand Down
8 changes: 7 additions & 1 deletion src/QtVtk/QtVTKPrintHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ QtVTKPrintHelper::PrinterStatus QtVTKPrintHelper::print (vtkRenderWindow& window
// S'assurer que la boite de dialogue d'impression ait bien disparue.
if (0 != top)
top->raise ( );
#ifdef QT_5
while (true == qApp->hasPendingEvents ( ))
qApp->processEvents ( );
#endif // QT_5
QtAutoWaitingCursor cursor (true);
if (printer.outputFileName ( ).size ( ) != 0)
{
Expand Down Expand Up @@ -125,7 +127,7 @@ QtVTKPrintHelper::PrinterStatus QtVTKPrintHelper::print (vtkRenderWindow& window
string tmpPSFile (tmpFile + ".ps");
PrintCommand::CommandOptions options;
options.eraseFile = true;
options.copiesNumber= (size_t)printer.numCopies ( );
options.copiesNumber= (size_t)printer.copyCount ( );
printToFile (window, tmpPSFile, 720);
string printerName = printer.printerName ( ).toStdString ( );
printToPrinter (tmpPSFile, printerName, options);
Expand Down Expand Up @@ -206,8 +208,10 @@ QtVTKPrintHelper::PrinterStatus QtVTKPrintHelper::printToFile (vtkRenderWindow&
// S'assurer que la boite de dialogue d'impression ait bien disparue.
if (0 != top)
top->raise ( );
#ifdef QT_5
while (true == qApp->hasPendingEvents ( ))
qApp->processEvents ( );
#endif // QT_5
QtAutoWaitingCursor cursor (true);

QStringList fileList = dialog.selectedFiles ( );
Expand Down Expand Up @@ -262,8 +266,10 @@ QtVTKPrintHelper::PrinterStatus QtVTKPrintHelper::printTo4kFile (vtkRenderWindow
// S'assurer que la boite de dialogue d'impression ait bien disparue.
if (0 != top)
top->raise ( );
#ifdef QT_5
while (true == qApp->hasPendingEvents ( ))
qApp->processEvents ( );
#endif // QT_5
QtAutoWaitingCursor cursor (true);

QStringList fileList = dialog.selectedFiles ( );
Expand Down
4 changes: 4 additions & 0 deletions src/QtVtk/QtVtkGraphicWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ vtkRenderWindow* QtVtkGraphicWidget::GetRenderWindow ( ) // v 8.1.1
#endif


#ifdef QT_5
void QtVtkGraphicWidget::enterEvent (QEvent* event)
#else // QT_5
void QtVtkGraphicWidget::enterEvent (QEnterEvent* event)
#endif // QT_5
{
setFocus ( );

Expand Down
6 changes: 5 additions & 1 deletion src/QtVtk/public/QtVtk/QtVtkGraphicWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@ class QtVtkGraphicWidget : public QVTKOpenGLWidget

protected :

#ifdef QT_5
virtual void enterEvent (QEvent* event);
#else // QT_5
virtual void enterEvent (QEnterEvent* event);
#endif // QT_5
virtual void focusInEvent (QFocusEvent* event);


private :

Expand Down
5 changes: 5 additions & 0 deletions versions.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
A FAIRE : tester le vtkIntersectionPolyDataFilter de VTK 7, voir si de base il propose les services attendus (Inner, ...).

Version 8.5.0 : 13/12/23
===============

Portage Qt 6/QtUtil v 6.4.0/GUIToolkitsVariables v 1.4.0.


Version 8.4.0 : 21/06/23
===============
Expand Down

0 comments on commit 87e7747

Please sign in to comment.