Results 1 to 6 of 6

Thread: QLineEdit will not change with QFileDialog (pyqt)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Posts
    7
    Thanks
    3
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: QLineEdit will not change with QFileDialog (pyqt)

    Hi,

    Thanks for the reply.

    Here's the most annoying thing: "print a" prints the file path perfectly! It just will not change the QLineEdit! I can't even think of a workaround.

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

    Default Re: QLineEdit will not change with QFileDialog (pyqt)

    But what is its type? It's probably not "QString instance", is it?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    Richie (6th September 2009)

  4. #3
    Join Date
    Sep 2009
    Posts
    7
    Thanks
    3
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: QLineEdit will not change with QFileDialog (pyqt)

    >>>> print type(a)
    <class 'PyQt4.QtCore.QString'>

    It was generated by QFileDialog::getOpenFileName, which returns a QString.

    I'm stumped.
    Last edited by Richie; 6th September 2009 at 16:29. Reason: spelling error

  5. #4
    Join Date
    Sep 2009
    Posts
    7
    Thanks
    3
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: QLineEdit will not change with QFileDialog (pyqt)

    Solved! If I explicitly set it to a QString, it works perferctly.

    Qt Code:
    1. a=QtCore.QString(getdb())
    2. txtdb.setText(a)
    To copy to clipboard, switch view to plain text mode 

    wysota, you're a hero. Many thanks!

Similar Threads

  1. Change QLabel to QLineEdit when mousePressEvent happens
    By naoyamakino in forum Qt Programming
    Replies: 2
    Last Post: 16th July 2009, 18:37
  2. Replies: 5
    Last Post: 10th July 2009, 12:11
  3. Pointer Question related to QLineEdit
    By ChrisReath in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 15:13
  4. QValidator, regular expressions and QLineEdit
    By hvengel in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 01:25

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