英文:
styleSheet QComboBox QListView not working after convert UI to PY
问题
以下是您要翻译的内容:
"I created my first UI using Qt Designer and convert UI to PY. The styleSheets QComboBox QListView
and QComboBox QAbstractItemView
are not working after converting. But in Qt Designer all styleSheet QComboBox
is working. I using Python 3.9.13 and PyCharm Community Edition."
在Qt Designer中创建了我的第一个用户界面并将其转换为PY。在转换后,QComboBox QListView
和QComboBox QAbstractItemView
的样式表不起作用。但在Qt Designer中,所有QComboBox
的样式表都有效。我使用Python 3.9.13和PyCharm Community Edition。
QComboBox {
border: 2px solid #0d7377;
border-radius: 20;
padding: 10px;
color: #eeeeee;
}
QComboBox::drop-down {
border: 0px;
}
QComboBox::down-arrow {
image: url(:/iconic/arrow.png);
width: 14px;
height: 14px;
margin-right: 15px;
}
QComboBox QAbstractItemView {
selection-background-color: #1a1a1a;
selection-color: #eeeeee;
}
QComboBox QListView {
border: 2px solid #0d7377;
border-radius: 15;
padding: 10px;
color: #0d7377;
outline: 0px;
}
我尝试逐行删除QComboBox QListView
和QComboBox QAbstractItemView
样式表中的内容,以了解哪一行导致错误,但没有得到结果。
英文:
I created my first UI using Qt Designer and convert UI to PY.
The styleSheets QComboBox QListView
and QComboBox QAbstractItemView
are not working after converting.
But in Qt Designer all styleSheet QComboBox
is working.
I using Python 3.9.13 and PyCharm Community Edition.
QComboBox {
border: 2px solid #0d7377;
border-radius: 20;
padding: 10px;
color: #eeeeee;
}
QComboBox::drop-down {
border: 0px;
}
QComboBox::down-arrow {
image: url(:/iconic/arrow.png);
width: 14px;
height: 14px;
margin-right: 15px;
}
QComboBox QAbstractItemView {
selection-background-color: #1a1a1a;
selection-color: #eeeeee;
}
QComboBox QListView {
border: 2px solid #0d7377;
border-radius: 15;
padding: 10px;
color: #0d7377;
outline: 0px;
}
I only tried delete one at a time line in styleSheets QComboBox QListView
and QComboBox QAbstractItemView
in PyCharm to understand which line gives the error, but it did not give results.
答案1
得分: 0
使用属性编辑器更改组合框中的任何字体会破坏其正常操作。在样式表中更改字体:
QComboBox {
font: bold 12pt "Microsoft YaHei";
border: 2px solid #0d7377;
border-radius: 20;
padding: 10px;
color: #eeeeee;
}
英文:
Any font change in Combobox using the properties editor breaking normal its operation. Change the font in the style sheet
QComboBox {
font: bold 12pt "Microsoft YaHei";
border: 2px solid #0d7377;
border-radius: 20;
padding: 10px;
color: #eeeeee;
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论