首页| 论坛| 消息

标题:关于QComboBox鼠标点击时,出现选项错位的现象
作者:lwei24
日期:2021-03-09 09:41
内容:

各位大佬,请问为什么QComboBox点击选项时,选项会出现错位的现象呢?具体代码如下:
m_labelLanguage = new QLabel(LABEL_SOFTWARE_LANGUAGE_INFO, this);
m_labelLanguage->setAlignment(Qt::AlignCenter);
m_labelLanguage->setStyleSheet("QLabel{border-radius:0px;background-repeat:no-repeat;border:none;color:black;font:14px ""SimHei"";}");
m_labelLanguage->resize(this->width()*30/100, this->height()*20/100);
m_labelLanguage->move(this->width()*5/100, this->height()*23/100);
m_comboLanguage = new QComboBox(this);
m_comboLanguage->setStyleSheet("QComboBox{font-family:'SimHei';font-size:9; border:1px solid lightgray;}"
"QComboBox QAbstractItemView::item {min-height: 16px;}"
"QComboBox::drop-down{border-left-width: 1px;border-left-color: lightgray;border-left-style: solid; border-top-right-radius: 3px;border-bottom-right-radius: 3px;subcontrol-origin: padding;subcontrol-position: top right; width:20px;}"
"QComboBox::down-arrow{image:url(:/res/pwd/arrowDown01.png)}"
&nbs ..

回复 发表
主题 版块