1
/***************************************************************************
2
* Copyright (C) 2005 by Adam Treat *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
***************************************************************************/
12
#ifndef DATATABLEVIEW_H
13
#define DATATABLEVIEW_H
15
#include <qdatatable.h>
19
class DataTableView : public QDataTable
23
enum SelectionMode { Default = 0, MouseOver = 1 };
24
DataTableView( DataTable *parent = 0, const char *name = 0 );
26
virtual ~DataTableView();
28
QColor selectionColor() const;
30
SelectionMode selectionMode() const;
31
void setSelectionMode( SelectionMode m );
34
void setSelectionColor( const QColor &color );
35
virtual void columnWidthChanged( int col );
36
virtual void setColumnWidth( int col, int w );
37
void slotSelectFirstRow( bool updateCursor = true );
38
void slotSelectPrevRow( bool updateCursor = true );
39
void slotSelectNextRow( bool updateCursor = true );
40
void slotSelectLastRow( bool updateCursor = true );
41
void slotSelectRow( int row, bool updateCursor = true );
44
void handleError( const QSqlError & error );
45
virtual void paintCell( QPainter * p, int row, int col, const QRect & cr,
46
bool selected, const QColorGroup &cg );
47
virtual void paintField( QPainter * p, const QSqlField* field,
48
const QRect & cr, bool b );
50
QWidget* beginEdit( int row, int col, bool replace = false );
52
virtual void sortColumn( int col, bool ascending = true, bool wholeRows = false );
53
virtual void contentsContextMenuEvent( QContextMenuEvent *e );
54
virtual void contentsMouseMoveEvent( QMouseEvent * e );
57
DataTable *m_dataTable;
58
QColor m_selectionColor;