Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Text Alignment
Qt 6.12 LTS is out! See what's new in the release blog

Text Alignment

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

    How to align Text without giving hard code value like (anchors.leftMargin: 10)?
    So that when screen size increases it maintains the exact left and top margin.

    J.HilkJ 1 Reply Last reply
    0
    • J JasmineSethi

      How to align Text without giving hard code value like (anchors.leftMargin: 10)?
      So that when screen size increases it maintains the exact left and top margin.

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @JasmineSethi by assigning a ratio depending on width/height ?

      anchors.leftMarging: parent.width /20
      

      You have to use the parent width, as the own width is calculated after reducing margins, which than would result in a binding loop.


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      2

      • Login

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