QListWidget *list1=ui->listWidget_Off1; QListWidget *list2=ui->listWidget_Off2; list1->setIconSize(QSize(100, 100)); list1->setResizeMode(QListView::Adjust); QListWidgetItem *ListItem[4]; ListItem[0]=new QListWidgetItem; QPixmap objPixmap(":/icon/image1.png"); ListItem[0]->setIcon(QIcon(objPixmap.scaled(QSize(100,100))));//图片伸缩 ListItem[1]=new QListWidgetItem(QIcon(":/icon/xiaobiaoqin.png")," 我爱运动健身"); ListItem[2]=new QListWidgetItem(QIcon(":/icon/xiaobiaoqin.png"),"【我爱运动健身馆】我爱运动健身\n馆郑州紫荆山运动"); ListItem[3]=new QListWidgetItem(QIcon(":/icon/xiaobiaoqin.png"),"【我爱运动健身馆】我爱运动健身\n馆郑州紫荆山运动"); ListItem[2]->setBackgroundColor(QColor(23,12,123,0)); ListItem[1]->setBackground(QBrush(QImage(":/icon/itemback.png"))); // list2->setStyleSheet("QListWidget::item{background-image:url(:/icon/itembk)}");//设置Item背景 ListItem[0]->setSizeHint(QSize(90,100)); ListItem[1]->setSizeHint(QSize(20,33)); ListItem[2]->setSizeHint(QSize(20,33)); ListItem[3]->setSizeHint(QSize(20,33)); list1->addItem(ListItem[0]); list2->addItem(ListItem[1]); list2->addItem(ListItem[2]); list2->addItem(ListItem[3]);