Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › AppCheckBox on Android not working

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #16168

    Darren

    I have a ListPage with a custom listView delegate that includes an AppCheckBox control (two-way data with custom ViewModel in C++). When I run on Mac OS X or the iOS simulator, the checkbox works correctly and updates the associated view model. However, when I try to run the app on Android (from Qt Creator and still not bundling qml directory as Qt resource) I am unable to change the checked state of AppCheckBox for any of the list items.

    #16170

    Günther
    Felgo Team

    Hi Darren!

    Based on your description I assume that the issue is related to the two-way data with your custom C++ ViewModel.

    Can you provide a minimal example project that reliably shows this issue and send it to support@felgo.com?
    We can have a closer look what exactly is going wrong then.

    Best,
    Günther

    #16180

    Darren

    Ok, thanks I will try to send an example project later today. Here are a couple snippets that show some of the highlights:

     

    ListPage {
        id: locationsPage
    
        // the data model for the list provided by C++ backend
        model: locationsViewModel
    
        ExclusiveGroup { id: locationGroup }
    
        pullToRefreshHandler.pullToRefreshEnabled: true
        pullToRefreshHandler.onRefresh: locationsViewModel.updateLocations()
    
        listView.delegate: Item {
            id: cell
    
    ///...
    
            // Main cell content inside this item
            GridLayout {
              id: innerGrid
    
    ///...
    
              AppCheckBox {
                  id: contentChosen
                  exclusiveGroup: locationGroup
                  text: ""
                  checked: loc_chosen
                  onCheckedChanged: loc_chosen = checked
              }
    
              Text {
                id: contentText
                color: Theme.textColor
                linkColor: Theme.tintColor
                font.family: Theme.normalFont.name
                font.pixelSize: dp(14)
                lineHeight: 1.15
                text: loc_city + ", " + loc_state + " (" + loc_num_restaurants + ")"
                wrapMode: Text.WordWrap
                Layout.columnSpan: 3
                Layout.alignment: Qt.AlignLeft
              }
    
    ///...
            }
    
        }
    
        // configure custom rightBarItem for navigation bar of widgets page
        rightBarItem:  NavigationBarRow {
            id: rightNavBarRow
    
            IconButtonBarItem {
                onClicked: NativeDialog.confirm("Location", "Saving a new location",
                                                function(ok){}, false)
                title: qsTr("Save")
                icon: IconType.save
            }
        }
    }
    

     

    C++ code for list model setData implementation:

     

    bool LocationsViewModel::setData(const QModelIndex & index, const QVariant & value, int role)
    {
        if (m_Response == nullptr)
            return false;
        if (index.row() < 0 || index.row() >= m_Response->getCityGeoCodeList()->length())
            return false;
    
        if (role == ChosenRole && value.toBool())
        {
            m_Chosen = index.row();
            QVector<int> changedRoles;
            changedRoles << role;
            dataChanged(index, index, changedRoles);
            qInfo() << "New location index selected: " << m_Chosen;
            return true;
        }
    
        return false;
    }
    

     

    #16181

    Darren

    Also, I just noticed this error that is probably from qmake:

     

    QML module does not contain information about components contained in plugins.

    Module path: /Users/vsdev1/FelgoSDK/5.8/android_armv7/qml/QtQuick/Controls/Styles/Android

    See “Using QML Modules with Plugins” in the documentation.

    Automatic type dump of QML module failed.

    Errors:

    “/Users/vsdev1/FelgoSDK/5.8/clang_64/bin/qmlplugindump” returned exit code 3.

    Arguments: -nonrelocatable QtQuick.Controls.Styles.Android 1.0 .

    Error parsing dependencies file <outputOfQmlimportscanner>:illegal value at 0

    failed to proecess output of qmlimportscanner

    QQmlComponent: Component is not ready

    file:///Users/vsdev1/FelgoSDK/5.8/android_armv7/qml/QtQuick/Controls/Styles/typelist.qml:2:1: module “QtQuick.Controls.Styles.Android” is not installed

    #16195

    Günther
    Felgo Team

     

    Thanks Darren,

    we received your email and I already added the issue to our bugtracker.
    We will have a closer look as soon as possible and get back to you once we know more.

    Cheers,
    Günther

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

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded