구조체 리스트 정렬하는 방법1 [Qt] QList에 있는 구조체 정렬하는 방법 (Sort, Struct) QList안에 있는 구조체 아이템의 항목을 기준으로 아이템을 정렬할 수 있어요. ○ 헤더 #include // qDebug() 출력을 위해 추가 struct People { QString Name; int Age; }; void ShowList(QList list);// QList 내용 출력 용도 ○ 메인 void MainWindow::ShowList(QList list) { foreach (People people, list) { qDebug() setupUi(this); // 사람 정보 추가 QList peopleList; peopleList.append(People {"Ghi", 10}); peopleList.append(People {"Def", 30}); peopleList.append(Peop.. 2021. 5. 15. 이전 1 다음 반응형