Results 1 to 6 of 6

Thread: How to get the path of an image

  1. #1
    Join Date
    May 2012
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to get the path of an image

    I have a button that let's users browse for images and a line edit that' suppose to display the path of the image when the button is clicked. Unfortunately after choosing the image nothing get's displayed in the line edit. I thought it was automatic that the path will be displayed like Visual Basic.

    So how can I get the path (ex: Pictures/2.jpg) of an image and display it in a line edit when the button is clicked?

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    855
    Thanks
    68
    Thanked 56 Times in 54 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to get the path of an image

    Hi,

    Get the path that from the dialog an get it to the lineEdit.
    Òscar Llarch i Galán

  3. #3
    Join Date
    May 2012
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get the path of an image

    Can you explain further??

  4. #4
    Join Date
    Sep 2011
    Location
    Portugal
    Posts
    25
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to get the path of an image

    If you show some code, we could help you further

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,551
    Thanks
    13
    Thanked 1,579 Times in 1,508 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to get the path of an image

    Quote Originally Posted by stbb24 View Post
    I thought it was automatic that the path will be displayed like Visual Basic.
    In my experience it's not automatic in VB that a line edit and a separate dialog launched by a separate button are in any way related.
    So how can I get the path (ex: Pictures/2.jpg) of an image and display it in a line edit when the button is clicked?
    By doing exactly what you wrote:

  6. #6
    Join Date
    May 2012
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get the path of an image

    Thanks got it to work using setText()

Similar Threads

  1. Save image path in database
    By rivci in forum Qt Programming
    Replies: 3
    Last Post: 6th May 2012, 07:47
  2. Replies: 8
    Last Post: 17th October 2009, 08:10
  3. Replies: 6
    Last Post: 21st September 2009, 10:55
  4. Replies: 0
    Last Post: 14th December 2007, 01:33
  5. Replies: 3
    Last Post: 14th March 2007, 08:09

Tags for this Thread

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.