2010-07-18 16:58 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbqt/hbqt_hbqabstractitemmodel.cpp
    + Added: :flags - Qt::ItemIsEditable.

  * contrib/hbqt/hbqt_hbslots.cpp
  * contrib/hbqt/hbqt_hbslots.h
    + Added: signals for QAbstractItemDelegate().

  * contrib/hbxbp/xbpbrowse.prg
    + Code cleanup.
    + Added: :setFocus() method.
    + Added: CASE Qt_EditRole.
      This will form the basis of editing in the browser.
      So far prelimanaries only, I could not implement how to.
This commit is contained in:
Pritpal Bedi
2010-07-19 00:06:52 +00:00
parent 1764c13194
commit 384b689493
5 changed files with 56 additions and 675 deletions

View File

@@ -16,6 +16,21 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-07-18 16:58 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/hbqt_hbqabstractitemmodel.cpp
+ Added: :flags - Qt::ItemIsEditable.
* contrib/hbqt/hbqt_hbslots.cpp
* contrib/hbqt/hbqt_hbslots.h
+ Added: signals for QAbstractItemDelegate().
* contrib/hbxbp/xbpbrowse.prg
+ Code cleanup.
+ Added: :setFocus() method.
+ Added: CASE Qt_EditRole.
This will form the basis of editing in the browser.
So far prelimanaries only, I could not implement how to.
2010-07-18 14:57 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/make.hbs
* contrib/hbpost.hbm

View File

@@ -154,7 +154,7 @@ Qt::ItemFlags HBQAbstractItemModel::flags( const QModelIndex & index ) const
QVariant ret = hbqt_fetchData( block, HBQT_QAIM_flags, 0, index.column(), index.row() );
if( ! ret.isValid() )
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
return ( QFlags<Qt::ItemFlag> ) ret.toInt();
}

View File

@@ -239,6 +239,10 @@ static bool connect_signal( QString signal, QObject * object, HBSlots * t_slots
/* QMdiSubWindow */
if( signal == ( QString ) "aboutToActivate()" ) return object->connect( object, SIGNAL( aboutToActivate() ), t_slots, SLOT( aboutToActivate() ), Qt::AutoConnection );
if( signal == ( QString ) "windowStateChanged(Qt::WindowStates,Qt::WindowStates)" ) return object->connect( object, SIGNAL( windowStateChanged( Qt::WindowStates, Qt::WindowStates ) ), t_slots, SLOT( windowStateChanged( Qt::WindowStates, Qt::WindowStates ) ), Qt::AutoConnection );
/* QAbstractItemDelegate */
if( signal == ( QString ) "closeEditor(QWidget,int)" ) return object->connect( object, SIGNAL( closeEditor( QWidget *, QAbstractItemDelegate::EndEditHint ) ), t_slots, SLOT( closeEditor( QWidget *, QAbstractItemDelegate::EndEditHint ) ), Qt::AutoConnection );
if( signal == ( QString ) "commitData(QWidget)" ) return object->connect( object, SIGNAL( commitData( QWidget * ) ), t_slots, SLOT( commitData( QWidget * ) ), Qt::AutoConnection );
if( signal == ( QString ) "sizeHintChanged(QModelIndex)" ) return object->connect( object, SIGNAL( sizeHintChanged( const QModelIndex & ) ), t_slots, SLOT( sizeHintChanged( const QModelIndex & ) ), Qt::AutoConnection );
/* New */
return false;
}
@@ -415,6 +419,10 @@ static bool disconnect_signal( QObject * object, const char * signal )
/* QMdiSubWindow */
if( signal == ( QString ) "aboutToActivate()" ) return object->disconnect( SIGNAL( aboutToActivate() ) );
if( signal == ( QString ) "windowStateChanged(Qt::WindowStates,Qt::WindowStates)" ) return object->disconnect( SIGNAL( windowStateChanged( Qt::WindowStates, Qt::WindowStates ) ) );
/* QAbstractItemDelegate */
if( signal == ( QString ) "closeEditor(QWidget,int)" ) return object->disconnect( SIGNAL( closeEditor( QWidget *, QAbstractItemDelegate::EndEditHint ) ) );
if( signal == ( QString ) "commitData(QWidget)" ) return object->disconnect( SIGNAL( commitData( QWidget * ) ) );
if( signal == ( QString ) "sizeHintChanged(QModelIndex)" ) return object->disconnect( SIGNAL( sizeHintChanged( const QModelIndex & ) ) );
/* new */
return false;
@@ -1045,6 +1053,10 @@ void HBSlots::subWindowActivated( QMdiSubWindow * window )
/* QMdiSubWindow */
void HBSlots::aboutToActivate() { hbqt_SlotsExec( this, qobject_cast<QObject *>( sender() ), "aboutToActivate()" ); }
void HBSlots::windowStateChanged( Qt::WindowStates oldState, Qt::WindowStates newState ) { hbqt_SlotsExecIntInt( this, qobject_cast<QObject *>( sender() ), "windowStateChanged(Qt::WindowStates,Qt::WindowStates)", oldState, newState ); }
/* QAbstractItemDelegate */
void HBSlots::closeEditor( QWidget * editor, QAbstractItemDelegate::EndEditHint hint ) { hbqt_SlotsExecPointerInt( this, qobject_cast<QObject *>( sender() ), "closeEditor(QWidget,int)", editor, hint ); }
void HBSlots::commitData( QWidget * editor ) { hbqt_SlotsExecPointer( this, qobject_cast<QObject *>( sender() ), "commitData(QWidget)", editor ); }
void HBSlots::sizeHintChanged( const QModelIndex & index ) { hbqt_SlotsExecModel( this, qobject_cast<QObject *>( sender() ), "sizeHintChanged(QModelIndex)", index ); }
/* Latest */
/*----------------------------------------------------------------------*/

View File

@@ -290,6 +290,10 @@ public slots:
/* QMdiSubWindow */
void aboutToActivate();
void windowStateChanged( Qt::WindowStates oldState, Qt::WindowStates newState );
/* QAbstractItemDelegate */
void closeEditor( QWidget * editor, QAbstractItemDelegate::EndEditHint hint );
void commitData( QWidget * editor );
void sizeHintChanged( const QModelIndex & index );
/* Latest */
};

File diff suppressed because it is too large Load Diff