Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Tumbler´s Delegate removes TumblerStyle
Forum Updated to NodeBB v4.3 + New Features

Tumbler´s Delegate removes TumblerStyle

Scheduled Pinned Locked Moved Solved General and Desktop
qt quicktumblerqt quick extrastumbler styletubmlercolumn
2 Posts 1 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mike_student
    wrote on last edited by
    #1

    Hello,

    I have a small problem with Tumbler.
    When I am using tumbler with model then is everything fine. It shows me a tumbler with 1 column [0, 1, 2, 3, 4];

    Tumbler {
           id: tumbler1
           TumblerColumn  {
              model: 5
           }
    }
    

    But when I am trying to add Delegate to add 1 to each value ( [1, 2, 3, 4, 5] ) to TumblerColumn, then TumblerStyle is being lost and everything looks awful.

    Tumbler {
          id: tumbler2
          TumblerColumn  {
               model: 5
               delegate: Text {
                     text: styleData.value + 1
               }
          }
    }
    

    is there any specific trick to solve that issue?
    Thank you in advance!

    M 1 Reply Last reply
    0
    • M mike_student

      Hello,

      I have a small problem with Tumbler.
      When I am using tumbler with model then is everything fine. It shows me a tumbler with 1 column [0, 1, 2, 3, 4];

      Tumbler {
             id: tumbler1
             TumblerColumn  {
                model: 5
             }
      }
      

      But when I am trying to add Delegate to add 1 to each value ( [1, 2, 3, 4, 5] ) to TumblerColumn, then TumblerStyle is being lost and everything looks awful.

      Tumbler {
            id: tumbler2
            TumblerColumn  {
                 model: 5
                 delegate: Text {
                       text: styleData.value + 1
                 }
            }
      }
      

      is there any specific trick to solve that issue?
      Thank you in advance!

      M Offline
      M Offline
      mike_student
      wrote on last edited by mike_student
      #2

      @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

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved