Home C C++ Java Python Perl PHP SQL JavaScript Linux Selenium QT Online Test

Home » QT-C++ » QList

Example of QList container in QT-C++

Main.cpp


#include<iostream>
#include<QList>
#include<QTextStream>
#include <algorithm>

using namespace std;

int main()
{
QList<QString> countries = {"USA", "India", "Mexico"};

cout<<"Size of the List :"<<countries.size()<<endl;

for(int i = 0; i<countries.size(); i++)
    cout<<countries.at(i).toStdString();

cout<<endl;
return 0;
}

Project in QT Creator

QList Example

Project file

QList Project file

Output of the program

QList example with output