Results 1 to 2 of 2

Thread: align center in qml

  1. #1
    Join Date
    Oct 2015
    Posts
    46
    Thanks
    19
    Platforms
    Windows

    Default align center in qml


  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: align center in qml

    If you want to center an item into another item both vertically and horizontally, use
    Qt Code:
    1. anchors.centerIn: otherItemsId
    To copy to clipboard, switch view to plain text mode 
    for example centering inside the parent
    Qt Code:
    1. Item {
    2. Item {
    3. anchors.centerIn: parent
    4. }
    5. }
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    ravandi (23rd November 2015)

Similar Threads

  1. Align WindowTitle text to the Center in Windows 10
    By santosh.kumar in forum Qt Programming
    Replies: 3
    Last Post: 6th November 2015, 16:53
  2. Align text and icon of QToolButton on center
    By bibhukalyana in forum Qt Programming
    Replies: 7
    Last Post: 24th November 2014, 13:46
  3. Qwt, Align content to center
    By Asting in forum Qwt
    Replies: 3
    Last Post: 18th June 2014, 12:06
  4. Replies: 2
    Last Post: 23rd February 2010, 08:52
  5. How to align list items to the center?
    By zgulser in forum Qt Tools
    Replies: 4
    Last Post: 9th February 2009, 10:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.