Results 1 to 15 of 15

Thread: Drag-n-Drop with cut and not copy

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jan 2006
    Location
    Scandinavia
    Posts
    62
    Thanks
    5
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Drag-n-Drop with cut and not copy

    Quote Originally Posted by wysota View Post
    I think J-P already stated in some other thread that he didn't understand it and I have to agree with him - I don't understand either...

    Which cursor does QTextEdit::textCursor() return?
    Yeah. I know it's a little confusing - I think I read that thread too - as far as I could see other people had the same problem but I didn't find a solution for it.

    QTextEdit::textCursor() returns a copy of the actual cursor. So any changes to that cursor will NOT affect the 'active' cursor.

    I've attached a main.cpp file and my TextEdit I don't know if you have time to check it but if so the following steps would explain the problem
    1) write some text - whatever to play with
    2) select part of the text with the mouse - and do a drag-n-drop of that text to another section of the document
    3) You will see that (correctly) the cursor moved to the place where the text was dropped.
    4) Click on another location on the document - you will see that the curser symbol didn't move to the place where you clicked.
    5) Try pressing some keys on the keyboard - the letters will appear where you latest clicked with the mouse and NOT where the visible cursor symbol is.
    Attached Files Attached Files

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.