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. QWebView crash when keyboard is shown
Qt 6.11 is out! See what's new in the release blog

QWebView crash when keyboard is shown

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 252 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.
  • D Offline
    D Offline
    Dawid Uchmanowicz
    wrote on last edited by Dawid Uchmanowicz
    #1

    Hello,

    I have a problem with a WebView and shown keyboard. I would like to open WebView after put the text inside the TextField and after press the Button.
    I can do this on 2 cases:

      • put the text inside TextField (keyboard is shown)
    • press the button
    • the webView is shown
      • put the text inside TextField (keyboard is shown)
    • hide the keyboard by click "OK" (keyboard is hidden)
    • press the button
    • the webView is shown

    In case no. 2 everything is OK, but in case 1 the appliaction going to crash. I dont understand why..
    I was trying to hide keyboard before open webBrowser.qml but it didn't help.

    Main.xml

    ApplicationWindow {
        id: mainWindow
        width: Screen.desktopAvailableWidth
        height: Screen.desktopAvailableHeight
        visible: true
        title: qsTr("BarcodeApp")
    
       ...
    
    TextField{
                    id: textFieldCode
                    validator: DoubleValidator {top: 9999999999999;}
                    maximumLength: 13
                    inputMethodHints: Qt.ImhFormattedNumbersOnly
                    Material.accent: Material.color(Material.Blue)
                    anchors.horizontalCenter: columnDialog.horizontalCenter
    
    }
    
    Button{
                    id: buttonSearch
                    text: "Wyszukaj"
                    highlighted: true
                    Material.accent: Material.color(Material.Blue, Material.Shade600)
                    anchors.horizontalCenter: columnDialog.horizontalCenter
    
                    enabled: errorSyntaxCode==0 ? true : false
    
                    onClicked: {
                        console.log("CRASH IN THIS ACTIONS");
                        var browserComponent = Qt.createComponent("webBrowser.qml");
                        var browserWindow2 = browserComponent.createObject(mainWindow);
                        browserWindow2.show();
    
                    }
     }
    

    webBrowser.qml:

    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtQuick.Controls 2.12
    import QtQuick.Controls.Material 2.12
    import QtQuick.Layouts 1.12
    import QtQuick.Controls.Styles 1.4
    
    import QtWebView 1.1
    
    Window{
        id: webBrowserMain
        width: Screen.desktopAvailableWidth
        height: Screen.desktopAvailableHeight
        visible: true
        title: qsTr("Browser")
        color: "black"
    
    ...
    
        WebView {
            id: webView
            focus: true
    
            anchors {
                top: parent.top
                left: parent.left
                right: parent.right
                bottom: bottomToolBar.top
            }
    
            url: "https://www.google.pl/"
    
        }
    
    }
    
    

    LOGS:

    D ViewRootImpl@ea481dc[QtActivity]: ViewPostIme pointer 0
    D InputMethodManager: HSIFW - flag : 0 Pid : 23997
    D ViewRootImpl@ea481dc[QtActivity]: ViewPostIme pointer 1
    D libBarcode_REU_V02.so: qml: CRASH IN THIS ACTIONS
    I Barcode_REU_V0: Thread[4,tid=24024,WaitingInMainSignalCatcherLoop,Thread*=0xdb008c00,peer=0x12f40270,"Signal Catcher"]: reacting to signal 3
    12-14 17:51:33.058 23997 24024 I Barcode_REU_V0:
    I Barcode_REU_V0: Wrote stack traces to tombstoned```
    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