方法:
使用 QComboxBox::addItem(QIcon, QString);
示例:
-
QComboBox *combo_status = new QComboBox(this);
-
-
QIcon onlineIcon (":/icon/online.png");
-
QIcon leaveIcon (":/icon/leave.png");
-
QIcon rejectIcon (":/icon/reject.png");
-
QIcon hideIcon (":/icon/hide.png");
-
QIcon offlineIcon(":/icon/offline.png");
-
-
combo_status->addItem(onlineIcon,"在线");
-
combo_status->addItem(leaveIcon,"离开");
-
combo_status->addItem(rejectIcon,"勿扰");
-
combo_status->addItem(hideIcon,"隐身");
-
combo_status->addItem(offlineIcon,"离线");
阅读(3113) | 评论(0) | 转发(0) |