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

"Object::connect: No such slot QTextControl::copy() in text/qtextcontrol.cpp:2043" message

    XMLWordPrintable

Details

    Description

      Qt embedded was builded with the "-no-feature-clipboard" option.
      Here's the code:

      qtextcontrol.cpp:

      #ifndef QT_NO_CONTEXTMENU
      QMenu *QTextControl::createStandardContextMenu(const QPointF &pos, QWidget *parent)
      {
          Q_D(QTextControl);
      
          const bool showTextSelectionActions = d->interactionFlags & (Qt::TextEditable | Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse);
      
          d->linkToCopy = QString();
          if (!pos.isNull())
              d->linkToCopy = anchorAt(pos);
      
          if (d->linkToCopy.isEmpty() && !showTextSelectionActions)
              return 0;
      
          QMenu *menu = new QMenu(parent);
          QAction *a;
      
          if (d->interactionFlags & Qt::TextEditable) {
              a = menu->addAction(tr("&Undo") + ACCEL_KEY(QKeySequence::Undo), this, SLOT(undo()));
              a->setEnabled(d->doc->isUndoAvailable());
              a = menu->addAction(tr("&Redo") + ACCEL_KEY(QKeySequence::Redo), this, SLOT(redo()));
              a->setEnabled(d->doc->isRedoAvailable());
              menu->addSeparator();
      
              a = menu->addAction(tr("Cu&t") + ACCEL_KEY(QKeySequence::Cut), this, SLOT(cut()));
              a->setEnabled(d->cursor.hasSelection());
          }
      
          if (showTextSelectionActions) {
      2043>        a = menu->addAction(tr("&Copy") + ACCEL_KEY(QKeySequence::Copy), this, SLOT(copy()));
              a->setEnabled(d->cursor.hasSelection());
          }
      

      and qtextcontrol_p.h

      public Q_SLOTS:
          void setPlainText(const QString &text);
          void setHtml(const QString &text);
      
      #ifndef QT_NO_CLIPBOARD
          void cut();
          void copy();
          void paste(QClipboard::Mode mode = QClipboard::Clipboard);
      #endif
      

      In accordance with the qfeatures.txt file, CLIPBOARD option depend only on QWS_PROPERTIES(enabled in my case).
      Therefore, it seems, we can simply include conditional compilation for cut(),copy() and paste().

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            laborer Sergey Gusarov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes