qtable2.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2003 by Tomeu Borras Riera                              *
00003  *   tborras@conetxia.com                                                  *
00004  *   http://www.iglues.org                                                 *
00005  *                                                                         *
00006  *   This program is free software; you can redistribute it and/or modify  *
00007  *   it under the terms of the GNU General Public License as published by  *
00008  *   the Free Software Foundation; either version 2 of the License, or     *
00009  *   (at your option) any later version.                                   *
00010  *                                                                         *
00011  *   This program is distributed in the hope that it will be useful,       *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU General Public License for more details.                          *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU General Public License     *
00017  *   along with this program; if not, write to the                         *
00018  *   Free Software Foundation, Inc.,                                       *
00019  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00020  ***************************************************************************/
00021 
00022 #ifndef QTABLE2_H
00023 #define QTABLE2_H
00024 
00025 #include <QEvent>
00026 #include <QTableWidget>
00027 #include <QItemDelegate>
00028 #include "funcaux.h"
00029 
00030 
00034 class QTableItemTextDelegate : public QItemDelegate {
00035 public:
00036     QTableItemTextDelegate(QObject *);
00037     ~QTableItemTextDelegate();
00038     void setEditorData(QWidget *, const QModelIndex &index) const;
00039     void setModelData(QWidget *editor,  QAbstractItemModel *model, const QModelIndex &index) const;
00040     QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00041 };
00042 
00043 
00045 class QTableWidgetItem2 : public QTableWidgetItem {
00046 public:
00047     int modo;
00048     QTableWidgetItem2(int type = Type, int mode = 0);
00049     QTableWidgetItem2(const QString &text, int type = Type, int mode = 0);
00050     ~QTableWidgetItem2();
00051     virtual bool operator< (const QTableWidgetItem &other) const;
00052 };
00053 
00054 
00057 
00058 class QTableWidget2 : public QTableWidget {
00059     Q_OBJECT
00060 
00061 private:
00062     int modo; 
00063     int m_tipoorden;
00064     int m_colorden;
00065 
00066 public:
00067     int m_teclasalida; 
00068 
00069 public:
00070     int tipoorden();
00071     int colorden();
00072     void settipoorden(int t);
00073     void setcolorden(int t);
00074     void columnMoved(int column, int oldIndex, int newIndex);
00075     QTableWidget2(QWidget *parent = 0);
00076     ~QTableWidget2();
00077     void editItem(QTableWidgetItem *it);
00078     virtual bool eventFilter(QObject *obj, QEvent *event);
00079     void setText(int x, int y, const QString &val);
00080     virtual void ordenar();
00081     void sortByColumn(int column, Qt::SortOrder order = Qt::AscendingOrder);
00082     void sortItems(int column, Qt::SortOrder order = Qt::AscendingOrder);
00083     void setSortingEnabled(bool);
00084 
00085 public slots:
00086     virtual void sitemChanged(QTableWidgetItem *it);
00087 
00088 signals:
00089     void cellRePosition(int, int);
00090     void pulsadomas(int, int, int);
00091     void pressedAsterisk(int, int);
00092     void pressedPlus(int, int);
00093     void pressedMinus(int, int);
00094     void pressedSlash(int, int);
00095     void ctrlSubir(int, int);
00096     void ctrlBajar(int, int);
00097     void ctrlDerecha(int, int);
00098     void ctrlIzquierda(int, int);
00099 };
00100 
00101 #endif
00102 

Generated on Sat Dec 15 00:01:22 2007 for BulmaGes by  doxygen 1.5.1