Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Invoke cut/copy/paste manually on QGraphicsTextItem
Forum Updated to NodeBB v4.3 + New Features

Invoke cut/copy/paste manually on QGraphicsTextItem

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 3.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mkuettler
    wrote on last edited by
    #1

    Hello.

    I'd like to call the same functions that handle the shortcuts Ctrl+X, Ctrl+C, Ctrl+V in QGraphicsTextItem manually. I know that their actual implementations is in the hidden QTextControll. QTextEdit provides slots to access them, but the interface of QGraphicsTextItem seems to be rather limited in comparison. I did not find a way to call these functions in QTextDocument or QTextCursor either. Is there a way to use them, or do I have to craft an artificial QKeyPressEvent and send it to the QGraphicsTextItem if I do not want to reimplement these functions?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MaQzma
      wrote on last edited by
      #2

      I can't solve your problem, sorry about that, but I have the same problem :/

      Any ideas?

      Mario.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mkuettler
        wrote on last edited by
        #3

        Unfortunately I did not find any proper solution. Currently I use the custom QKeyPressEvent workaround; something like
        @
        QKeyEvent event(QEvent::KeyPress, Qt::Key_C, Qt::ControlModifier);
        QApplication::sendEvent(scene(), event);
        @

        This works, but it can hardly be considered an elegant solution.
        You also might not want to have the shortcuts hard coded, but I am not sure how to ask Qt for the shortcut of a standard action. My code uses KDE, and I use some (pretty ugly) code to get the shortcut from an action created with KStandardAction.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MaQzma
          wrote on last edited by
          #4

          We could request this feature to Qt?

          Mario.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            I'd say: please open a bugreport for it. You can do that in the "Jira bugtracker":http://bugreports.qt-project.org/ though you might have to create an account if you didn't do that already.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Asperamanca
              wrote on last edited by
              #6

              If you make a bug report, please post the link here. I'd vote for it.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                MaQzma
                wrote on last edited by
                #7

                Thanks for the link :)
                [quote author="Andre" date="1341392084"]I'd say: please open a bugreport for it. You can do that in the "Jira bugtracker":http://bugreports.qt-project.org/ though you might have to create an account if you didn't do that already.[/quote]

                Here is the "suggestion":https://bugreports.qt-project.org/browse/QTBUG-26429 (a.k.a: Feature Request). Vote, and comment your use cases.

                Mario.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mkuettler
                  wrote on last edited by
                  #8

                  Thanks for creating the feature request. I've voted for it.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved