Problems with blank space in the list widget
Solved
General and Desktop
-
There is white space in the list widget.
What should I do in this case? Because I put the list widget inside the frame, it should look stretched.
Click in the margin to make a selection as well.for (int i = (int)cModelCommon::CELL_TYPE::Single; i < (int)cModelCommon::CELL_TYPE::Max; i++) { QSize btnSize(30, this->size().height() * 11 / 100); QListWidgetItem* pItem = new QListWidgetItem(this->ui.listWidget); usrCellTypeButton* pBtn = new usrCellTypeButton(this); { pBtn->setMinimumSize(btnSize); pBtn->setFont(cGlobalParam::gGetCellTypeFont()); pBtn->SetBtnID(i); pBtn->setCheckable(true); if( i == (int)cModelCommon::CELL_TYPE::Single || i == (int)cModelCommon::CELL_TYPE::Multi ) pBtn->SetTitle(m_pModelInfo->EnumtoStringCellType((cModelCommon::CELL_TYPE)i)+" Cell"); else pBtn->SetTitle(m_pModelInfo->EnumtoStringCellType((cModelCommon::CELL_TYPE)i)); m_pBtnGroup->addButton(pBtn, i); } pItem->setSizeHint(btnSize); this->ui.listWidget->addItem(pItem); this->ui.listWidget->setItemWidget(pItem, pBtn); }