Results 1 to 2 of 2

Thread: Toolbox Architecture Question

  1. #1
    Join Date
    May 2009
    Posts
    63
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Toolbox Architecture Question

    Hi

    I'm fairly new to Qt. I've been messing around and having fun with QGraphics* objects for a couple of months. I now want to start doing some "standard" GUI work, but I don't know how to do this efficiently.

    What I'm basically trying to create is a main work area (QGraphicsScene/view) and a docked "toolbox". The toolbox contains shapes that can be dragged and dropped into the QGraphicsScene.
    The toolbox will contain more shapes than can fit into the toolbox. So I need a scroll area inside the toolbox.

    (Very standard + easy concept)

    I've gone off the rails because I suspect that there is an easy way to do this - Qt keeps surprising me with all the things that can be done in 4 or 5 lines of code, so now I have a bad case of "analysis paralysis". I'm spending a long time looking for those elusive 4-5 lines that will make my live so much easier, but I don't know where to look, or what to look for.

    From reading the docs, the architecture of the toolbox I think I need is this:

    QDockWidget
    contains QScrollArea
    contains a QWidget (what type of QWidget should I use?)
    containing 1 child QWidget for each shape

    Does this look right to you?
    Is there is a shortcut to obtaining this layout? Perhaps there is a specialized set of classes for this type of thing ("QImageListView" "QWidgetListView"?? - in my dreams!)

    Thanks for any pointers

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Toolbox Architecture Question

    Your concept is fine. You may substitute the part starting with QScrollArea with a QListView set into icon mode if you want. You'd probably want to manipulate the palette and frames to make it look more like a toolbox although the default look should be fine as well.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    jonks (9th July 2009)

Similar Threads

  1. Network Communication Architecture
    By mhoover in forum Qt Programming
    Replies: 2
    Last Post: 30th May 2009, 03:49
  2. put a toolbox
    By mickey in forum Newbie
    Replies: 4
    Last Post: 27th August 2006, 15:35

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.