Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2428

Subclassing QComboBox

    XMLWordPrintable

Details

    Description

      Imagine the following scenario: one wants to add history collection of the user's choices through a combo box.
      Unfortunately, since setCurrentIndex() isn't virtual, there is no simple way to add a new choice to the history when the index is set.

      Some tricks can be done, like overriding hidePopup(), but it is done before the new index is set and it is pointless.
      The activated() signal can be intercepted, but that's no good either.
      If several objects are listening to this signal too, since they may intercept it earlier, they won't get the most recent history and that is unacceptable.

      Some more virtual methods would be useful, so QComboBox could inherited and allow the creation of a nice and elegant class.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes