×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    1

    Smile a Readonly Highlighted TextBlock in QTextEdit?

    Hi all, i decided to make a texteditor which can edit special format textfile(with tags like (Color:red)Text(Type:4) in it),

    It's easy to Highlight Text in a Tag pair with QSyntaxHighlighter, but ,I WANT TO HIDE THE TAGS ,AND MAKE the text in a Tag pair Non-editable

    So ,how can i make a Text block Non-editable , while other blocks editable?


    Thx. & Sry for my english

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: a Readonly Highlighted TextBlock in QTextEdit?

    Why don't you use HTML subset supported by QTextEdit http://doc.qt.nokia.com/4.6/richtext-html-subset.html?

  3. #3
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: a Readonly Highlighted TextBlock in QTextEdit?

    Quote Originally Posted by divanov View Post
    Why don't you use HTML subset supported by QTextEdit http://doc.qt.nokia.com/4.6/richtext-html-subset.html?
    Maybe because it doesn't have a way to make selected text read-only?

  4. #4
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: a Readonly Highlighted TextBlock in QTextEdit?

    I think you'd have to implement your own low-level code -- catch the keystrokes and position the characters yourself.

  5. #5
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: a Readonly Highlighted TextBlock in QTextEdit?

    Quote Originally Posted by danhicksbyron View Post
    I think you'd have to implement your own low-level code -- catch the keystrokes and position the characters yourself.
    Or intercept changeEvent().

Similar Threads

  1. making an argument readonly.
    By wooks in forum Mobile Java General
    Replies: 1
    Last Post: 2010-05-26, 18:49
  2. CRichTextEditor ReadOnly
    By nuker85 in forum Symbian
    Replies: 1
    Last Post: 2008-12-23, 12:46
  3. Readonly Time editor
    By kumar_sai123 in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-06-23, 14:28
  4. How to get readonly control's context
    By localizationer in forum Symbian
    Replies: 0
    Last Post: 2007-11-15, 07:13
  5. URGENT- EDWIN is readonly
    By danieLs0xff in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-12-30, 12:32

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×