Results 1 to 10 of 10

Thread: how to mimic this functionality with Qt

  1. #1
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    2
    Thanked 6 Times in 6 Posts

    Question how to mimic this functionality with Qt

    Hi !
    (first off... sorry for my poor english)

    I love the way "tablewidgets" works in Microsoft Money... and I would like to mimic his functionality...
    (Microsoft Money is free... you can download here and see it by yourself: http://www.microsoft.com/money/sunset.mspx)

    In this screenshot you can see what I want:
    money.gif
    you can see a normal "tablewidget"... only showing the most important fields... but when you press enter (or you click in a specific row), that row "expand"... and you can easilly edit that record (showing all the fields).

    Any idea of how to accomplish that with Qt?

    (as you can see in the screenshot is not a borderless window in from of the list... -the row expand-)

    thank you very much

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to mimic this functionality with Qt

    I think you'll need to show a before and after screenshot, so we can see clearly what you mean by "the row expand".

    But I think you should read up on Qt delegates.

  3. #3
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    2
    Thanked 6 Times in 6 Posts

    Default Re: how to mimic this functionality with Qt

    the screenshot is a before and after example

    in the top screenshot you can see 3 rows...
    in the bottom screenshot you can see how the second row is expanded.

    I think that is not possible with delegates...

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

    Default Re: how to mimic this functionality with Qt

    If I read the screenshot correctly then what really happens in the program you mention is that the table does not expand but rather it is covered by a separate widget containing all the fields to be edited and I doubt it is done automatically. To do the same in Qt when someone request to edit a row create a widget that is a child of the table view's viewport(), have it contain widgets for editing all the fields you want and position it in the viewport using QWidget::setGeometry(), move() or equivalent. To find out where to position the widget you can use QAbstractItemView::visualRect() to find the rectangle occupied by the row that is to be edited.
    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.


  5. #5
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    2
    Thanked 6 Times in 6 Posts

    Default Re: how to mimic this functionality with Qt

    thanks...

    I follow your instructions in the Qt's Address Book example... and yes... you can mimic the same effect with that.


  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to mimic this functionality with Qt

    Now I understand your screenshot, and I would agree with wysota - it seems a widget is carefully positioned underneath the row for easy editing of the fields.

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

    Default Re: how to mimic this functionality with Qt

    And to be honest I would call it a bad UI design. For me this should obviously be a plain dialog window.
    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.


  8. #8
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    2
    Thanked 6 Times in 6 Posts

    Default Re: how to mimic this functionality with Qt

    in my opinion is not a "standard" ui design... but it is more faster and convenience for the user...

    you can edit faster...
    less clicks...
    (anyway ms money offers -if you prefer- a dialog too... or in a panel below the list.... 3 differents way)


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

    Default Re: how to mimic this functionality with Qt

    Quote Originally Posted by javimoya View Post
    in my opinion is not a "standard" ui design... but it is more faster and convenience for the user...
    It's not in any way faster than a dialog box that pops-up.

    less clicks...
    Really? How come? And what if you want to input a value based on the value in a row directly under the one you are currently editing?

    Standards are "standard" for a reason.
    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.


  10. #10
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to mimic this functionality with Qt

    If you are Microsoft (and the screenshot is from a Microsoft application), standards are meant to be broken, and then reinvented as the best way of doing something. Typically, people want to copy their practices.

    I don't know why you couldn't have that edit window underneath the the list of records and have it update as you move throughout the data. To me, that would be more user friendly. (Ie, the actual screenshot being almost exactly like the one posted, which I thought it was at first)

Similar Threads

  1. Tab functionality on Webpage
    By Fetch in forum Newbie
    Replies: 0
    Last Post: 29th November 2010, 19:01
  2. Functionality of QTableView
    By doberkofler in forum Qt Programming
    Replies: 3
    Last Post: 22nd March 2010, 08:56
  3. Qt and touch functionality
    By rishiraj in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 23rd February 2009, 21:29
  4. Playbutton functionality
    By uchennaanyanwu in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2008, 22:29
  5. spy++ like functionality with Qt / X11
    By bpetty in forum Newbie
    Replies: 3
    Last Post: 24th April 2007, 22:10

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
  •  
Qt is a trademark of The Qt Company.