Qt中对QString 类型对象的分割

示例代码:

void CreateSchedul::on_listWidget_itemClicked(QListWidgetItem* item)
{
//    QString itemtext=item->text();
    QString itemstring=item->text();
    QStringList tmplist=itemstring.split(":");
    QString holidayidoflist=tmplist.at(1);//排序为0,1,2,3,4...
    bool ok;
    currentholidayid=holidayidoflist.toInt(&ok);
    *tmpholidayplan=*(varschedul->findHolidayPlanById(currentholidayid));
    showHolidayPlan(tmpholidayplan);
    ui->push_del_2->setEnabled(true);
    ui->push_change_2->setEnabled(true);



}


你可能感兴趣的:(Qt中对QString 类型对象的分割)