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) › How to: 2 nativeUtils.displayDatePicker in 1 page?

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24013

    Jufry

    Sorry, I am new and still learning

    I have a problem and I cant to solve it by my self. So, I hope you can help me.

    <hr />

    I want to put 2 datepicker in one page with 2 different controllers.

    this is my code:

    AppTextField {
            id: picker1
            ....
            onClicked: {
                nativeUtils.displayDatePicker()
            }
            Connections {
                target: nativeUtils
                onDatePickerFinished: {
                    var d = date.toLocaleString(Qt.locale(),"dd/MM/yyyy")
                    if (accepted) txtDate1.text = d
                }
            }
    
    }
    
    AppTextField {
            id: picker2
            ....
            onClicked: {
                nativeUtils.displayDatePicker()
            }
            Connections {
                target: nativeUtils
                onDatePickerFinished: {
                    var d = date.toLocaleString(Qt.locale(),"dd/MM/yyyy")
                    if (accepted) txtDate2.text = d
                }
            }
    
    }

    The problem is, when I have picked date in picker1, then the picker2 is fired too and will give same date as picker1. vice versa.

    I have read the documentation but I cant understand it well. I dont know too how to make it or implement it as an item property. So, I think, asking is better.

    Maybe someone can explain to me. So for the future, I can be smarter than today.

    Thanks 😉

    #24014

    Jufry

    Solved with simple solution.

    I can trigger Connection target property with null. So, other nativeUtils cant to signal it.

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

RSS feed for this thread

You must be logged in to reply to this topic.