AvailablePrinters() function does not work on UBUNTU 12.04(64 bit) with Qt 5.0.0 (64 bit).
-
Hi,
I am devolping on UBUNTU 12.04 (64 bit) and using Qt 5.0.0 (64 bit).
i want to display the system available printers list using the following function:QList<QPrinterInfo> list = QPrinterInfo::availablePrinters();
here it is not showing the appropriate output.
but the same code is working properly in Qt 4.7.4 (32 bit) with UBUNTU 11.10 (64 bit).
where is the problem. please share with me.
thanks in advance. -
So are you using the same Qt version on the systems where this works? Is your latest ubuntu configured correctly and does it list the printers?
Please "report a bug":https://bugreports.qt-project.org/ about this if the issue still persists with a the Qt 5 RC release.
-
He wrote that it is correctly works on ubuntu 11.10, but now he tried on ubuntu 12.04
I have tested
QList<QPrinterInfo> list = QPrinterInfo::availablePrinters();
just now on KUbuntu 12.04 64bit with Qt5 RC1 and it works properly -
He writes that the code works correctly with Qt 4.7.4 on ubuntu 11.10. It would be interesting to know whether Qt 5 works on ubuntu 11.10 or whether Qt 4.7.4 works on ubuntu 12.04.
-
Thanks to all for quick response.
Let's take one by one :
Tobias Hunger :: So are you using the same Qt version on the systems where this works? Is your latest ubuntu configured correctly and does it list the printers?
My Response :: 4.7.4 with Ubuntu 11.10 (64 bit) works fine. After that same 4.7.4 with Ubuntu 12.04 (64 bit) doesn't list the printers. Means same line of code is not executed. I tried with QT 5.0 RC1 on Ubuntu 12.04 (64 bit) results in same. Means, doesn't list the printers.Dear _rmn :: just now on KUbuntu 12.04 64bit with Qt5 RC1 and it works properly
My Response :: Does this line means it is working fine on your system. I am using Ubuntu 12.04 and how much is it different from KUbuntu 12.04 for this I have to see. Welcome in case of any further suggestion.Again Tobias Hunger :: He writes that the code works correctly with Qt 4.7.4 on ubuntu 11.10. It would be interesting to know whether Qt 5 works on ubuntu 11.10 or whether Qt 4.7.4 works on ubuntu 12.04.
My Response :: Yes code works correctly with Qt 4.7.4 on Ubuntu 11.10. I installed Qt 5 on Ubuntu 11.10 again the same issue i.e code is not compiling. And code 4.7.4 is not working with Ubuntu 12.04 also. Resulting in errorUndefined reference to "QPrinterInfo::availablePrinters()"
I compiled the same "code":https://blog.qt.digia.com/blog/2007/11/13/printer-information-support/ on BOSS 4.0 and It's working fine.
Thanks to all. Waiting for valuable suggestions if any.
-
Boss with 4.7.4 (32 bit).. :-)
Request to ignore it for concluding the results.
-
About "Undefined reference to “QPrinterInfo::availablePrinters()”" error with Qt5:
Have you added
@
QT += printsupport
@to .pro file?
-
Thanks to _rmm. It worked.