Results 1 to 5 of 5

Thread: Put figure in a grid

  1. #1
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Put figure in a grid

    I'd like to write an application(QMainWindow) where i have some geometric figure on a toolbar that i can drag and drop on central widget.
    What kind of widget (or QPaintDevice in general) can i put as central widget?
    The central widget may contain a grid(i'd like to riceive the x,y coordinate), where i can move my object(rectangle, square) throw it.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Put figure in a grid

    Did you see the Drag and Drop Puzzle Example?
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    21
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Put figure in a grid

    Or you could use QGraphicsView, take a look at Diagram Scene

  4. #4
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Re: Put figure in a grid

    I looked Qgraphview and Qgraphscene and i'd like to have a simplest kind of widget where i can drag and drop my Rectangolar object.
    I also desire a grid:
    . . . . . . . . . . . . .
    . . . . . . . . . . . . .
    . . . . . . . . . . . . .
    . . . . . . . . . . . . .
    . . . . . . . . . . . . .
    . . . . . . . . . . . . .
    . . . . . . . . . . . . .
    . . . . . . . . . . . . .

    where i can move my geometric figure and resize it....(my figure have to follow just the points on the grid.....)
    Any idea?

  5. #5
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Put figure in a grid

    You pretty much described a typical use case for the graphics view framework.

    You could do it without graphicsview, but why go to the extra work?

Similar Threads

  1. Replies: 3
    Last Post: 13th September 2007, 10:29
  2. "Lay Out in a Grid" - how to see the grid?
    By will49 in forum Qt Tools
    Replies: 1
    Last Post: 25th July 2007, 20:09
  3. How to fill the blocks of the Grid one by one?
    By merry in forum Qt Programming
    Replies: 1
    Last Post: 6th June 2007, 12:20
  4. Grid Problem
    By merry in forum Qt Programming
    Replies: 2
    Last Post: 6th June 2007, 10:40
  5. How do I move a widget inside a grid Layout
    By barnabyr in forum Newbie
    Replies: 1
    Last Post: 8th May 2006, 23:23

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.