May 19, 2011

moo1 moo1
Lab Rat
33 posts

[solved] How to change line spacing in Flow?

 

Does anyone know if it is possible to change line spacing in Flow element? As far as I understood, spacing property is to set the gap between items, but not the gap between lines.

6 replies

May 20, 2011

situ117 situ117
Lab Rat
42 posts

If there is no direct way to do it, you can try it by leaving some dummy space with each item. For e.g.

  1. import QtQuick 1.0
  2.  
  3. Rectangle {
  4.     width: 50
  5.     height: 300
  6.    
  7.    
  8.     Flow {
  9.         width: 50
  10.         Item {
  11.             width: 50; height: 60 //Extra height
  12.             Rectangle {
  13.                 height: 50
  14.                 width: 50
  15.                 color: "blue"
  16.             }
  17.         }
  18.        
  19.        
  20.         Item {
  21.             width: 50; height: 60
  22.             Rectangle {
  23.                 height: 50
  24.                 width: 50
  25.                 color: "black"
  26.             }
  27.         }  
  28.        
  29.     }
  30. }

So there is a difference of 10 between each line.

May 20, 2011

moo1 moo1
Lab Rat
33 posts

Thanks for the workaround. It worked for me! In my case, I wanted to shrink the line spacing, but the same trick to adjust items’ height worked.

Still, it’s nice to have a dedicated property – e.g. “linespacing”.

May 20, 2011

situ117 situ117
Lab Rat
42 posts

Glad it worked for you ! Please mark the post as solved.

May 20, 2011

moo1 moo1
Lab Rat
33 posts

To change to “solved”, is there any button to press to change the status, or manually edit the title?

May 20, 2011

mario mario
Lab Rat
240 posts

Just add a tag “solved”, that’s it

May 22, 2011

Denis Kormalev Denis Kormalev
Lab Rat
1654 posts

Also it will be good to add [solved] to title. Manually of course

 
  ‹‹ how to change mouse message routing?      QML ListView multiple delegates ››

You must log in to post a reply. Not a member yet? Register here!