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

Dialog should emit rejected() when CloseOnEscape is triggered

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.8.0 Alpha
    • Fix Version/s: 5.8.0 RC
    • Component/s: Quick: Controls 2
    • Labels:
      None

      Description

      Controls 2:

      import QtQuick 2.8
      import QtQuick.Layouts 1.3
      import QtQuick.Controls 2.1
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          Dialog {
              id: dialog
              modal: true
              focus: true
              Component.onCompleted: visible = true
              implicitWidth: 500
              implicitHeight: 400
      
              standardButtons: Dialog.Ok | Dialog.Cancel
              onRejected: print("rej")
          }
      }
      

      Widgets:

      #include <QApplication>
      #include <QDialog>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QDialog dialog;
          QObject::connect(&dialog, &QDialog::rejected, []() {
              qDebug() << "Rejected!";
          });
      
          dialog.show();
      
          return a.exec();
      }
      

        Attachments

        For Gerrit Dashboard: QTBUG-56928
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            mitch_curtis Mitch Curtis
            Reporter:
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes