Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Syntax : QFileDialog.Options()

Syntax : QFileDialog.Options()

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 325 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Catacomb
    wrote on last edited by
    #1

    Hi, I'm a newbie who want to learn how to use Qt for my project.
    I found several online examples of using QFileDialog.Options something like this :

    def saveFileDialog(self):
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
    

    I'm just curious of the notation "|=", what's its use in these context? Or, it's just a typo?
    Hopefully someone in the forum willing to answer my curiosity.... :-)
    Many thanks in advance.

    jsulmJ 1 Reply Last reply
    0
    • C Catacomb

      Hi, I'm a newbie who want to learn how to use Qt for my project.
      I found several online examples of using QFileDialog.Options something like this :

      def saveFileDialog(self):
          options = QFileDialog.Options()
          options |= QFileDialog.DontUseNativeDialog
      

      I'm just curious of the notation "|=", what's its use in these context? Or, it's just a typo?
      Hopefully someone in the forum willing to answer my curiosity.... :-)
      Many thanks in advance.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Catacomb said in Syntax : QFileDialog.Options():

      options |= QFileDialog.DontUseNativeDialog

      This is not Qt specific. This line is same as

      options = options | QFileDialog.DontUseNativeDialog
      

      but shorter.
      You should read about Python operators.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved