Results 1 to 2 of 2

Thread: Changin look of QComboTableItem

  1. #1
    Join Date
    Nov 2006
    Posts
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Question Changin look of QComboTableItem

    I have a QTable for input data and calculate radiators for heating.
    In that table i use QComboTableItem's where the user can select the radiator to install. I would like that the QComboTableItem's looks like a single cell (only text, no controlls) when the focus leaves the cell and combo apears when the cell is focused. I remember have seen that behaviour for "combo cells" in other application.
    By other hand, how can i recalculate prices etc like spreadsheet when QComboTableItem is changed? QComboTableItem doesn't emit the activated signal

    This is my first post in this forum and i'm spanish, so sorry by my english
    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Changin look of QComboTableItem

    Quote Originally Posted by jseguraj View Post
    I would like that the QComboTableItem's looks like a single cell (only text, no controlls) when the focus leaves the cell and combo apears when the cell is focused.
    Then maybe you need a regular table item that uses QComboBox as an editor?

    You have to subclass QTableItem and reimplement QTableItem::createEditor() (there's an example in the docs that actually does what you want).

    Quote Originally Posted by jseguraj View Post
    By other hand, how can i recalculate prices etc like spreadsheet when QComboTableItem is changed? QComboTableItem doesn't emit the activated signal
    You can use QTable::valueChanged() signal.

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.