#include <qwhatsthis.h>
#include <qvalidator.h>
#include <qmessagebox.h>
+#include <qapplication.h>
#include <TColStd_SequenceOfAsciiString.hxx>
virtual void setGeometry( int x, int y, int w, int h );
virtual void setSizePolicy( QSizePolicy );
+ virtual bool eventFilter( QObject*, QEvent* );
+
private:
QWidget* myWid;
};
if ( myWid == wid )
return;
+ if ( myWid )
+ myWid->removeEventFilter( this );
+
myWid = wid;
if ( !myWid )
if ( myWid->parent() != this )
myWid->reparent( this, QPoint( 0, 0 ) );
+ myWid->installEventFilter( this );
+
setTabOrder( this, myWid );
setFocusProxy( myWid );
updateGeometry();
}
+bool QDS_Datum::Wrapper::eventFilter( QObject* o, QEvent* e )
+{
+ if ( o == widget() && ( e->type() == QEvent::FocusIn || e->type() == QEvent::FocusOut ) )
+ QApplication::sendEvent( this, e );
+
+ return false;
+}
+
void QDS_Datum::Wrapper::setSizePolicy( QSizePolicy sp )
{
QWidget::setSizePolicy( sp );
endHeaderEdit( accept );
}
-/*!
- Finishes edition and hides table
-*/
-void QtxTable::hide()
-{
- endHeaderEdit();
-
- QTable::hide();
-}
-
/*!
Custom event filter
Starts edition of header by double click
}
if ( o == myHeaderEditor && e->type() == QEvent::FocusOut &&
- isHeaderEditing() && ((QFocusEvent*)e)->reason() != QFocusEvent::Popup )
+ ((QFocusEvent*)e)->reason() != QFocusEvent::Popup )
{
- endHeaderEdit();
- return true;
+ endHeaderEdit();
+ return true;
}
if ( e->type() == QEvent::Wheel && isHeaderEditing() )
return QTable::eventFilter( o, e );
}
+/*!
+ Reimplemented for internal reasons.
+ Firstly end the edition of header.
+*/
+void QtxTable::setNumRows( int rows )
+{
+ endHeaderEdit();
+ QTable::setNumRows( rows );
+}
+
+/*!
+ Reimplemented for internal reasons.
+ Firstly end the edition of header.
+*/
+void QtxTable::setNumCols( int cols )
+{
+ endHeaderEdit();
+ QTable::setNumCols( cols );
+}
+
+/*!
+ Reimplemented for internal reasons.
+ Firstly end the edition of header.
+*/
+void QtxTable::insertRows( int row, int count )
+{
+ endHeaderEdit();
+ QTable::insertRows( row, count );
+}
+
+/*!
+ Reimplemented for internal reasons.
+ Firstly end the edition of header.
+*/
+void QtxTable::insertColumns( int col, int count )
+{
+ endHeaderEdit();
+ QTable::insertColumns( col, count );
+}
+
+/*!
+ Reimplemented for internal reasons.
+ Firstly end the edition of header.
+*/
+void QtxTable::removeRow( int row )
+{
+ endHeaderEdit();
+ QTable::removeRow( row );
+}
+
+/*!
+ Reimplemented for internal reasons.
+ Firstly end the edition of header.
+*/
+void QtxTable::removeRows( const QMemArray<int>& rows )
+{
+ endHeaderEdit();
+ QTable::removeRows( rows );
+}
+
+/*!
+ Reimplemented for internal reasons.
+ Firstly end the edition of header.
+*/
+void QtxTable::removeColumn( int col )
+{
+ endHeaderEdit();
+ QTable::removeColumn( col );
+}
+
+/*!
+ Reimplemented for internal reasons.
+ Firstly end the edition of header.
+*/
+void QtxTable::removeColumns( const QMemArray<int>& cols )
+{
+ endHeaderEdit();
+ QTable::removeColumns( cols );
+}
+
/*!
SLOT: called on scroll
*/
updateHeaderEditor();
}
+/*!
+ Custom hide event handler
+*/
+void QtxTable::hideEvent( QHideEvent* e )
+{
+ endHeaderEdit();
+
+ QTable::hideEvent( e );
+}
+
/*!
Custom resize event handler
*/
virtual bool eventFilter( QObject*, QEvent* );
+ virtual void setNumRows( int );
+ virtual void setNumCols( int );
+
signals:
void headerEdited( QHeader*, int );
void headerEdited( Orientation, int );
public slots:
- virtual void hide();
virtual void setHeaderEditable( Orientation, bool );
+ virtual void insertRows( int, int = 1 );
+ virtual void insertColumns( int, int = 1 );
+ virtual void removeRow( int );
+ virtual void removeRows( const QMemArray<int>& );
+ virtual void removeColumn( int );
+ virtual void removeColumns( const QMemArray<int>& );
+
private slots:
void onScrollBarMoved( int );
void onHeaderSizeChange( int, int, int );
protected:
+ virtual void hideEvent( QHideEvent* );
virtual void resizeEvent( QResizeEvent* );
virtual bool beginHeaderEdit( Orientation, const int );