Skip to content
  • 0 Votes
    2 Posts
    383 Views
    P

    Problem Fixed:
    Tumbler inherits a property called "enabled" from "Item".
    This property holds whether the item receives mouse and keyboard events. By default this is true.
    Changing "enabled" to false solved the issue.

  • QML Tumbler style and wrapmode

    Solved QML and Qt Quick
    2
    0 Votes
    2 Posts
    2k Views
    J.HilkJ

    OK, I managed a workaround to with the import QtQuick.Extras 1.4 - Tumbler, however I'm not satisfied with it, because it (feels like it)is really hackish.

    I added 2 empty elements to the beginning and the end of my list and a Timer that sets the index to the last valid index when one scrolls outside the valid items

    Timer{ id:tReset interval: 0 repeat: false running: false onTriggered: if(valueColumn.currentIndex < 3) tumblerItem.setCurrentIndexAt(0,2) else if(valueColumn.currentIndex > TumblerBackend.currentIndexCount()-3) tumblerItem.setCurrentIndexAt(0,TumblerBackend.currentIndexCount()-3) } Tumbler{ id:tumblerItem anchors.left: parent.left anchors.right: parent.right anchors.top: header.bottom anchors.bottom: parent.bottom TumblerColumn { id:valueColumn model: TumblerBackend.model onModelChanged:{ root.visible = true } width: parent.width-12 onCurrentIndexChanged: { if(currentIndex < 3) tReset.start() else if(currentIndex > TumblerBackend.currentIndexCount()-3) tReset.start() } } style: TumblerStyle { id: tumblerStyle visibleItemCount: 5 delegate: Item { implicitHeight: (tumblerItem.height - padding.top - padding.bottom) / tumblerStyle.visibleItemCount Rectangle{ anchors.fill: parent anchors.margins: 1 border.color:styleData.current ? "black" : "transparent" border.width: 3 color: "transparent" } Text { id: label text: styleData.value font.pixelSize: 18 color: styleData.current ? "black" : "#666666" opacity: 0.4 + Math.max(0, 1 - Math.abs(styleData.displacement)) * 0.6 anchors.centerIn: parent } } } }
  • A design question.

    Solved QML and Qt Quick
    5
    0 Votes
    5 Posts
    2k Views
    J.HilkJ

    @raven-worx

    Ok, a short summary.
    I have an App containing a header, a Menu that can be faded in and out and a Stackview displaying different things, depending an the Menu-Selection. All nested in a Scroll area that expands, depending on the height of the qml-file displayed in the stackview and on the visibility of the menu.

    To garantie that the Tumbler object is like the default Tumbleritem and that it is always at the same spot and with the same size, it has to be part of the root qml file and hast to be feed with content by the stackview and hast to send the information about the selection back again

    That means a alot of signals/slots and/or cross file properties etc.

    All in all something I have done before, in c++. But a lot of work for an optical gimmick and I'm tempted to leave the defalt ComboBox and SpinBox objects in there, even so it breaks the mobile-immersion

  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    2 Posts
    997 Views
    M

    @mike_student
    I have managed to fix data in TumblerColumn with JS and Component

    TumblerColumn { id: lastCheckDay Component.onCompleted: { var days = []; for (var i = 1; i <= 31; ++i) { days.push(i); } lastCheckDay.model = days; } }

    this way allows me to change values for TumblerColumn without Delegate and that is why I am not loosing QT styles
    I will this answer here, maybe it can be helpful for someone

  • 0 Votes
    3 Posts
    2k Views
    C

    @hpollak

    As I mentioned, I tried assigning different Tumbler style properties like:
    background: Rectangle
    {
    color: white
    }

    and the same with foreground and frame style components
    I also tried to set border.width to 0 and still I got this shadow near the borders