Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 8.5.0. Porting Qt 6/VTK 9. #3

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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