Forums

OverviewFelgo 2 Support (Qt 5) › Big problem with new component

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #15354

    Nicola

    Hi,

    i’m need a datapicker and i built it with tumbler (i can chare it how opensource) but when i push it in my v-play app it’s not ok. If i import:

    import Felgo 3.0
    import QtQuick 2.5
    
    import QtQuick.Controls 2.0

    Nothing is ok, layout and i don’t have  access to navigationStack (i think it’s confused from VPlay page and quick page). is exisitng a way to use the new quick controllore in your app?

    Nicola

    #15355

    Alex
    Felgo Team

    Hi Nicola,

    You can prefix the Controls import, e.g.

    import QtQuick.Controls 2.0 as QControls

    and then use the components like:

    QControls.Xyz {}

    Does this solve your issue?

    Cheers,

    Alex

    #15356

    Günther
    Felgo Team

    Hi Nicola!

    Unfortunately there are naming collisions if an item exists in both Felgo and the Quick Controls 2 module. As you correctly suggested, that is the case for the Felgo and Qt Quick 2 Page item.

    There are two solutions to this problem:

    • As Alex mentioned above, you can use a dedicated identifier for an import. For example, when importing Quick Controls 2, use them like this:
    import Felgo 3.0
    import QtQuick.Controls 2.0 as Quick2
    
    // Felgo Page (no special identifier required)
    Page {
    
       // Quick Controls 2 Tumbler (local namespace Quick2)
       Quick2.Tumbler {
          // ...
       }
    
       // ...
    }
     
    • The second option would be to create a custom control that only uses one of the imports, and use this control within Felgo then:
    MyTumbler.qml:
    import QtQuick.Controls 2.0
    
    Tumbler { ... } // custom quick controls 2 tumbler, or at least only a wrapper to avoid the import in other files
    
    VPlayPage.qml:
    import Felgo 3.0
    import "mycontrols" // myTumbler location
    Page {
      MyTumbler { ... } // add quick 2 tumbler
    }

    Best,
    Günther

    #15357

    Nicola

    Thanks for help,

    if have resolved (partial) so:

    import Felgo 3.0 as VP
    import QtQuick 2.5
    
    import QtQuick.Controls 2.0
    
    
    VP.Page {
        title: "Scegli il giorno"
        id: calendarView
    
        Rectangle {
            id: mainrec
            border.color: "red"
            border.width: 10

    It’s all ok, but i don’t see the red border (i don’t need of it, i pushed only to understand what happen) and i don’t understand the reason.

    #15358

    Christian
    Felgo Team

    Hi Nicola,

    can you share your sourcecode of your datepicker here? We may add it as an own component then & improve it with the next Felgo update.

    Cheers, Chris

    #15359

    Nicola

    Sure, i hope to complete it today (i need to add some property to customize) and i’ll share with you

    #15360

    Nicola

    Resolved the rectangle bordere problem setting the height. See soon for the datapicker!

    #19402

    Nicola
    #19409

    Günther
    Felgo Team

    Thanks for sharing your DataPicker – awesome!

    Best,
    Günther

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

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support