Results 1 to 2 of 2

Thread: How to disable one combo box when another combo box changes its value using Delegate

  1. #1
    Join Date
    Jun 2013
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default How to disable one combo box when another combo box changes its value using Delegate

    Hi Every one ,

    I am new to QT and trying to use QTableView. My table's two columns are having combo box.

    I am using a class derived from QItemDelegate to add combo box to particular column.

    Now my requirement is, when I change combo box of column 3 (from "read only" to "No access"), combo box of column 4 must be disabled.

    Please see the attached image for table layout.

    Table.jpg

    Can somebody help me how can I achieve this?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to disable one combo box when another combo box changes its value using Deleg

    One option is to have an item role for column 4 that can retrieve the enabled/disabled state.
    When you model receives new data for column 3 it checks if that changes the enabled/disabled data for column4 and if yes emits data changed for that column as well.

    Cheers,
    _

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

    alfaalfa (12th June 2013)

Similar Threads

  1. Value from combo box to LCD
    By dayo30 in forum Qwt
    Replies: 4
    Last Post: 1st February 2013, 01:40
  2. How to create Combo box using QML in Qt
    By Channareddy in forum Newbie
    Replies: 0
    Last Post: 4th July 2011, 06:47
  3. Replies: 1
    Last Post: 29th June 2010, 18:59
  4. inserting combo box in table ..
    By wagmare in forum Qt Programming
    Replies: 3
    Last Post: 2nd June 2009, 08:42
  5. DropDown combo box
    By Tavit in forum Qt Programming
    Replies: 3
    Last Post: 3rd May 2008, 09:40

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.