Results 1 to 2 of 2

Thread: Problems with QTextCursor::movePosition

  1. #1
    Join Date
    Aug 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Problems with QTextCursor::movePosition

    here:
    bool mooved = cursor.movePosition(QTextCursor::Start);
    while(mooved && cursor.position() < toPlainText().size()) {
    cursor.select(QTextCursor::WordUnderCursor);
    mooved = cursor.movePosition(QTextCursor::NextWord);
    }

    I have 2 questions:
    1) mooved is always true even no more words left. At end of text. So I added "cursor.position() < toPlainText().size()". Is it right?
    2) going throw this text "If you reimplement this handler, it is very important that you ignore() the event if you do not understand it, so that the widget's parent can interpret it" never ends and stay at "ignore".

    Whats wrong?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problems with QTextCursor::movePosition

    Quote Originally Posted by js67257
    1) mooved is always true even no more words left. At end of text. So I added "cursor.position() < toPlainText().size()". Is it right?
    I think so. It tells you that the operation did succeed and not if it changed the position of the cursor.

    2) going throw this text "If you reimplement this handler, it is very important that you ignore() the event if you do not understand it, so that the widget's parent can interpret it" never ends and stay at "ignore".

    Whats wrong?
    What handler? What doesn't end and stays at ignore?

Similar Threads

  1. Problems
    By euthymos in forum Installation and Deployment
    Replies: 2
    Last Post: 13th June 2006, 19:11
  2. Problems building mysql plugin for Qt 4.1.2 on windows XP
    By Philip_Anselmo in forum Installation and Deployment
    Replies: 3
    Last Post: 17th May 2006, 15:38
  3. QT4 Plugins - problems, problems
    By NormanDunbar in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 15:39
  4. [Win32/VC++ 8.0] Strange problems with qrc_*.cpp files
    By mloskot in forum Installation and Deployment
    Replies: 6
    Last Post: 6th March 2006, 10:28
  5. problems with Opengl
    By SlawQ in forum Qt Programming
    Replies: 4
    Last Post: 12th February 2006, 22:49

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.