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

QStyledItemDelegate with QComboBox doesn't work on OS X

XMLWordPrintable

    • macOS

      This ComboBox delegate won't open the list of options when clicking on it instead it just changes cell focus. Issue can be seen at least on OS X.

      class ItemDelegate: public QStyledItemDelegate
      {
      public:

      ItemDelegate(QTreeWidget* parent)
      : QStyledItemDelegate(parent)
      {}

      QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
      {
      if (index.column() == 1)

      { QComboBox *pComboBox = new QComboBox(parent); pComboBox->addItem("Hello"); pComboBox->addItem("World"); return pComboBox; }

      return NULL;
      }
      }

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

            tpochep Timur Pocheptsov
            kileppal Kimmo Leppälä
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes