rtleditor.cpp

Go to the documentation of this file.
00001 
00002 #include <QtGui>
00003 
00004 #include "rtleditor.h"
00005 #include "DecompilerThread.h"
00006 
00007 RTLEditor::RTLEditor(Decompiler *decompiler, const QString &name) : 
00008     decompiler(decompiler),
00009     name(name)
00010 {
00011     updateContents();
00012     setMouseTracking(true);
00013     setReadOnly(true);
00014 }
00015 
00016 void RTLEditor::updateContents()
00017 {
00018     QString rtl;
00019     decompiler->getRtlForProc(name, rtl);
00020     int n = verticalScrollBar()->value();
00021     setHtml(rtl);
00022     verticalScrollBar()->setValue(n);
00023 }
00024 
00025 void RTLEditor::mouseMoveEvent(QMouseEvent *event)
00026 {
00027     QString name = anchorAt(event->pos());
00028     if (!name.isEmpty())
00029         QApplication::setOverrideCursor(Qt::PointingHandCursor);
00030     else
00031         QApplication::restoreOverrideCursor();
00032 }
00033 
00034 void RTLEditor::mousePressEvent(QMouseEvent *event)
00035 {
00036     // allow clicking on subscripts
00037     QString name = anchorAt(event->pos());
00038     if (!name.isEmpty()) {
00039         scrollToAnchor(name.mid(1));
00040         return;
00041     }
00042     QTextEdit::mousePressEvent(event);
00043 }
00044 

Generated on Tue Sep 19 21:18:31 2006 for Boomerang by  doxygen 1.4.6