QXlsx icon indicating copy to clipboard operation
QXlsx copied to clipboard

How to close an opened document?

Open Ruffletuft opened this issue 4 years ago • 9 comments

Hello!I'm working on my project with QXlsx. Recently I found that even if I closed all the windows in the program,the process did not disappear.I debugged for a long time,finally found that it's because of using Document::load() .In my program,.xlsx is always be opened but not always be saved. I read the source code of QXlsx but still not know :can an opened file close automatically?Or there is any API?

Ruffletuft avatar Aug 24 '20 09:08 Ruffletuft

Maybe the problem is not about closing file.But _Document::load() _ does make my program not normally exit.Here is some info may help.My program crushed here.And I don't use class QExplicitlySharedDataPointer.Any suggestion please?

0	QExplicitlySharedDataPointer<QRegularExpressionPrivate>::~QExplicitlySharedDataPointer		156	0x6b9e9091	
1	QRegularExpression::~QRegularExpression		1483	0x6b82a197	
2	libstdc++-6!_ZN11__gnu_debug30_Safe_unordered_container_base7_M_swapERS0_	G:\Qt\Qt5.4.0\5.4\mingw491_32\bin\libstdc++-6.dll		0x13b09978	
3	libwinpthread-1!.pth_gpointer_locked	G:\Qt\Qt5.4.0\Tools\mingw491_32\opt\bin\libwinpthread-1.dll		0x64944c7f	
4	??			0x22052584	

Ruffletuft avatar Aug 24 '20 10:08 Ruffletuft

Dear @andthen255 There is no function mentioned. The crash will be registered as an issue.

j2doll avatar Aug 29 '20 13:08 j2doll

debug

Hi. The HelloWorld Demo (in Qt 5.9.1). After "return 0;" code is called, it crashed. #120 the gdb end in ~QMap().

update: Failed to load picture, the details are as follows: 1 QMap<int, QString>::~QMap qmap.h 339 0x4833d4
2 libstdc++-6!ZN11__gnu_debug30_Safe_unordered_container_base7_M_swapERS0 0x193a72a
3 libstdc++-6!ZN11__gnu_debug30_Safe_unordered_container_base7_M_swapERS0 0x193a780
4 ?? 0x19211b4
5 ?? 0x1921325
6 ?? 0x1921433
7 ntdll!RtlFreeUserStack 0x77812ed6 8 ntdll!RtlGetNtSystemRoot 0x777ea288 9 ?? 0x1921410
10 ntdll!LdrShutdownProcess 0x777e0496 11 ??

xjjyzmb avatar Dec 11 '20 07:12 xjjyzmb

Dear @xjjyzmb

Can I see the files related to the full source code of the example?

j2doll avatar Dec 13 '20 03:12 j2doll

Dear @xjjyzmb

Can I see the files related to the full source code of the example?

QXlsx-1.3.57\HelloWorld\HelloWorld.pro

xjjyzmb avatar Dec 14 '20 08:12 xjjyzmb

Maybe the problem is not about closing file.But _Document::load() _ does make my program not normally exit.Here is some info may help.My program crushed here.And I don't use class QExplicitlySharedDataPointer.Any suggestion please?

0	QExplicitlySharedDataPointer<QRegularExpressionPrivate>::~QExplicitlySharedDataPointer		156	0x6b9e9091	
1	QRegularExpression::~QRegularExpression		1483	0x6b82a197	
2	libstdc++-6!_ZN11__gnu_debug30_Safe_unordered_container_base7_M_swapERS0_	G:\Qt\Qt5.4.0\5.4\mingw491_32\bin\libstdc++-6.dll		0x13b09978	
3	libwinpthread-1!.pth_gpointer_locked	G:\Qt\Qt5.4.0\Tools\mingw491_32\opt\bin\libwinpthread-1.dll		0x64944c7f	
4	??			0x22052584	

debug

Hi. The HelloWorld Demo (in Qt 5.9.1). After "return 0;" code is called, it crashed. #120 the gdb end in ~QMap().

update: Failed to load picture, the details are as follows: 1 QMap<int, QString>::~QMap qmap.h 339 0x4833d4 2 libstdc++-6!ZN11__gnu_debug30_Safe_unordered_container_base7_M_swapERS0 0x193a72a 3 libstdc++-6!ZN11__gnu_debug30_Safe_unordered_container_base7_M_swapERS0 0x193a780 4 ?? 0x19211b4 5 ?? 0x1921325 6 ?? 0x1921433 7 ntdll!RtlFreeUserStack 0x77812ed6 8 ntdll!RtlGetNtSystemRoot 0x777ea288 9 ?? 0x1921410 10 ntdll!LdrShutdownProcess 0x777e0496 11 ??

my code end the ~qmap as yours,did you solve the question?

Littlebusybee avatar Dec 19 '20 05:12 Littlebusybee

Is it a multi-threaded problem? I don't know exactly.

j2doll avatar Dec 19 '20 11:12 j2doll

I think the problem in HelloWorld is the the same as in #156 not in .load() but in .save() try the solution https://github.com/QtExcel/QXlsx/issues/156#issuecomment-824631407

novalisek avatar Jun 29 '21 12:06 novalisek

I don't know the cause now. But I will keep this issue.

Sorry for the late reply. I am currently working in a place where there is no internet.

j2doll avatar Jul 11 '21 08:07 j2doll