Any Qt Shape Widgets packages?



  • Hi, all:

    I'm just wondering is there any open packages I can use directly:

    1. Shape class ---- better 2D and 3D
      a) drag any shape into a QGraphicsView ( I did it already)
      b) drag and click/select for some specific shapes: for example, for a line2d, I can drag the line ends to wherever I want to drop. for an circle, I can drag to change the radius; for a rectangle, I can drag to change the width and height, etc.

    Particularly for Shape class, I'm so expecting to avoid writing everything from scratch by my own. I guess there must be some open staffs already. Can anybody give me some hints?

    Cheers
    Pei



  • The "shape class" would be a QPainterPath, but it is not a widget, widgets are rectangle in geometry, yo can still paint pretty much anything inside of a widget. QPainterPath can draw a wide range of curves, shapes, fills, strokes and so on...



  • [quote author="jiapei100" date="1362649607"]
    b) drag and click/select for some specific shapes:......... for an circle, I can drag to change the radius; for a rectangle, I can drag to change the width and height, etc.

    Particularly for Shape class, I'm so expecting to avoid writing everything from scratch by my own. I guess there must be some open staffs already. Can anybody give me some hints?
    [/quote]

    I also wanted similar thing months ago... though it wasn't really a direct solution, I was able to find an "inactive" implementation for resizing QGraphicsRectItem and QGraphicsEllipseItem without subclassing the item itself.

    You can find my fork that I "modified" at "sizegripitem":https://github.com/Code-ReaQtor/sizegripitem
    You can find the original implementation at "sizegripitem":https://github.com/cesarbs/sizegripitem


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.