Why my program pauses at"int 3"again and again?
-
@mais
QT version? compiler? platform?What folder are you traversing with your qmlfolderlistmodel? I don't see why QDirIterator should call a method from QtWebEngine...
-
@raven-worx said in Why my program pauses at"int 3"again and again?:
platform
qt5.10.1 msvc14.0 windows
i havn't used FolderListModel,my qml call the c++ method to copy folder,when it run the "qfile::copy()"it will pause at int 3and if i run it on release mode everything is ok
-
@mais said in Why my program pauses at"int 3"again and again?:
and if i run it on release mode everything is ok
That is contradictory to your opening post
If not debug mode it will crash
did you change something?
Can you share the ode of the function that was last called? -
@J.Hilk not change anything
debug build&run it will crash
debug build&debug run it will int3
release build ok
sorry i havn't expressed clearlycode here
bool ESFileUtil::copyDirectory(const QString &fromDir, const QString &toDir, bool coverFileIfExist) { QDir sourceDir(fromDir); QDir targetDir(toDir); if(!targetDir.exists()){ if(!targetDir.mkdir(targetDir.absolutePath())) return false; } QFileInfoList fileInfoList = sourceDir.entryInfoList(); foreach(QFileInfo fileInfo, fileInfoList){ if(fileInfo.fileName() == "." || fileInfo.fileName() == "..") continue; if(fileInfo.isDir()) { if(!ESFileUtil::copyDirectory(fileInfo.filePath(), targetDir.filePath(fileInfo.fileName()), coverFileIfExist)) return false; } else { if (coverFileIfExist && targetDir.exists(fileInfo.fileName())) { targetDir.remove(fileInfo.fileName()); } if (!QFile::copy(fileInfo.filePath(), targetDir.filePath(fileInfo.fileName()))) {//crash here return false; } } } return true; }
-
@mais
Code in itself looks vaguely OK. But what isESFileUtil::copyDirectory()
as opposed to theFileUtil::copyDirectory()
you show?Your backtrace shows it's dying in a
QtWebEngine
call, that's what I'd be looking at. Like @raven-worx said, why is that involved?? -
@mais
to me it looks looks like you are mixing up Qt binaries.
Can you verify if all Qt libs which are loaded are correct?
This can be done in QtCreator's Debug pane. There is a Modules view (which is by default hidden. To show Window -> Views -> Modules) -
That interrupt is ordinarily reserved for debuggers to trap breakpoints. But it's not clear, so let me reiterate:
- What has WebEngine have to do with the code?
- What is
ESFileUtil
and where does it come from? - The code you provided does not correspond the stack trace, can you explain?
-
@kshegunov
1.webengine do nothing with this code,i use webengine to show a url in the other module.the program really run thisif (!QFile::copy(fileInfo.filePath(), targetDir.filePath(fileInfo.fileName()))) {//crash here return false; }
and show the stack trace int the picture
WebEngineView{ webChannel: webc id: webEngineView anchors.fill: parent; url:esLoginBridgeModel.i_nowUrl; onLoadingChanged:{ if (loadRequest.status === WebEngineLoadRequest.LoadSucceededStatus || loadRequest.status === WebEngineLoadRequest.LoadFailedStatus){ if ( rectPreview.visible ) { delay(200, function(){ previewGif.playing = false; rectPreview.visible = false; } ) } } } }
they don't call each other
2.ESFileUtil is the func self name .i deleted es -
Hi, just guessing but maybe you need to call WebEngineView::grantFeaturePermission to get a security clearance for copying local files inside the web view.
You could also try creating a modal dialog box outside of the webview and do the qFile::copy() in that dialog box. -
@kshegunov said in Why my program pauses at"int 3"again and again?:
The code you provided does not correspond the stack trace, can you explain? [Sic]