qt application crash when exit
I use qt 5.5 in ubuntu 18.04, i need to display 3d model(in obj format), i use qquickwidget and qml(Scene3D), it works fine for display model, but when the application exit, it will crash. the error message i get from qtcreator console as bellow:
QMutex::lock() 0x7ffff53b0725
QSemaphore::acquire(int) 0x7ffff53b23f4
Qt3D::QAspectManager::quit() 0x7fffc77c03bd
Qt3D::QAspectEngine::shutdown() 0x7fffc77be54a
Qt3D::QAspectEngine::~QAspectEngine() 0x7fffc77be94e
Qt3D::QAspectEngine::~QAspectEngine() 0x7fffc77be9d9
?? 0x7fffc8036c27
QMetaObject::activate(QObject *, int, int, void * *) 0x7ffff55d3cfa
QObject::destroyed(QObject *) 0x7ffff55d4a6f
QObject::~QObject() 0x7ffff55dcdab
QQuickWindow::~QQuickWindow() 0x7ffff3d43931
QQuickWindow::~QQuickWindow() 0x7ffff3d43999
?? 0x7ffff76bbb8a
?? 0x7ffff76bbc99
QObject::~QObject() 0x7ffff55dcb6b
QWidget::~QWidget() 0x7ffff6fc600b
QQuickWidget::~QQuickWidget() 0x7ffff76bb119
QObjectPrivate::deleteChildren() 0x7ffff55d2bdc
QWidget::~QWidget() 0x7ffff6fc5f8b
It seem like that it's because QQuickWindow destructor was called twice. I had try to remove the 3d related core in the qml, just draw a simple 2d rectangle, it will not be crashed, does anyone help me to fix this problem, thank you very much. Bellow are my qml file;
(1) main.qml
import QtQuick 2.0
import QtQuick.Scene3D 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.2
import Qt3D 2.0
Item {
id: main
Camera {
id: camera
}
Entity {
components: [
ShadowMapFrameGraph {
id: framegraph
viewCamera: camera
lightCamera: light.lightCamera
}
]
}
Light {
id: light
}
AdsEffect {
id: shadowMapEffect
shadowTexture: framegraph.shadowTexture
light: light
}
Scene3D {
id: scene3D
anchors.fill: parent
anchors.verticalCenter: parent.verticalCenter
focus: true
aspects: "input"
obj_model{
id: model
}
}
}
(2) obj_model.qml
import Qt3D 2.0
import Qt3D.Renderer 2.0
import QtQuick 2.1 as QQ2
Entity {
id: root
property Material material
Camera {
id: camera
projectionType: CameraLens.PerspectiveProjection
fieldOfView: 40
aspectRatio: 4/3
nearPlane : 0.1
farPlane : 3000.0
position: Qt.vector3d( 0.0, -1000, 300.0 )
upVector: Qt.vector3d( 0.0, 0.0, 1.0 )
viewCenter: Qt.vector3d( 0.0, 0.0, 300.0 )
}
Configuration {
controlledCamera: camera
}
components: [
FrameGraph {
activeFrameGraph: ForwardRenderer {
camera: camera
clearColor: "white"
}
}
]
PhongMaterial {
id: material
ambient: Qt.rgba( 0.8, 0.8, 0.8, 1.0 )
diffuse: Qt.rgba( 0.1, 0.1, 0.1, 0.5 )
shininess: 50 //shining.value
}
Transform {
id: logoTransform
}
Mesh {
id: logoMesh
source: "../res/model.obj"
}
Entity {
id: logoEntity
components: [ logoMesh, material, logoTransform ]
}
}
qt 3d
add a comment |
I use qt 5.5 in ubuntu 18.04, i need to display 3d model(in obj format), i use qquickwidget and qml(Scene3D), it works fine for display model, but when the application exit, it will crash. the error message i get from qtcreator console as bellow:
QMutex::lock() 0x7ffff53b0725
QSemaphore::acquire(int) 0x7ffff53b23f4
Qt3D::QAspectManager::quit() 0x7fffc77c03bd
Qt3D::QAspectEngine::shutdown() 0x7fffc77be54a
Qt3D::QAspectEngine::~QAspectEngine() 0x7fffc77be94e
Qt3D::QAspectEngine::~QAspectEngine() 0x7fffc77be9d9
?? 0x7fffc8036c27
QMetaObject::activate(QObject *, int, int, void * *) 0x7ffff55d3cfa
QObject::destroyed(QObject *) 0x7ffff55d4a6f
QObject::~QObject() 0x7ffff55dcdab
QQuickWindow::~QQuickWindow() 0x7ffff3d43931
QQuickWindow::~QQuickWindow() 0x7ffff3d43999
?? 0x7ffff76bbb8a
?? 0x7ffff76bbc99
QObject::~QObject() 0x7ffff55dcb6b
QWidget::~QWidget() 0x7ffff6fc600b
QQuickWidget::~QQuickWidget() 0x7ffff76bb119
QObjectPrivate::deleteChildren() 0x7ffff55d2bdc
QWidget::~QWidget() 0x7ffff6fc5f8b
It seem like that it's because QQuickWindow destructor was called twice. I had try to remove the 3d related core in the qml, just draw a simple 2d rectangle, it will not be crashed, does anyone help me to fix this problem, thank you very much. Bellow are my qml file;
(1) main.qml
import QtQuick 2.0
import QtQuick.Scene3D 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.2
import Qt3D 2.0
Item {
id: main
Camera {
id: camera
}
Entity {
components: [
ShadowMapFrameGraph {
id: framegraph
viewCamera: camera
lightCamera: light.lightCamera
}
]
}
Light {
id: light
}
AdsEffect {
id: shadowMapEffect
shadowTexture: framegraph.shadowTexture
light: light
}
Scene3D {
id: scene3D
anchors.fill: parent
anchors.verticalCenter: parent.verticalCenter
focus: true
aspects: "input"
obj_model{
id: model
}
}
}
(2) obj_model.qml
import Qt3D 2.0
import Qt3D.Renderer 2.0
import QtQuick 2.1 as QQ2
Entity {
id: root
property Material material
Camera {
id: camera
projectionType: CameraLens.PerspectiveProjection
fieldOfView: 40
aspectRatio: 4/3
nearPlane : 0.1
farPlane : 3000.0
position: Qt.vector3d( 0.0, -1000, 300.0 )
upVector: Qt.vector3d( 0.0, 0.0, 1.0 )
viewCenter: Qt.vector3d( 0.0, 0.0, 300.0 )
}
Configuration {
controlledCamera: camera
}
components: [
FrameGraph {
activeFrameGraph: ForwardRenderer {
camera: camera
clearColor: "white"
}
}
]
PhongMaterial {
id: material
ambient: Qt.rgba( 0.8, 0.8, 0.8, 1.0 )
diffuse: Qt.rgba( 0.1, 0.1, 0.1, 0.5 )
shininess: 50 //shining.value
}
Transform {
id: logoTransform
}
Mesh {
id: logoMesh
source: "../res/model.obj"
}
Entity {
id: logoEntity
components: [ logoMesh, material, logoTransform ]
}
}
qt 3d
This is all code in your project?
– Eelke
Nov 25 '18 at 6:56
no, there are some UI file(just qmainwindow) and qml for light .
– Bruce
Nov 25 '18 at 7:28
add a comment |
I use qt 5.5 in ubuntu 18.04, i need to display 3d model(in obj format), i use qquickwidget and qml(Scene3D), it works fine for display model, but when the application exit, it will crash. the error message i get from qtcreator console as bellow:
QMutex::lock() 0x7ffff53b0725
QSemaphore::acquire(int) 0x7ffff53b23f4
Qt3D::QAspectManager::quit() 0x7fffc77c03bd
Qt3D::QAspectEngine::shutdown() 0x7fffc77be54a
Qt3D::QAspectEngine::~QAspectEngine() 0x7fffc77be94e
Qt3D::QAspectEngine::~QAspectEngine() 0x7fffc77be9d9
?? 0x7fffc8036c27
QMetaObject::activate(QObject *, int, int, void * *) 0x7ffff55d3cfa
QObject::destroyed(QObject *) 0x7ffff55d4a6f
QObject::~QObject() 0x7ffff55dcdab
QQuickWindow::~QQuickWindow() 0x7ffff3d43931
QQuickWindow::~QQuickWindow() 0x7ffff3d43999
?? 0x7ffff76bbb8a
?? 0x7ffff76bbc99
QObject::~QObject() 0x7ffff55dcb6b
QWidget::~QWidget() 0x7ffff6fc600b
QQuickWidget::~QQuickWidget() 0x7ffff76bb119
QObjectPrivate::deleteChildren() 0x7ffff55d2bdc
QWidget::~QWidget() 0x7ffff6fc5f8b
It seem like that it's because QQuickWindow destructor was called twice. I had try to remove the 3d related core in the qml, just draw a simple 2d rectangle, it will not be crashed, does anyone help me to fix this problem, thank you very much. Bellow are my qml file;
(1) main.qml
import QtQuick 2.0
import QtQuick.Scene3D 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.2
import Qt3D 2.0
Item {
id: main
Camera {
id: camera
}
Entity {
components: [
ShadowMapFrameGraph {
id: framegraph
viewCamera: camera
lightCamera: light.lightCamera
}
]
}
Light {
id: light
}
AdsEffect {
id: shadowMapEffect
shadowTexture: framegraph.shadowTexture
light: light
}
Scene3D {
id: scene3D
anchors.fill: parent
anchors.verticalCenter: parent.verticalCenter
focus: true
aspects: "input"
obj_model{
id: model
}
}
}
(2) obj_model.qml
import Qt3D 2.0
import Qt3D.Renderer 2.0
import QtQuick 2.1 as QQ2
Entity {
id: root
property Material material
Camera {
id: camera
projectionType: CameraLens.PerspectiveProjection
fieldOfView: 40
aspectRatio: 4/3
nearPlane : 0.1
farPlane : 3000.0
position: Qt.vector3d( 0.0, -1000, 300.0 )
upVector: Qt.vector3d( 0.0, 0.0, 1.0 )
viewCenter: Qt.vector3d( 0.0, 0.0, 300.0 )
}
Configuration {
controlledCamera: camera
}
components: [
FrameGraph {
activeFrameGraph: ForwardRenderer {
camera: camera
clearColor: "white"
}
}
]
PhongMaterial {
id: material
ambient: Qt.rgba( 0.8, 0.8, 0.8, 1.0 )
diffuse: Qt.rgba( 0.1, 0.1, 0.1, 0.5 )
shininess: 50 //shining.value
}
Transform {
id: logoTransform
}
Mesh {
id: logoMesh
source: "../res/model.obj"
}
Entity {
id: logoEntity
components: [ logoMesh, material, logoTransform ]
}
}
qt 3d
I use qt 5.5 in ubuntu 18.04, i need to display 3d model(in obj format), i use qquickwidget and qml(Scene3D), it works fine for display model, but when the application exit, it will crash. the error message i get from qtcreator console as bellow:
QMutex::lock() 0x7ffff53b0725
QSemaphore::acquire(int) 0x7ffff53b23f4
Qt3D::QAspectManager::quit() 0x7fffc77c03bd
Qt3D::QAspectEngine::shutdown() 0x7fffc77be54a
Qt3D::QAspectEngine::~QAspectEngine() 0x7fffc77be94e
Qt3D::QAspectEngine::~QAspectEngine() 0x7fffc77be9d9
?? 0x7fffc8036c27
QMetaObject::activate(QObject *, int, int, void * *) 0x7ffff55d3cfa
QObject::destroyed(QObject *) 0x7ffff55d4a6f
QObject::~QObject() 0x7ffff55dcdab
QQuickWindow::~QQuickWindow() 0x7ffff3d43931
QQuickWindow::~QQuickWindow() 0x7ffff3d43999
?? 0x7ffff76bbb8a
?? 0x7ffff76bbc99
QObject::~QObject() 0x7ffff55dcb6b
QWidget::~QWidget() 0x7ffff6fc600b
QQuickWidget::~QQuickWidget() 0x7ffff76bb119
QObjectPrivate::deleteChildren() 0x7ffff55d2bdc
QWidget::~QWidget() 0x7ffff6fc5f8b
It seem like that it's because QQuickWindow destructor was called twice. I had try to remove the 3d related core in the qml, just draw a simple 2d rectangle, it will not be crashed, does anyone help me to fix this problem, thank you very much. Bellow are my qml file;
(1) main.qml
import QtQuick 2.0
import QtQuick.Scene3D 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.2
import Qt3D 2.0
Item {
id: main
Camera {
id: camera
}
Entity {
components: [
ShadowMapFrameGraph {
id: framegraph
viewCamera: camera
lightCamera: light.lightCamera
}
]
}
Light {
id: light
}
AdsEffect {
id: shadowMapEffect
shadowTexture: framegraph.shadowTexture
light: light
}
Scene3D {
id: scene3D
anchors.fill: parent
anchors.verticalCenter: parent.verticalCenter
focus: true
aspects: "input"
obj_model{
id: model
}
}
}
(2) obj_model.qml
import Qt3D 2.0
import Qt3D.Renderer 2.0
import QtQuick 2.1 as QQ2
Entity {
id: root
property Material material
Camera {
id: camera
projectionType: CameraLens.PerspectiveProjection
fieldOfView: 40
aspectRatio: 4/3
nearPlane : 0.1
farPlane : 3000.0
position: Qt.vector3d( 0.0, -1000, 300.0 )
upVector: Qt.vector3d( 0.0, 0.0, 1.0 )
viewCenter: Qt.vector3d( 0.0, 0.0, 300.0 )
}
Configuration {
controlledCamera: camera
}
components: [
FrameGraph {
activeFrameGraph: ForwardRenderer {
camera: camera
clearColor: "white"
}
}
]
PhongMaterial {
id: material
ambient: Qt.rgba( 0.8, 0.8, 0.8, 1.0 )
diffuse: Qt.rgba( 0.1, 0.1, 0.1, 0.5 )
shininess: 50 //shining.value
}
Transform {
id: logoTransform
}
Mesh {
id: logoMesh
source: "../res/model.obj"
}
Entity {
id: logoEntity
components: [ logoMesh, material, logoTransform ]
}
}
qt 3d
qt 3d
asked Nov 24 '18 at 13:09
BruceBruce
167
167
This is all code in your project?
– Eelke
Nov 25 '18 at 6:56
no, there are some UI file(just qmainwindow) and qml for light .
– Bruce
Nov 25 '18 at 7:28
add a comment |
This is all code in your project?
– Eelke
Nov 25 '18 at 6:56
no, there are some UI file(just qmainwindow) and qml for light .
– Bruce
Nov 25 '18 at 7:28
This is all code in your project?
– Eelke
Nov 25 '18 at 6:56
This is all code in your project?
– Eelke
Nov 25 '18 at 6:56
no, there are some UI file(just qmainwindow) and qml for light .
– Bruce
Nov 25 '18 at 7:28
no, there are some UI file(just qmainwindow) and qml for light .
– Bruce
Nov 25 '18 at 7:28
add a comment |
1 Answer
1
active
oldest
votes
It's a bug of qt 5.5, need to update qt version.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53458471%2fqt-application-crash-when-exit%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It's a bug of qt 5.5, need to update qt version.
add a comment |
It's a bug of qt 5.5, need to update qt version.
add a comment |
It's a bug of qt 5.5, need to update qt version.
It's a bug of qt 5.5, need to update qt version.
answered Dec 3 '18 at 2:07
BruceBruce
167
167
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53458471%2fqt-application-crash-when-exit%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
This is all code in your project?
– Eelke
Nov 25 '18 at 6:56
no, there are some UI file(just qmainwindow) and qml for light .
– Bruce
Nov 25 '18 at 7:28