×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    2

    PySide: QFileDialog.getOpenFileName returns string of tuple instead of just string

    I'm trying to convert an application from PyQt4 to Qt and have found what appears to be a difference in the return results from QFileDialog.getOpenFileName

    I'm calling QFileDialog with the following call:

    filepath = unicode(QFileDialog.getOpenFileName(self,
    "Species Explorer - Open Species", dir,
    "Species Files (*.species)"))

    When I use PyQt4 I just get a string with the file selected using the dialog box. For example:

    C:/production/species/testSpecies.species

    When I use PySide I get a string that contains a tuple with two sub-strings: the filename and the value of the filter. For instance:

    (u'C:/production/species/testSpecies.species', u'Species Files (*.species)')

    Is this the expected behaviour?

    I'm using PySide for Windows, pyside-0.4.0-py2.6

  2. #2
    Registered User
    Join Date
    Sep 2010
    Posts
    2

    Re: PySide: QFileDialog.getOpenFileName returns string of tuple instead of just strin

    BTW... is there a forum for PySide other than just the Qt General one???

  3. #3
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: PySide: QFileDialog.getOpenFileName returns string of tuple instead of just strin

    The same thing in Qt:
    The filter selected is set to selectedFilter.
    http://doc.qt.nokia.com/4.6/qfiledia...etOpenFileName

Similar Threads

  1. String returns null when more data is copied
    By gaurav.gupta in forum Mobile Java General
    Replies: 14
    Last Post: 2010-06-02, 09:10
  2. Replies: 5
    Last Post: 2006-02-26, 17:29
  3. Replies: 0
    Last Post: 2005-11-22, 10:41
  4. AT+CSCA? returns empty string with 6210?
    By kesslerdesign in forum General Messaging
    Replies: 1
    Last Post: 1970-01-01, 02:00
  5. AT+CSCA? returns empty string with 6210?
    By kesslerdesign in forum General Messaging
    Replies: 2
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •