Results 1 to 4 of 4

Thread: setting printer using Qt

  1. #1
    Join Date
    Dec 2008
    Location
    My spaceship needs repairs..so, I am stuck on beautiful earth
    Posts
    98
    Thanks
    25
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Red face setting printer using Qt

    Hi guys,
    First of all, my best wishes to you all for 2009.

    I have been asked to work on a picture gallery created using Qt 3.3
    In the first dialog ,thumbnails of the pictures in the gallery are shown and when you click on any of the thumbnails,an enlarged version of the selected picture is shown in a second dialog .A few options one of which is 'Print' are there in the second dialog box along with a Text Label over which the selected picture is set(The Text label name is 'pic_display')

    Now,i wrote the following for the print() slot.
    {
    QPrinter * printer;
    printer=new QPrinter;
    if(printer->setup(this))
    {
    }
    }

    The code is working fine and when I click 'Print',the Print dialog is showing.
    But,I am facing the following problems:
    1) No printers are showing in the dialog.....does it mean that my system is not connected to any printers.(Lots of computers in the office.I think we have a central printer which we can connect to via LAN,am not sure though)

    2)When I click on the print button(note it's in the second dialog box which shows the enlarged image),I want the path of the image to be shown in the Browse box.Currently,I have to browse to the location of the file which I want to print(which is the enlarged image)...is it possible to set it automatically each time I click 'print'.

    I hope,I have been able to explain the problems clearly enough.
    Your suggestions and advice are welcome.
    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: setting printer using Qt

    Are the printers installed in the system? Qt uses lpr in 3.3 so any lpr or cups installed printer should be visible.

  3. #3
    Join Date
    Dec 2008
    Location
    My spaceship needs repairs..so, I am stuck on beautiful earth
    Posts
    98
    Thanks
    25
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Smile Re: setting printer using Qt

    Hi,thanks for the advice.I will try and see if any printers are installed in the system(new to linux,so not much idea of what to do or check)

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: setting printer using Qt

    The easiest way is to open some application that supports printing using cups or lpr and see if it is able to print

Similar Threads

  1. making the printer correctly interpret pcl files
    By momesana in forum Qt Programming
    Replies: 1
    Last Post: 17th April 2008, 16:41
  2. Replies: 3
    Last Post: 30th January 2007, 07:35
  3. Setting style in QApplication
    By Doug Broadwell in forum Newbie
    Replies: 2
    Last Post: 28th October 2006, 21:56
  4. form setting
    By mickey in forum Qt Tools
    Replies: 5
    Last Post: 27th September 2006, 00:28
  5. Printing a PRN file on an NDPS printer
    By janca in forum General Discussion
    Replies: 4
    Last Post: 20th March 2006, 22:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.