00001 #ifndef __DIALOGCHANGES__ 00002 #define __DIALOGCHANGES__ 00003 00004 #include <qobject.h> 00005 #include <qobjectlist.h> 00006 00007 /* EN DESUSO PERO DE INTERES COMO EJEMPLO 00008 class dialogChanges1: public QObject { 00009 Q_OBJECT 00010 private: 00011 bool m_modificaciones; 00012 public: 00013 dialogChanges1(QObject *parent) : QObject(parent) { 00014 m_modificaciones=FALSE; 00015 parent->installEventFilter(this); 00016 }; 00017 ~dialogChanges1(){}; 00018 bool dialogChanged() {return m_modificaciones;}; 00019 void resetDialogChanged() {m_modificaciones=FALSE;}; 00020 void setDialogChanged() {m_modificaciones=TRUE;}; 00021 virtual bool eventFilter( QObject *obj, QEvent *ev ) { 00022 if(!dialogChanged()) { 00023 // if ( obj->isA("QTable") || obj->isA("QLineEdit")) { 00024 if ( ev->type() == QEvent::KeyPress || ev->type() == QEvent::KeyRelease) { 00025 setDialogChanged(); 00026 }// end if 00027 }// end if 00028 // }// end if 00029 return FALSE; 00030 }; //end eventFilter; 00031 }; 00032 */ 00033 00034 00035 // ESta es la buena y que funciona. 00041 class dialogChanges { 00042 private: 00043 QString valorinicial; 00044 QObject *obje; 00045 public: 00046 dialogChanges(QObject *ob) {obje=ob;}; 00047 ~dialogChanges(){}; 00048 void dialogChanges_cargaInicial(); 00049 bool dialogChanges_hayCambios(); 00050 private: 00051 QString calculateValues(); 00052 QString retrieveValues(QString qsWidget); 00053 }; 00054 00055 00056 #endif