侧边栏壁纸
博主头像
三味的小站 博主等级

世界上没有偶然,有的只是必然的结果。

  • 累计撰写 63 篇文章
  • 累计创建 14 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录
Qt

QComboBox样式表:字体、图标、项高

三味线
2018-04-18 / 0 评论 / 0 点赞 / 62 阅读 / 0 字
QComboBox *cmBox = new QComboBox();
cmBox->setStyleSheet("QComboBox{font-family:'微软雅黑';font-size:9; border:1px solid lightgray;}"
    "QComboBox QAbstractItemView::item {min-height: 20px;}"
    "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(:/FlightSimCaptain/Resources/down_arrow.png)}"
    "QComboBox::down-arrow:hover{image:url(:/FlightSimCaptain/Resources/down_arrow_press.png)}"
    "QComboBox::down-arrow:pressed{image:url(:/FlightSimCaptain/Resources/down_arrow_press.png)}");
cmBox->addItem("04");
cmBox->addItem("22");
QStyledItemDelegate *delegate = new QStyledItemDelegate(this);
cmBox->setItemDelegate(delegate);

0

评论区