Qt中對QString 型別物件的分割

alan00000發表於2012-12-09

示例程式碼:

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);



}


相關文章