Results 1 to 6 of 6

Thread: circle in QML

  1. #1
    Join Date
    Aug 2012
    Posts
    30
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default circle in QML

    Hi,
    I have a text object in my QML file. What I am trying to do is that I want this text file to appear with a circle shape on my simulator. Any ideas how? beacuse I tried rotating it using path object but I couldn't make it

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: circle in QML

    Play with the Rectangle's radius property.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

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

    jeff28 (27th August 2012)

  4. #3
    Join Date
    Aug 2012
    Posts
    30
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: circle in QML

    I tried that great idea. But my text does not take the shape of the circle. I put my Text in my Rectangle too. If I am not clear please try to think that I would like to make my border from a text object

  5. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: circle in QML

    I see. I doubt that there is an "easy" way to do this. I can suggest two options:
    1. You can look at ShaderEffectItem
    2. or you can dynamically create Text element for a single character and place it into correct place (that all characters will produce a circle). See Dynamic Object Management in QML.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  6. #5
    Join Date
    Aug 2012
    Posts
    30
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: circle in QML

    Thank you I am looking to these things right away


    Added after 46 minutes:


    You are right those are not easy. Is it possible if I could use my .qml in a .cpp file and use QPainter to handle this problem?
    Last edited by jeff28; 27th August 2012 at 15:22.

  7. #6
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: circle in QML

    Sure, you can create your own QML components. See Extending QML Functionalities using C++.
    ...
    For visual element types, this will usually mean a subclass of QDeclarativeItem.
    ...
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. how to draw a circle using qml
    By hema in forum Qt Quick
    Replies: 2
    Last Post: 8th August 2016, 13:48
  2. draw a circle
    By NewLegend in forum Qt Programming
    Replies: 3
    Last Post: 13th October 2010, 17:01
  3. Coloring Circle
    By Jeneo W. in forum Qt Programming
    Replies: 1
    Last Post: 11th October 2010, 05:39
  4. help regarding circle
    By jjbabu in forum Qt Programming
    Replies: 2
    Last Post: 20th September 2007, 11:23
  5. What is the fastest way to draw a circle ?
    By Vladimir in forum Qt Programming
    Replies: 18
    Last Post: 6th September 2007, 18:26

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.