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. How to replace text with picture
QtWS25 Last Chance

How to replace text with picture

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 541 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.
  • A Offline
    A Offline
    av2306
    wrote on last edited by
    #1

    Hi,

    Model View for List view. Used delegate to customize list item.

    List item has 4 labels with text which will receive from model.

    With new requirement, I have to show image for second label under some condition.

    Is it possible to replace text with image inside label?

    How to add "if" conditions inside label of qml file? (no clue for me)

    Any inputs.

    Thanks.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      av2306
      wrote on last edited by
      #2

      solved it by handling from model. added new role (bool) to display text or image.

      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