Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to set dashed border in QML?
Qt 6.12 LTS is out! See what's new in the release blog

How to set dashed border in QML?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 5.0k Views 1 Watching
  • 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
    madoodia
    wrote on last edited by
    #1

    hi guys
    i have a little question.
    i have a rectangle in QML and i want to set a dashed border for it (not solid border)
    what should i do?
    if i should use CSS in QML please tell me how should i use CSS in QML?

    thanks.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
      wrote on last edited by
      #2

      There is not direct way of doing with existing construct. You can try own image using BorderImage or write your own rectangle using Canvas and onPaint signal handler

      Dheerendra
      @Community Service
      Certified Qt Specialist
      https://www.pthinks.com

      1 Reply Last reply
      0
      • M Offline
        M Offline
        madoodia
        wrote on last edited by
        #3

        i think it is possible with CSS, but i don't know the way..

        btw, thanks

        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
        • Unsolved