Settle the qt + VTK + ikt display dicom image problems, when writing the program found another more fatal problem, namely the end of the program, the master can’t quit, just window closes, test for a long time, found that can’t jump into a destructor after close the window or write their own close function, simply close the window.
I later on qt to intercept window’s close button events, method from http://sunshine1106.blog.51cto.com/1371108/305106/, the author summarizes the study reference, but even perform qApp – & gt; The exit (0), or qApp – & gt; The quit () or qApp – & gt; Functions such as closeAllWindows () still cannot terminate the main program process.
Then I define setAttribute(Qt:: wa_deleteonClose, true) at the beginning; It doesn’t do the trick.
Later I tried to delete the VTKImageView2 object I had defined for VTKSmartPoint by calling its own delete function fastDelete (), and when I ran it I found that the process had been deleted.
Although the goal has been achieved, but still feel strange, the previous online introduction said that the VTK SmartPoint class is able to automatically delete the pointer according to the program, memory resources release, I do not know why in my program it can not automatically release.
A description of the Delete and FastDelete functions in the SmartPoint class is as follows:
I later on qt to intercept window’s close button events, method from http://sunshine1106.blog.51cto.com/1371108/305106/, the author summarizes the study reference, but even perform qApp – & gt; The exit (0), or qApp – & gt; The quit () or qApp – & gt; Functions such as closeAllWindows () still cannot terminate the main program process.
Then I define setAttribute(Qt:: wa_deleteonClose, true) at the beginning; It doesn’t do the trick.
Later I tried to delete the VTKImageView2 object I had defined for VTKSmartPoint by calling its own delete function fastDelete (), and when I ran it I found that the process had been deleted.
Although the goal has been achieved, but still feel strange, the previous online introduction said that the VTK SmartPoint class is able to automatically delete the pointer according to the program, memory resources release, I do not know why in my program it can not automatically release.
A description of the Delete and FastDelete functions in the SmartPoint class is as follows:
<span style="font-size:14px;"> // Description:
// Delete a VTK object. This method should always be used to delete
// an object when the New() method was used to create it. Using the
// C++ delete method will not work with reference counting.
virtual void Delete();
// Description:
// Delete a reference to this object. This version will not invoke
// garbage collection and can potentially leak the object if it is
// part of a reference loop. Use this method only when it is known
// that the object has another reference and would not be collected
// if a full garbage collection check were done.
virtual void FastDelete();</span>
Read More:
- Vtk8.0 compilation process record under vs2017 and qt5.12.1
- On the problem of QT program open crash
- Python program uses OS. System () method to call exe program, resulting in no response of main program process
- VTK: VTK error problem set
- The problem of failed to create process occurs in pyinstaller package program of Python
- VTK + QT + vs compilation and installation configuration
- Configuration, compilation and installation of vtk8.1 in qt5.9
- Recording some pits of VTK + QT
- Vs2017 compiles pcl1.8.1 with vtk8.0 and uses qt5.9.5
- Qt5 when compiling VTK_ The solution of dir-notfound
- Common mistakes and solutions of cmake + QT + VTK
- Unity Android solves the problem of information flow advertisement closing and error reporting
- Record the problems encountered when VTK is used with QT
- Qt5 when cmake configures VTK_ The solution of dir-notfound
- The solution of flashing back after the end of console program running
- Two methods of cmake in VTK program
- Problems in compiling VTK with cmake: solutions to error configuration process, project files may be invalid
- To solve problems in cmake VTK: error configuration process, project files may be invalid
- Vtk8.2.0 (32bit + 64bit) compilation and installation test (win10 + vs2017 + Qt5)
- Installing qt5.8.0 error reporting during installation process