Results 1 to 9 of 9

Thread: Image loading

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2012
    Posts
    83
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QCoreApplication

    Many thanks aamer4yu for your reply.
    The image name should be myImage.png.
    Have a look please. When I proceed as followed, I do not need to add ".png", and I can have the image loaded. But I do not want to go this way.

    Qt Code:
    1. image.load("C:/Users/Desktop/myImage");
    To copy to clipboard, switch view to plain text mode 

    Even by writing myImage.png, there is no change.

    I have created a label on which th image should appear as followed:
    Qt Code:
    1. m_image = new QLabel(this);
    2. m_image->setPixmap(myImage);
    To copy to clipboard, switch view to plain text mode 
    Last edited by Stanfillirenfro; 15th January 2014 at 11:43.

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 284 Times in 279 Posts

    Default Re: QCoreApplication

    Are you sure you know what QCoreApplication::applicationDirPath() returns ?

  3. #3
    Join Date
    Jan 2012
    Posts
    83
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QCoreApplication

    Thanks Lesiok!

    Yes, QCoreApplication::applicationDirPath() returns the directory that contains the application executable.

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 334 Times in 317 Posts

    Default Re: QCoreApplication

    Please put a qDebug() for QCoreApplication::applicationDirPath() value...

Similar Threads

  1. Loading Image
    By navi1084 in forum Qt Programming
    Replies: 2
    Last Post: 27th June 2011, 06:07
  2. Loading an image into memory
    By Luc4 in forum Qt Programming
    Replies: 6
    Last Post: 12th April 2010, 09:44
  3. loading image from disk
    By freekill in forum Qt Programming
    Replies: 1
    Last Post: 18th February 2010, 06:21
  4. problems loading an image .jpg
    By maider in forum Qt Programming
    Replies: 3
    Last Post: 14th December 2009, 12:57
  5. Image Loading
    By kavinsiva in forum Qt Programming
    Replies: 2
    Last Post: 11th August 2009, 09:00

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
  •  
Qt is a trademark of The Qt Company.