Segmentation fault in Qt6.5.3 for linux
-
I meet a segmentation fault in Qt6.5.3 for Linux.When I use the same code in Qt6.5.3 for Windows,it's all right.My code is as following.It exited at
KeyBoardInfo.xxxsignal();
//GCTextField.qml import QtQuick 2.15 import QtQuick.Controls.Basic 2.15 import WYGC import GCSingleton TextField { id: control width: 161 height: 56 text: "---" font.pixelSize: 30 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter inputMethodHints: Qt.ImhDigitsOnly property string oldDataId : "OvenTempSet" property string range: "[0,999]" signal ggg(string v) background: Rectangle { radius: height / 2 border.width: 2 color: control.enabled ? "transparent" : "#c5c5c7" border.color: control.enabled ? (control.acceptableInput ? "#3286FF" : "#b30b00") : "#8a8a8a" } onFocusChanged: { if(control.focus === true) { if(inputMethodHints === Qt.ImhDigitsOnly){ if(KeyBoardInfo != null && typeof(KeyBoardInfo) != "undefined") { //Here the segmentation fault occured. KeyBoardInfo.xxxsignal(); } KeyBoardInfo.keyBoardInfoVisible = true; }else{ KeyBoardInfo.keyBoardInfoVisible = false; } var strls = Database.getInputOldData(control.oldDataId); if(strls.length >= 6) { KeyBoardInfo.oldData = strls[0]; KeyBoardInfo.oldData1 = strls[1]; KeyBoardInfo.oldData2 = strls[2]; KeyBoardInfo.oldData3 = strls[3]; KeyBoardInfo.oldData4 = strls[4]; KeyBoardInfo.oldData5 = strls[5]; } KeyBoardInfo.range = range con.enabled = true; }else { con.enabled = false; } } Keys.onReleased: (event) => { switch(event.key){ case Qt.Key_C: control.text = 0; break; } } onEditingFinished: { Database.updateOldData(oldDataId,text); parent.focus = true; } Connections { id: con enabled: false target: KeyBoardInfo function onSelectOldData(str) { console.log(str); if(str !== "---") { control.text = str; } } } }
//KeyBoardInfo.qml pragma Singleton import QtQuick 6.5 import QtQuick.Studio.Application QtObject { property string oldData: "111" property string oldData1: "222" property string oldData2: "333" property string oldData3: "444" property string oldData4: "555" property string oldData5: "666" property string range: "[0.00,999.00]" signal selectOldData(string str); signal xxxsignal(); property bool keyBoardInfoVisible: true property string range_0_1_2: "[0.00,1.00]" property var validator_0_1_2: DoubleValidator{ top: 1.00 bottom: 0.00 decimals: 2 notation: DoubleValidator.StandardNotation } }
The stack of function is strange.It displayed "??".I have already added the Qt sources.
I'm not sure what exactly happened.