Results 1 to 3 of 3

Thread: tab order implementation

  1. #1
    Join Date
    Jul 2009
    Location
    Jordan, and UAE
    Posts
    55
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default tab order implementation

    hello all

    i have multiple QGraphicsPolygonItem items. i want the user to be able to order them by clicking on them by mouse, much like the tab order used in Qt Creator.

    My question is what is the best method to do this, should i create another graphics item, like a little square, and attach every item of them to the polygon items, and override the mouse click button to order them, or is there a better way you can suggest?

    thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: tab order implementation

    I think the idea you posted is the way to go. Remember that each of the small rects has to react slightly different: Moving only horizontal/vertical, adjust pos, adjust size and so on. I think you have a rect for any combination of them.
    It's nice to be important but it's more important to be nice.

  3. #3
    Join Date
    Jul 2009
    Location
    Jordan, and UAE
    Posts
    55
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: tab order implementation

    Hey axel

    Thanks for the reply, I did not a little differently though, I had 2 modes (view, and order), and instead of having small rects over the items, I added a QGraphicsSimpleTextItem item to the top left of each polygon item that contains the item order number, and its ONLY visible when we are in the order mode.

    for the ordering itself, I had 2 cases for the mouseReleaseEvent function, if its on the view mode, I let it do what it does, but if its on the order mode, I call my orderItem function to order the items,

    this solution works fine for me, and I can provide source code for the way I did the ordering itself

    regards, yazan

Similar Threads

  1. Tab order ignored in QGroupBox
    By adskol in forum Newbie
    Replies: 2
    Last Post: 5th April 2010, 05:42
  2. Attributes order in QDomElement
    By ixSci in forum Qt Programming
    Replies: 3
    Last Post: 21st August 2009, 13:52
  3. Correct Member Sheet Extension Implementation
    By PeeAeMKAy in forum Qt Programming
    Replies: 8
    Last Post: 17th July 2009, 15:47
  4. problem with order of libs during linking
    By minimax in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2008, 10:32
  5. Tab Order Settings in a QDialog widgets
    By vinnu in forum Qt Programming
    Replies: 10
    Last Post: 21st September 2006, 16:25

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.