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

QLineEdit cut operation misbehavior

    XMLWordPrintable

Details

    • 5.4: 0aa84a619ea0a7c85a1ed48ed28817d4c7e40b33, Qt 4: 45de76f8e071edcf77bc3bd006f052fe5b3f01fc

    Description

      QLineEdit cut operation(CTRL+X) is not disabled when there is no selection.
      Here is the code and steps how to reproduce the problem.

      Steps how to reproduce:
      1. Launch application
      2. Move cursor position to start
      3. Launch context menu and you can see "Cut" is disabled. Close the context menu.
      4. Press CTRL+X

      Actual result:
      4. Text is cut off even when there is no selection.

      Expected result:
      4. Shortcut combination should be disabled when there is no selection.

      #include "mainwindow.h"
      #include <QApplication>
      #include <QLineEdit>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QLineEdit *le = new QLineEdit;
          le->setText("abcdefgh");
          le->show();
          return a.exec();
      }
      

      Patch proposals attached.

      Attachments

        1. diff_qt4.patch
          0.4 kB
        2. diff_qt5.patch
          0.5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            anylitok Antti Yli-Tokola (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes