Hi high_flyer,
I have written code to show one of the available printer name ,I have used QLineText to show printer name
but getting error in following part of code:
void qprint::give_name_of_printer()
{
QPrinterInfo PrinterInfo;
//line no 33
QList<QPrinterInfo> pinfo;
//line 34
pinfo= PrinterInfo.availablePrinters(); // transferring QList into temp list pinfo
str=pinfo.value(1).printerName();//value function will return Qprinterinfo object at 2nd location & that object
// is used get printer name & stored in CString object
Name_edit->setText(str);//This is used to set text to printer name
}
void qprint::give_name_of_printer()
{
QPrinterInfo PrinterInfo;
QPrinter *printer=new QPrinter(QPrinter::ScreenResolution);
//line no 33
QList<QPrinterInfo> pinfo;
//line 34
QString str;
pinfo= PrinterInfo.availablePrinters(); // transferring QList into temp list pinfo
str=pinfo.value(1).printerName();//value function will return Qprinterinfo object at 2nd location & that object
// is used get printer name & stored in CString object
Name_edit->setText(str);//This is used to set text to printer name
}
To copy to clipboard, switch view to plain text mode
I am getting error as incomplete type and cannot be defined 'class QList<QPrinterInfo>' at line no 33
can you please help me out...
Thanks
Regards,
Sumit
Bookmarks