Results 1 to 2 of 2

Thread: Column Selection Text Editor

  1. #1
    Join Date
    Jun 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Column Selection Text Editor

    I'm no writing a text editor based on the QTextEdit class. I'd like to add the column selection support in the text editor but don't know how to add this to QTextEdit. Can any one give me some hints?

    Thank you for any input.
    Best regards
    Zhiyong Xue

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Column Selection Text Editor

    You'll have to do a lot by hand... First there will be several event handlers to reimplement (mousePress, mouseMove, mouseRelease) then you'll have to figure out a bright way of handling complex selections (impossible to do out-of-box with QTextCursor...) so that the QTextEdit knows that some text is selected and then reimp createMimeDataFromSelection() to allow D'n'D, copy/paste. Still there will probably remain many broken stuff unless you reimplement QTextEdit from scratch (from QAbstractScrollArea actually ) or, at the very least, all event handlers. It may sound pretty hard (and it actually is kinda...) but it remains doable.
    Current Qt projects : QCodeEdit, RotiDeCode

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Creating simple text editor from the eamples code
    By overcast in forum Qt Programming
    Replies: 4
    Last Post: 14th February 2007, 15:46
  3. Phrasis - A no frills writer oriented text editor
    By jrideout in forum Qt-based Software
    Replies: 0
    Last Post: 19th December 2006, 08:13
  4. Implementation of right indentation in a text editor
    By sukanyarn in forum Qt Programming
    Replies: 11
    Last Post: 26th September 2006, 13:06
  5. a Text Editor with line numbers...
    By fullmetalcoder in forum Qt Programming
    Replies: 47
    Last Post: 5th April 2006, 11:10

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.