2008-05-25 06:30:30 -05:00
|
|
|
#include <QtGui> // FIXME: High
|
|
|
|
|
2008-08-30 03:49:08 -05:00
|
|
|
|
|
|
|
class DumpView: public QAbstractItemView
|
2008-05-25 06:30:30 -05:00
|
|
|
{
|
2008-08-30 03:49:08 -05:00
|
|
|
public:
|
2008-05-25 06:30:30 -05:00
|
|
|
DumpView(QWidget *parent=0);
|
|
|
|
|
2008-08-30 03:49:08 -05:00
|
|
|
QModelIndex indexAt( const QPoint &point ) const;
|
|
|
|
void scrollTo( const QModelIndex &index, ScrollHint hint = EnsureVisible );
|
|
|
|
QRect visualRect( const QModelIndex &index ) const;
|
2008-05-25 06:30:30 -05:00
|
|
|
|
|
|
|
protected:
|
2008-08-30 03:49:08 -05:00
|
|
|
int horizontalOffset() const;
|
|
|
|
bool isIndexHidden( const QModelIndex &index ) const;
|
|
|
|
QModelIndex moveCursor( CursorAction cursorAction,
|
|
|
|
Qt::KeyboardModifiers modifiers );
|
|
|
|
void setSelection( const QRect &rect, QItemSelectionModel::SelectionFlags flags );
|
|
|
|
int verticalOffset() const;
|
|
|
|
QRegion visualRegionForSelection( const QItemSelection &selection ) const;
|
|
|
|
protected slots:
|
|
|
|
void dataChanged( const QModelIndex &topLeft,
|
|
|
|
const QModelIndex &bottomRight );
|
|
|
|
void selectionChanged( const QItemSelection &selected,
|
|
|
|
const QItemSelection &deselected );
|
2008-05-25 06:30:30 -05:00
|
|
|
void paintEvent(QPaintEvent *event);
|
|
|
|
|
|
|
|
private:
|
2009-01-17 04:13:46 -06:00
|
|
|
void populateDump(QByteArray &dump, int &selOfs, int &selSize,
|
2008-08-30 03:49:08 -05:00
|
|
|
QModelIndex parent = QModelIndex());
|
2008-05-25 06:30:30 -05:00
|
|
|
bool inline isPrintable(char c)
|
|
|
|
{if ((c > 48) && (c < 126)) return true; else return false; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
QRect mOffsetPaneTopRect;
|
|
|
|
QRect mDumpPaneTopRect;
|
|
|
|
QRect mAsciiPaneTopRect;
|
|
|
|
int mSelectedRow, mSelectedCol;
|
|
|
|
int mLineHeight;
|
|
|
|
int mCharWidth;
|
|
|
|
};
|
2008-08-30 03:49:08 -05:00
|
|
|
|