Results 1 to 2 of 2

Thread: adding graphical items circular

  1. #1
    Join Date
    Apr 2011
    Posts
    36
    Thanks
    3
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default adding graphical items circular

    hi,

    My app has 26 ballons(Graphical items) with A-Z as ballon text.
    i want to display these in circle in Graphical scene.
    i used setPos(::sin((i*6.28)/26)*200,::cos((i*6.28)/26)*200)

    it is displaying in circular but at the top of screen that too half cut.
    how can i display in middle of the GraphicsScene.

    thank u in advance
    hema

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: adding graphical items circular

    How do sine and cosine work? They oscillate from -1 to +1 around an origon, which is 0. If you want your circel of ballons to have another origin, you need to provide an offset to your positios, like this: setPos(::sin((i*6.28)/26)*200 + x_center,::cos((i*6.28)/26)*200 + y_center)

Similar Threads

  1. QListWidget, help adding new items.
    By JeremyRussell in forum Newbie
    Replies: 4
    Last Post: 6th April 2011, 23:54
  2. Adding new items to model (MVC)
    By Urvin in forum Qt Programming
    Replies: 1
    Last Post: 7th November 2010, 07:54
  3. QListView - adding items
    By creep33 in forum Qt Programming
    Replies: 3
    Last Post: 9th September 2010, 17:30
  4. Circular wrapping of QListWidget items - how to?
    By slscripters in forum Newbie
    Replies: 8
    Last Post: 26th May 2010, 07:35
  5. adding items in qtablewidget
    By Djony in forum Qt Programming
    Replies: 17
    Last Post: 24th November 2006, 10:03

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.