Results 1 to 4 of 4

Thread: Model/Views Woes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: Model/Views Woes

    Quote Originally Posted by Scorp1us View Post
    1) I don't know how to implement the wrapping in a view
    Implement visualRect() so that it returns a rectangle where each index should be positioned. You'll have to calculate the position based on the width of the viewport and size of all items prior to the one which you calculate the position for.

    2) I don't know how to provide the mini-widgets for editing. I can draw them in the delegate's paint() just fine, but it'd be a manual process determining if a mini-widget was clicked.
    Yes, you should draw the controls in paint() and handle clicks in editorEvent() - process mousePress events and check the position of the cursor against the region occupied by a particular "mini widget". Then you can emit a signal or do whatever else you want.

  2. #2
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Model/Views Woes

    I found the "Advanced Item Views" presentation from TT Dev Days 2006 very useful:
    http://www.trolltech.com/company/new...006/videolinks
    You can download the source code directly. Check out the action delegate example:
    Attached Images Attached Images

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

    stevey (8th February 2007)

  4. #3
    Join Date
    Aug 2006
    Posts
    26
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Model/Views Woes

    Hey Spud,

    Thanks for the sweet link. I'll be lucky if I can get to bed by 5 am now .

Similar Threads

  1. OCI w/ VS 2003 woes...
    By croftj in forum Installation and Deployment
    Replies: 5
    Last Post: 7th February 2007, 10:28
  2. MySql Stored Procedures Woes
    By stevey in forum Qt Programming
    Replies: 9
    Last Post: 19th October 2006, 12:58
  3. QGridLayout woes
    By para in forum Newbie
    Replies: 3
    Last Post: 16th October 2006, 22:41
  4. Plugin woes
    By stevey in forum Qt Programming
    Replies: 8
    Last Post: 24th July 2006, 01:30

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.