Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Segmentation fault in Qt6.5.3 for linux
Qt 6.11 is out! See what's new in the release blog

Segmentation fault in Qt6.5.3 for linux

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 497 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GWJ0324
    wrote on last edited by
    #1

    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.
    d4d5e455-f696-41e7-9a88-2d716e2cae4a-image.png
    I'm not sure what exactly happened.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      GWJ0324
      wrote on last edited by
      #2

      I'm sorry for my question.I found that I make a mistake.Actually I use the Qt6.5.0 in Windows system.And then I install the Qt6.5.3 on the Windows System,the same error occured.I think it's a bug in Qt6.5.3 Version.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved