Questions tagged [qcheckbox]

A QCheckBox is a GUI class from the Qt toolkit which provides a checkbox with a text label.

A QCheckBox is an option button that can be switched on (checked) or off (unchecked). Checkboxes are typically used to represent features in an application that can be enabled or disabled without affecting others.

The official documentation for this Qt class can be found here

175 questions
24
votes
4 answers

How to make QCheckBox readonly, but not grayed-out

Any good way to make a checkbox readonly, but also not grayed-out (hardly visible). I have used setEnabled(bool) which works, but the checkbox then is grayed-out and hardly readable I can react on a toggle signal and reset the state. But I would…
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
24
votes
7 answers

Qt5 - setting background color to QPushButton and QCheckBox

I'm trying to change the background color of a QAbstractButton (either a QPushButton or QCheckBox) in Qt5 and having zero luck. This does nothing: pButton->setAutoFillBackground(true); QPalette palette =…
Betty Crokker
  • 3,001
  • 6
  • 34
  • 68
22
votes
3 answers

Increase check box size not its text using QCheckbox?

How do I increase the size of the check box for the QCheckBox control and not the text size? Thanks.
Bokambo
  • 4,204
  • 27
  • 79
  • 130
14
votes
8 answers

Qt - Centering a checkbox in a QTable

In QtCreater I added a table to my project. in my code I am generating some data to output into the table. I want to add a QCheckbox into each row to allow the row to be selected. All the content of the table is aligned left, how do I make only…
Mitch
  • 519
  • 2
  • 7
  • 16
11
votes
5 answers

QCheckbox/QRadioButton line wrap Qt4.6.0

I'm trying to have a multi-line checkbox/radiobutton with Qt using standard QCheckbox/QRadioButton. I didn't find the direct solution since QRadioButton{wrap:true;} has no effect. The only thing possible would be to access to the…
Boris Gougeon
  • 864
  • 2
  • 11
  • 23
9
votes
3 answers

Set widget background color

I use QCheckBox in QTableWidgetCell QWidget *widget = new QWidget(); QCheckBox *checkBox = new QCheckBox(); QHBoxLayout *layout = new…
Ufx
  • 2,595
  • 12
  • 44
  • 83
9
votes
3 answers

QCheckBox: how to differentiate between user-induced changes to state and those made programmatically?

Do I miss something or there is really no (ready / built-in) way to programmatically change the state of a QCheckBox without emitting the "void stateChanged ( int state )" signal? The above-mentioned signal is emitted regardless of whether "void…
mlvljr
  • 4,066
  • 8
  • 44
  • 61
8
votes
4 answers

QT - uncheck check box

Guys please let me know how to uncheck the check box using QT C++.
CrazyCoder
  • 2,465
  • 8
  • 36
  • 57
7
votes
2 answers

Checkbox selection in QListView

I developed a simple dialog with a checkbox, which allows the user to select one or several items from a list. Besides the standard OK and Cancel buttons, it adds Select All and Unselect All buttons, allowing the user to check/uncheck all items at…
maurobio
  • 1,480
  • 4
  • 27
  • 38
7
votes
6 answers

checkbox and itemdelegate in a tableview

I'm doing an implementation of a CheckBox that inherits from QitemDelegate, to put it into a QTableView. the problem is that I get when inserted flush left and I need it centered. As I understand the method that is responsible for the Paint. I have…
jackajack
  • 153
  • 1
  • 1
  • 11
7
votes
4 answers

how to change QCheckBox text label color in Qt?

I'm unable to change the color of Qcheckbox in QT, can somebody help me with code to change color of check box text label. I have tried Qpalette.. And im using QT4.7.4 version..
sai
  • 155
  • 2
  • 2
  • 10
6
votes
2 answers

QTableWidget, centering cellWidgets

Is there a way to place QCheckBox as a cell widget of QTableWidget in the center of a cell, not at the left side, without additional QWidget and adding the checkbox to it's layout?
6
votes
2 answers

Increase space between text and checkbox in Qt

If you set a fixed checkbox size, the text will be aligned to the checkbox itself. With the standard layout direction, the text will start right after the box, and with right-to-left layout it will end right before the box, just like this (the…
SingerOfTheFall
  • 29,228
  • 8
  • 68
  • 105
5
votes
1 answer

Editable checkbox only column in QTableView

I have column with a checkbox in a QTableView. The checkbox is generated by: returning Qt::ItemIsUserCheckable in overridden flags member function in overridden data() function I return a Qt::CheckState for role == Qt::CheckStateRole according to…
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
4
votes
1 answer

How to set QCheckBox checked area stylesheet?

I want to show QCheckBox on black background. I don't want add images to .qrc to configure my own style. I wants to configure style only with .qss. When i try to change the background, all (expect area of checked rect) shows ok So, with my style.qss…
chabapok
  • 921
  • 1
  • 8
  • 14
1
2 3
11 12