Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML : If condition in delegate?
Forum Update on Monday, May 27th 2025

QML : If condition in delegate?

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.4k 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.
  • C Offline
    C Offline
    Craig27
    wrote on 23 Nov 2012, 12:25 last edited by
    #1

    I'm designing a spinner list control, which displays 3 items at a time.

    Its working fine as required behaviour the only issue am facing is I need the central element appearance little bigger.

    The approach which I can think as of now is to have an if condition in the delegate, which on the basis of current index increases the font size.

    Is the above approach is possible? Any suggestions to achieve the particular behaviour

    Below is the code snippet
    @SpinnerData {
    id: spinner
    focus: true
    model: 20
    delegate: Text { font.pixelSize: spinner.height/4.5; text: index; height: spinner.height }
    }@

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 23 Nov 2012, 12:34 last edited by
      #2

      Yes it should work.

      (Z(:^

      1 Reply Last reply
      0

      1/2

      23 Nov 2012, 12:25

      • Login

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