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

iOS and Android: context menu does not show (Qt::ActionsContextMenu)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.3.0 RC1, 5.5.0 RC
    • None
    • iOS/tvOS/watchOS

    Description

      Using 5.3 release candidate, and using the following test case:

      
      #include <QApplication>
      #include <QLabel>
      #include <QMenu>
      #include <QAction>
      
      class Label : public QLabel
      {
          Q_OBJECT
      public:
          Label(QWidget *parent = 0)
              : QLabel(parent)
          {
              setText("init");
              setAlignment(Qt::AlignCenter);
              QStringList cities;
              cities << "Oslo";
              cities << "Berlin";
              cities << "Moscow";
              cities << "Helsinki";
              cities << "Santa Clara";
              for (int i = 0; i < cities.count(); ++i) {
                  QAction *action = new QAction(cities[i], this);
                  connect(action, SIGNAL(triggered()), SLOT(chooseCity()));
                  addAction(action);
              }
              setContextMenuPolicy(Qt::ActionsContextMenu);
          }
      
      protected slots:
          void chooseCity() {
              QAction *action = qobject_cast<QAction*>(sender());
              if (action)
                  setText(action->text());
          }
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          Label w;
          w.resize(200, 200);
          w.show();
          return a.exec();
      }
      
      #include "main.moc"
      
      

      The context menu is not shown up on Android/iOS after a long press.

      Attachments

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              carochao Caroline Chao (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes