Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119182

Readonly QLineEdit writable using input method

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5
    • 6.6.0
    • None
    • Windows10 22H2
    • Windows
    • 70096b2bb (dev), 24f6eaa11 (6.7), c535fcc59 (6.6)

    Description

      A readonly QLineEdit is still writable using input method. See attached screenshot.

      To reproduce:

       

      # CMakeLists.txt
      cmake_minimum_required(VERSION 3.14)
      project(lineEditReadOnlyInputMethodBug)
      find_package(Qt6 REQUIRED COMPONENTS Widgets)
      qt_add_executable(${PROJECT_NAME} main.cpp)
      target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets) 

       

      // main.cpp
      #include <QApplication>
      #include <QLineEdit>
      int main(int argc, char **argv){
        QApplication a{argc, argv};
        QLineEdit le;
        le.setPlaceholderText("A readonly QLineEdit");
        le.setReadOnly(true);
        le.show();
        return a.exec();
      } 

      Click mouse on the QLineEdit. Input texts when system input method is enabled.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              richard Richard Moe Gustavsen
              fzl f zl
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews