Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. POLYGONS in QML
QtWS25 Last Chance

POLYGONS in QML

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 4.5k 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.
  • H Offline
    H Offline
    Harry443
    wrote on last edited by
    #1

    Hello,

    Is it possible to create a trapezium in QML?
    Is it through Box 2D or is there any other way in creating the trapezium shape?
    Can anyone convey me the memory size of Box2D library?

    Thanks in advance:)

    1 Reply Last reply
    0
    • T Offline
      T Offline
      task_struct
      wrote on last edited by
      #2

      Hello,

      It depends on what you want to do. If you want one or a few trapeziums that do not interact with other objects, you can use Image. If you want trapezium that can change its color, width, height and so on you should subclass "QDeclarativeItem":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeitem.html

      Also note that Box2D does not provide visual items.

      "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

      • Linu...
      1 Reply Last reply
      0
      • H Offline
        H Offline
        Harry443
        wrote on last edited by
        #3

        Thanks,
        But is there any method to create a simple trapezium (as if like a Rectangle where it takes WIDTH and Height and can fill color dynamically based on a condition) by using only QML??

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mlong
          wrote on last edited by
          #4

          Not by only using QML. As task_struct mentioned above, if you'd like that functionality, you'll have to create a custom QDeclarativeItem in C++ to do it.

          There's an example "here":http://www.developer.nokia.com/Community/Wiki/CS001627_-_Creating_a_custom_QML_element_with_Qt which shows how you can create a Line. You can apply the same principles to drawing your own custom object.

          Software Engineer
          My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

          1 Reply Last reply
          0

          • Login

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