Tour Preview

Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › Run-time crash with multiple Navigation items

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #21596

    Flesh

    I can create 3 pages with no crash, on the 4th I get:

    terminate called after throwing an instance of 'std::bad_alloc'
    
    what(): std::bad_alloc
    
    

    It works in Live Mode, but crashes if I hit run debug, or just run it.

    Note that I had this issue before, but thought it was due to C++ integration, turns out to be how many pages I have, and the size matters, it crashes on 3 pages if I put content into them, and you might not get a crash unless you add more, 4 just happens to crash for me, I have 16 GB RAM and twice as much VM, so the amount of Memory calculates into the crash threshold for how many pages you need to load to get this to crash, so if you do not get it to crash with 4, keep adding till it crashes, or add more content to each page, as it is, it crashes with no content in them.

    I create main page like this:

    import Felgo 3.0
    import QtQuick 2.0
    
    /* ****************************************************************************
     * Navigation Main Page
     */
    App {
        id: appID
        // You get free licenseKeys from https://felgo.com/licenseKey
        // With a licenseKey you can:
        //  * Publish your games & apps for the app stores
        //  * Remove the Felgo Splash Screen or set a custom one (available with the Pro Licenses)
        //  * Add plugins to monetize, analyze & improve your apps (available with the Pro Licenses)
        //licenseKey: "<generate one from https://felgo.com/licenseKey>"
        /* ******************************************************
         * Naviagation view
         */
        Navigation {
            id: navigation
            /* **************************************************
             * First tab
             */
            NavigationItem {
                id: nav1
                title: qsTr("Page 1")
                icon: IconType.list
                // NavigationStack
                NavigationStack {
                    initialPage: Page1 { }
                } // end NavigationStack
            } // end NavigationItem
            /* **************************************************
             * Second tab
             */
            NavigationItem {
                id: nav2
                title: qsTr("Page 2")
                icon: IconType.anchor
                // NavigationStack
                NavigationStack {
                    initialPage: Page2 { }
                } // end NavigationStack
            } // end NavigationItem
            /* **************************************************
             * Third tab
             */
            NavigationItem {
                id: nav3
                title: qsTr("Page 3")
                icon: IconType.asterisk
                // NavigationStack
                NavigationStack {
                    initialPage: Page3 { }
                } // end NavigationStack
            } // end NavigationItem
            /* **************************************************
             * Forth tab
             */
            NavigationItem {
                id: nav4
                title: qsTr("Page 4")
                icon: IconType.bell
                // NavigationStack
                NavigationStack {
                    initialPage: Page4 { }
                } // end NavigationStack
            } // end NavigationItem
        } // end Navigation
    } // end App
    
    

     

    The Pages are:

    import Felgo 3.0
    import QtQuick 2.0
    
    Page {
    
        title: "Page X"
    
    }
    

     

    #21611

    Flesh

    I created a github project https://github.com/Light-Wizzard/FelgoNav

    This example also crashes at run-time, but works in live mode:

     

    App {
        Navigation {
    
            NavigationItem {
                title: qsTr("First Page")
                icon: IconType.money
                Page1 { }
            }
    
            NavigationItem {
                title: qsTr("Second Page")
                icon: IconType.list
                Page2 { }
            }
    
            NavigationItem {
                title: qsTr("Third Page")
                icon: IconType.archive
                Page3 { }
            }
    
            NavigationItem {
                title: qsTr("Forth Page")
                icon: IconType.android
                Page4 { }
            }
        } // end Navigation
    } // end App

     

    #21622

    Günther
    Felgo Team

    Hi,

    the issue does not happen for me when I run the project from GitHub. As you mentioned you previously had the same issue due to C++ integration: Please make sure to clean your project and create a fresh and clean build:

    • Remove the previous build directory from your file system
    • Close Qt Creator and delete the *.pro.user file within your project folder
    • Open your project and re-configure your Kits
    • Right-click your project in Qt Creator Project Explorer and select “Clean”
    • Right-click again and select “run qmake”
    • Build and Run

    Hope this helps!

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.