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. listwidgetitem check box style sheet not working

listwidgetitem check box style sheet not working

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 239 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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    Custom Controls
    5fd9bd12-3d43-4b74-911c-743f20c0a115-image.png

    I am working on putting a user control using listwidgetitem. I tried setStylesheet to increase the size of the checkbox, but it does not work properly, so I ask a question.

    void WToggleMenu::InitListitem()
    {
    	for (int n = 0; n < 20; n++)
    	{
    		usrCntrListItem* pListItem		= new usrCntrListItem(QString("%1").arg(n));
    
    		QListWidgetItem* pWidgetItem	= new QListWidgetItem(this->ui.listWidget);
    		pWidgetItem->setSizeHint(pListItem->sizeHint());
    
    		this->ui.listWidget->addItem(pWidgetItem);
    		this->ui.listWidget->setItemWidget(pWidgetItem, pListItem);
    	}
    }
    
    usrCntrListItem::usrCntrListItem(QString strTitle)
    {
    	ui.setupUi(this);
    
    	this->ui.text_Title->setText(strTitle);
    
    	this->ui.chk_Enable->setStyleSheet("\
    		QCheckBox::indicator\
    		{\
    			width: 50px;\
    			height: 50px;\
    		}");
    
    }
    

    5d31ee37-3350-4b7a-a6f6-e3e52f476684-1.gif

    I tried this and executed it, and although the size of the indicator in the view was the same, I was able to confirm that the area was changed when I actually clicked it.
    Please suggest a way to change the stylesheet of the indicator

    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