×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    323

    Post how to change the QCheckbox indicator size in QListwidget?

    Dear All,

    how to increase the QCheckbox indicator size in the QListwidget.?

    listwidget->setCheckState(Qt::Unchecked);
    with use of this i am adding the check box in my QListwidget but default size of Checkbox size is very low
    how to change checkbox indicator size in Qlistwidget?

    with use of below code we can possible to increase the indicator size of checkbox through UI stylesheet

    QCheckBox
    {
    spacing: 5px;
    font: 75 9pt "MS Shell Dlg 2";
    }
    QCheckBox::indicator
    {
    width: 30px;
    height: 40px;
    }

    but i need change in Listwidget how ? any one have idea about this?

  2. #2
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    323

    Re: how to change the QCheckbox indicator size in QListwidget?

    any one have idea about this?
    how to increase the QCheckbox indicator size in the QListwidget.?

  3. #3
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: how to change the QCheckbox indicator size in QListwidget?

    Hi,
    QListViewItem Checkboxes are not real widgets. They are just painted by the style. So setting a stylesheet to a QCheckBox cannot work.
    Hence in order to change the size of the the QListViewItem checkbox indicator you should set a stylesheet for QListView::indicator instead of your listWidget.

    QListView::indicator
    {
    background-color: red;
    width: 60px;
    height:60px;
    }

    Quote Originally Posted by damodharan View Post
    any one have idea about this?
    how to increase the QCheckbox indicator size in the QListwidget.?

  4. #4
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    323

    Re: how to change the QCheckbox indicator size in QListwidget?

    Quote Originally Posted by gnuton View Post
    Hi,
    QListViewItem Checkboxes are not real widgets. They are just painted by the style. So setting a stylesheet to a QCheckBox cannot work.
    Hence in order to change the size of the the QListViewItem checkbox indicator you should set a stylesheet for QListView::indicator instead of your listWidget.

    QListView::indicator
    {
    background-color: red;
    width: 60px;
    height:60px;
    }
    thx gnuton,
    but i used QListwidget for my application to display all my data with use of "QListWidgetItem" ,
    for each data i added one check box indicator in the leftside of the content in QListWidget with use of "QListWidgetItem" ,.

    i cant able to change into QListview now.. bcoz in my application more than 20 screens having QListWidget.

    u have any idea how to increase the size of checkbox indicator in QListwidget ?

  5. #5
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: how to change the QCheckbox indicator size in QListwidget?

    QListWidget is a subclass of QListView. Then you can apply to your QListWidgets the stylesheet I attached to my previous post.

    Quote Originally Posted by damodharan View Post
    thx gnuton,
    but i used QListwidget for my application to display all my data ,
    for each data i added one check box indicator in the leftside of the content in QListWidget.

    i cant able to change into QListview now.. bcoz in my application more than 20 screens having QListWidget.

    u have any idea how to increase the size of checkbox indicator in QListwidget ?

  6. #6
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    323

    Re: how to change the QCheckbox indicator size in QListwidget?

    Quote Originally Posted by gnuton View Post
    QListWidget is a subclass of QListView. Then you can apply to your QListWidgets the stylesheet I attached to my previous post.
    thx gnuton,
    i will check

Similar Threads

  1. Replies: 8
    Last Post: 2011-01-12, 06:12
  2. Push size of QListWidget
    By stegemann in forum Qt
    Replies: 5
    Last Post: 2010-10-19, 14:50
  3. Setting size of Indicator area
    By fonedev12 in forum Symbian User Interface
    Replies: 1
    Last Post: 2001-11-28, 21:25
  4. Setting size of Indicator area
    By fonedev12 in forum Symbian
    Replies: 1
    Last Post: 2001-11-08, 17:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×