Results 1 to 6 of 6

Thread: Create table and edit cells using popup dialog?

  1. #1
    Join Date
    Jul 2012
    Location
    UK
    Posts
    17
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Create table and edit cells using popup dialog?

    Dear Qt Programmers,

    I am a student and new to Qt. I really need your help urgently.

    In my application I have to create a table. Each cell of the table contains several values (basically a structure). The functionalities I need is similar to MS Excel, where if we left-clik on a cell a small window popups (attached image) which allows to set the properties of the cell.

    Basically what I want is a table and when I click a cell a dialog will popup. The dialog will show the currently set values (of the structure). Then I can change the values and submit also.

    Thanks





    xl-editor.png
    Last edited by saifulkhan; 24th October 2012 at 02:10.

  2. #2
    Join Date
    Jul 2012
    Location
    UK
    Posts
    17
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Create table and edit cells using popup dialog?

    The requirement is that I need a table. Each cell of the table contain a structure which basically holds the property of a symbol (Glyph). Each symbols property is editable. Please see the attached image.

    Now I have created custom QGraphicsView where I can click and edit the symbol. So I need those views to show in a table. Any suggestions on how to embed QGraphicsView in place of QTableWidget item?

    (Note: I shall be happy to acknowledge those who help me in my final report)
    Attached Images Attached Images

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Create table and edit cells using popup dialog?

    For when the cell is not being edited I would suggest rendering the current glyph state into a pixmap and setting that on the cell for display. You can use QStyledItemDelegate to provide a custom editor for the cell. You will need hold the QGraphicsScene for each glyph so the editor can get to it when invoked.

  4. The following user says thank you to ChrisW67 for this useful post:

    saifulkhan (25th October 2012)

  5. #4
    Join Date
    Jul 2012
    Location
    UK
    Posts
    17
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Create table and edit cells using popup dialog?

    thanks for your reply. sorry i should have mentined earlier. if I render it to pixmap then I can not see the animation. those glyphs has also animation property which I should be able to change with a popup widget. now if could insert a view inside the cell problem is solved. any suggestion please?

  6. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Create table and edit cells using popup dialog?

    You can use QAbstractItemView::setIndexWidget() but performance will not be great if you have 500 animated widgets in the table.

  7. The following user says thank you to ChrisW67 for this useful post:

    saifulkhan (25th October 2012)

  8. #6
    Join Date
    Jul 2012
    Location
    UK
    Posts
    17
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Create table and edit cells using popup dialog?

    Thanks very much for the solution. Nice solution. We shall acknowledge your help and looking forward to get your help in future too.

Similar Threads

  1. Can't edit my QTableView cells
    By MattPhillips in forum Newbie
    Replies: 4
    Last Post: 2nd February 2011, 13:49
  2. Replies: 5
    Last Post: 3rd April 2010, 04:07
  3. color of table cells
    By rickym in forum Qt Programming
    Replies: 1
    Last Post: 24th January 2007, 10:20
  4. how to create a popup dialog
    By Morea in forum Qt Programming
    Replies: 1
    Last Post: 19th November 2006, 16:40
  5. table with combobox cells
    By mgurbuz in forum Qt Programming
    Replies: 2
    Last Post: 10th May 2006, 12:12

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.