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

After QApplication::setStyleSheet, QMessageBox::warning doesn't receive touch event

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.9.0
    • None
    • Android

    Description

      Hi,

      when setting a custom default font family and size, the generated QMessageBox doesn't respond to touch to close it.

       

      Touch part seems to be functionnal :

      I/InputDispatcher( 1407): Delivering touch to : action: 0x0, f=0x0, d=0, '3ddb553', t=1 
      I/ViewRootImpl@1335bc4[QtActivity]: ViewPostIme pointer 0
      I/GestureDetector: obtain mCurrentDownEvent. id: 430723635 caller: org.qtproject.qt.android.QtWindow.onTouchEvent:146 android.view.View.dispatchTouchEvent:16225 android.view.ViewGroup.dispatchTransformedTouchEvent:3322 
      I/GestureDetector: obtain mCurrentMotionEventRaw. action: 2 id: 887786843
      I/InputDispatcher( 1407): Delivering touch to : action: 0x1, f=0x0, d=0, '3ddb553', t=1 
      I/ViewRootImpl@1335bc4[QtActivity]: ViewPostIme pointer 1
      I/GestureDetector: handleMessage TAP 

      but not the transmission to the Widget.

       

       

       

       

      Here is a sniped code:

      #include <QApplication>
      #include <QMainWindow>
      #include <QStyle>
      #include <QPushButton>
      #include <QMessageBox>
      
      int main(int argc, char *argv[])
      {
        QApplication a(argc, argv);
        QMainWindow w;
        auto btn = new QPushButton("touch Me", &w);
        w.setCentralWidget(btn);
        btn->connect(btn, &QPushButton::clicked, [&](){QMessageBox::warning(&w, "Title", "text");});
        auto font = QFont("Sans Serif", 30);
        a.setStyleSheet(QString("*{font-family: '%1';font-size: %2pt;}").arg(font.family()).arg(font.pointSize()));
        a.setFont(font);
        w.show();
        return a.exec();
      } 

      Attachments

        1. 20250327.png
          23 kB
          Majid EL IDRISSI
        2. output.log
          29 kB
          Majid EL IDRISSI
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            lem__mel Majid EL IDRISSI
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes