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

Can't view checkbox in QComboBox on Ubuntu

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 4.8.5
    • GUI: Look'n'Feel
    • None
    • Ubuntu 12.04

    Description

      I try to display checkbox in a combobox. So I've write some code like this :

       
      #include <QtGui/QApplication>  
      #include <QtGui/QStandardItemModel>  
      #include <QtGui/QComboBox>  
        
      int main(int argc, char *argv[])  
      {  
          QApplication a(argc, argv);  
        
          QStandardItemModel *model = new QStandardItemModel();  
        
        
          for (int i =0; i < 5 ; i++)  
          {  
              QStandardItem* item = new QStandardItem(QString("item %1").arg(i));  
              item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);  
              item->setData(Qt::Unchecked, Qt::CheckStateRole);  
              model->setItem(i, 0, item);  
          }  
        
          QComboBox *comboBox = new QComboBox();  
          comboBox->setModel(model);  
          comboBox->show();  
        
          return a.exec();  
      }  
      

      The checkboxes are correctly displayed on Windows or Kubuntu but not on Ubuntu (12.10). If I change the default style to Plastique or Motif, the checkbox are displayed. A bug in the GtkStyle ?

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              xbee x Bee
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes