Skip to content

Instantly share code, notes, and snippets.

@ku1ik
Created March 10, 2010 20:17
Show Gist options
  • Save ku1ik/328316 to your computer and use it in GitHub Desktop.
Save ku1ik/328316 to your computer and use it in GitHub Desktop.
require "korundum4"
class MyHighlighter < Qt::SyntaxHighlighter
def highlightBlock(line)
puts "highlightBlock"
setCurrentBlockUserData(Qt::TextBlockUserData.new)
end
end
class MyEdit < Qt::TextEdit
def initialize
super
@highlighter = MyHighlighter.new(document)
# connect(self, SIGNAL("textChanged()")) do
# puts "textChanged"
# textCursor.block.setUserData(Qt::TextBlockUserData.new)
# end
end
end
app = Qt::Application.new(ARGV)
w = MyEdit.new
w.show
app.exec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment