I need to change how the checkable box of a QCHeckBox looks, and not simply with CSS, but with a texture file. The closest thing I found was changing the icon parameter of the widget.
But a) it doesn't update, and b) It is located after the box, which I'm actually trying to change.
Is it possible to change the checkbox itself?
Confusingly, those icon properties are associated with the QAbstractButton parent class, which doesn't have the concept of a checkbox icon. So they just add an icon to the label of the button, which results in the behaviour you describe.
To change the actual checkbox icon, the best option I've found is to use a stylesheet. All the gory details are here.
In summary, something like this will do as the QCheckBox's stylesheet:
QCheckBox::indicator:unchecked {
image: url(:/images/checkbox_unchecked.png);
}
QCheckBox::indicator:checked {
image: url(:/images/checkbox_checked.png);
Related
I'm using the latest version of Qt Designer to make a PyQt app. I can't find a way to change the font color of the items in the dropdown. As you can see from the image bellow the text is not easy to see.
This is my style sheet (QComboBox:items is not working)
Is it possible to change the color of the items in the dropdown?
The QComboBox is kind of like a QLineEdit(Active Selection), QPushButton(Down Arrow) and a QListView(Drop Down List) all together to make the QComboBox.
Within the css for the QComboBox you can call out these other PyQt objects and style them.
QComboBox{
color: rgb(110,209,255);
}
QComboBox:items{
color: rgb(110,209,255);
}
QListView{
color: rgb(110,209,255);;
}
Try adding the QListView css when you're setting the style sheet of the QComboBox and that should fix your issue.
I have a kivy dropdown menu and I can't get the width of the button to change. Does anyone know how to do this? I attached a photo of what the button looks like.
Here is the line where i add buttons:
self.drop_down.add_widget(Button(text=address, auto_width=False, size_hint=(None,None), height=self.height/15, width=self.width/2))
In the kv file dropdown class is empty but i have played around with various layouts to try to change the width but nothing i try works.
Changing the values for width seem to only change the label width where the text will move around on the button but the button itself wont change. The Widget is suppose to size itself to the parent width but that is not happening either. I found the value attach_to where my understanding is that i can specify what parent widget to hook to. Yet that didnt seem to change anything.
A normal dropdown list is different from a actiondropdown list and you modify the width in different ways. The way stated above is for a dropdown where you use auto_width set to False and then set width. But with an actiondropdown you use dropdown_width to modify the width.
Standart StatusBar image
<-- So, here it how it looks in my application now. How can I make the height of it smaller? For e.g. in Google Chrome when you pointing some link it shows in the grey bar at the bottom of the page, I want same size.
Chrome is not using a GtkStatusBar (or any other GTK widgets, for that matter).
If you want to change the appearance of a GTK widgets, you'll have to either tweak the theme or use a custom widget, with your own sizing policy.
I'm trying to write application in kivy. I would like it to have listview with custom row layout (label on top, below image scaled to window width and below some images, labels and button - see pic). Is it possible to do that with kivy.uix.listview? Or some other way? I was looking on docs but I couldn't find answer to my question.
Yes, it is written in docs here: Adapter
Use either cls or template property to link a customized widget to a list view.
Here you can see cls bound to ListItemButton. Put your own widget in its place.
I'm a beginner with QT/PyQt4, and I'm trying to make a QListView display custom objects.
It should :
Have custom row widgets that display more than one line of text, possibly images
Trigger a modal dialog instead of the inline edit field whenever I double-click on an item
A QItemDelegate seems like the right choice, but I can't figure out how to use it properly for either #1 or #2. Any ideas?