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

Custom popup view of QComboBox does not work correctly on Mac os X and GTK

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • 5.0.0
    • 4.5.0
    • GUI: Look'n'Feel
    • None
    • macOS

    Description

      Setting a QTreeView or QTableView as the popup of QComboBox gives an bad result on Mac OS X, GTK or with the CleanLooks style. Navigation in the view is not possible horizontally and the size of the popup is ignored.

      Here is an example to reproduce the problem:

      #include <QtGui>
      
      int main(int argc, char **argv){
        QApplication app(argc, argv);
        QTreeView *tree = new QTreeView();
        QStandardItemModel model(50, 4);
        for (int row = 0; row < 50; ++row) {
          for (int column = 0; column < 4; ++column) {
            QStandardItem *item = new QStandardItem(QString("row %0, column %1").arg(row).arg(column));
            model.setItem(row, column, item);
           }
        }
        tree->setMaximumHeight(500);
        tree->setMinimumHeight(500);
        QComboBox combo;
        combo.setView(tree);
        combo.setModel(&model);
        combo.show();
        return app.exec();
      }
      

      Attachments

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

        Activity

          People

            bachewii Jens
            poulain Benjamin Poulain (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes