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. unresolved reference to QLineEdit.Password?
Forum Updated to NodeBB v4.3 + New Features

unresolved reference to QLineEdit.Password?

Scheduled Pinned Locked Moved Unsolved Qt for Python
5 Posts 3 Posters 998 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.
  • A Offline
    A Offline
    atmega328
    wrote on last edited by atmega328
    #1

    OS : Windows 11
    Python : Ver 3.9.16

    I installed PySide6 packages and basic functions are working well. but when i use "QLineEdit.Password" it says it is unresolved reference.

    this is my code :

    import hashlib 
    import datetime
    
    from PySide6.QtCore import Qt, QSettings
    from PySide6.QtWidgets import (
        QWidget, QLabel, QLineEdit, QVBoxLayout, QPushButton, QCheckBox
    )
    
    class LoginWindow(QWidget):
        def __init__(self):
            super().__init__()
    
            # Pre-flight checklist
            self.preflight_label = QLabel("Pre-Flight Checklist:\n\n"
                                           "Check pre-arm parameters of pixhawk\n"
                                           "Check weather\n"
                                           "Check ship position")
            self.preflight_label.setAlignment(Qt.AlignCenter)
    
            # Login ID and password fields
            self.id_field = QLineEdit()
            self.password_field = QLineEdit()
            self.password_field.setEchoMode(QLineEdit.Password)
    
    jsulmJ 1 Reply Last reply
    0
    • A atmega328

      OS : Windows 11
      Python : Ver 3.9.16

      I installed PySide6 packages and basic functions are working well. but when i use "QLineEdit.Password" it says it is unresolved reference.

      this is my code :

      import hashlib 
      import datetime
      
      from PySide6.QtCore import Qt, QSettings
      from PySide6.QtWidgets import (
          QWidget, QLabel, QLineEdit, QVBoxLayout, QPushButton, QCheckBox
      )
      
      class LoginWindow(QWidget):
          def __init__(self):
              super().__init__()
      
              # Pre-flight checklist
              self.preflight_label = QLabel("Pre-Flight Checklist:\n\n"
                                             "Check pre-arm parameters of pixhawk\n"
                                             "Check weather\n"
                                             "Check ship position")
              self.preflight_label.setAlignment(Qt.AlignCenter)
      
              # Login ID and password fields
              self.id_field = QLineEdit()
              self.password_field = QLineEdit()
              self.password_field.setEchoMode(QLineEdit.Password)
      
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @atmega328 said in unresolved reference to QLineEdit.Password?:

      self.password_field.setEchoMode(QLineEdit.Password)

      Maybe

      self.password_field.setEchoMode(QLineEdit.EchoMode.Password)
      

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

      A 1 Reply Last reply
      0
      • jsulmJ jsulm

        @atmega328 said in unresolved reference to QLineEdit.Password?:

        self.password_field.setEchoMode(QLineEdit.Password)

        Maybe

        self.password_field.setEchoMode(QLineEdit.EchoMode.Password)
        
        A Offline
        A Offline
        atmega328
        wrote on last edited by
        #3

        @jsulm Oh thank you but it turns out that PyCharm's fault.

        it runs very well even if there are unresolved reference warning message.

        pycharm seems to be crazy with complex library.

        jsulmJ JonBJ 2 Replies Last reply
        0
        • A atmega328

          @jsulm Oh thank you but it turns out that PyCharm's fault.

          it runs very well even if there are unresolved reference warning message.

          pycharm seems to be crazy with complex library.

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

          @atmega328 Yes, such things also happen often with QtCreator and C++ code :-)

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

          1 Reply Last reply
          0
          • A atmega328

            @jsulm Oh thank you but it turns out that PyCharm's fault.

            it runs very well even if there are unresolved reference warning message.

            pycharm seems to be crazy with complex library.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @atmega328
            At Qt6 basically all the enums were changed from living in "global-ish" namespaces to being more specific, e.g. here QLineEdit.Password -> QLineEdit.EchoMode.Password.

            1 Reply Last reply
            0

            • Login

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