Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QComboBox of check boxes not rendering check boxes on linux but works properly on windows
Qt 6.11 is out! See what's new in the release blog

QComboBox of check boxes not rendering check boxes on linux but works properly on windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 827 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zetsil
    wrote on last edited by
    #1

    I have the following function that creates a QComboBox of checkboxes :

    this->Model = new QStandardItemModel;
    
       for(int i=0;i<SLIderbars->size();i++){
         this->Item1 = new QStandardItem;
         this->Item1->setText(m_sliderNames->itemText(i));
         this->Item1->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
         this->Item1->setData(Qt::Unchecked, Qt::CheckStateRole);
    
    
    
    
         this->Model->insertRow(i, this->Item1);
    
    
         this->Items.push_back(this->Item1);
        }
       connect(this->Model, SIGNAL(dataChanged ( const QModelIndex&, const QModelIndex&)), this, SLOT(slot_changed(const QModelIndex&, const QModelIndex&)));
    
         this->comboBox->setModel(this->Model);
    

    The code works how it supposed to work on windows but when I try to compile it on Linux the checkboxes are not visible.

    Can someone help me make the checkboxes render on Linux version?

    jsulmJ 1 Reply Last reply
    0
    • Z Zetsil

      I have the following function that creates a QComboBox of checkboxes :

      this->Model = new QStandardItemModel;
      
         for(int i=0;i<SLIderbars->size();i++){
           this->Item1 = new QStandardItem;
           this->Item1->setText(m_sliderNames->itemText(i));
           this->Item1->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
           this->Item1->setData(Qt::Unchecked, Qt::CheckStateRole);
      
      
      
      
           this->Model->insertRow(i, this->Item1);
      
      
           this->Items.push_back(this->Item1);
          }
         connect(this->Model, SIGNAL(dataChanged ( const QModelIndex&, const QModelIndex&)), this, SLOT(slot_changed(const QModelIndex&, const QModelIndex&)));
      
           this->comboBox->setModel(this->Model);
      

      The code works how it supposed to work on windows but when I try to compile it on Linux the checkboxes are not visible.

      Can someone help me make the checkboxes render on Linux version?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Zetsil said in QComboBox of check boxes not rendering check boxes on linux but works properly on windows:

      SLIderbars->size()

      What does it return on Linux?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      Z 1 Reply Last reply
      0
      • jsulmJ jsulm

        @Zetsil said in QComboBox of check boxes not rendering check boxes on linux but works properly on windows:

        SLIderbars->size()

        What does it return on Linux?

        Z Offline
        Z Offline
        Zetsil
        wrote on last edited by
        #3

        @jsulm The drop-down list is created dynamically after the size of how many slider bars(that work as a video player slider ) are .So it returns the size correctly.

        jsulmJ 1 Reply Last reply
        0
        • Z Zetsil

          @jsulm The drop-down list is created dynamically after the size of how many slider bars(that work as a video player slider ) are .So it returns the size correctly.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Zetsil said in QComboBox of check boxes not rendering check boxes on linux but works properly on windows:

          So it returns the size correctly

          Did you really check that?
          Like

              qDebug() << SLIderbars->size(); 
              for(int i=0;i<SLIderbars->size();i++){
          

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved