2011-03-01 18:22 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtgui/hbqt_init.cpp
+ Added: HBQT_PUSHEVENT( <qObject>, <nQEventType>, <nKey>,
[nKeyboardModifiers], [cKey], [lRepeat=.f.], [ntimes=1] )
Current implementation is only for keyboard events, viz.,
QEvent_KeyPress and QEvent_KeyRelease. Mouse events needs
QPoint() to be present which is in the gtcore namespace,
so needs a different approach as per current hbQT scenario,
do the needful.
This commit is contained in:
@@ -16,6 +16,26 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2011-03-01 18:22 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbqt/qtgui/hbqt_init.cpp
|
||||
+ Added: HBQT_PUSHEVENT( <qObject>, <nQEventType>, <nKey>,
|
||||
[nKeyboardModifiers], [cKey], [lRepeat=.f.], [ntimes=1] )
|
||||
|
||||
Current implementation is only for keyboard events, viz.,
|
||||
QEvent_KeyPress and QEvent_KeyRelease. Mouse events needs
|
||||
QPoint() to be present which is in the gtcore namespace,
|
||||
so needs a different approach as per current hbQT scenario,
|
||||
do the needful.
|
||||
|
||||
2011-03-01 17:38 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbqt/qtnetwork/hbqt_init.cpp
|
||||
* contrib/hbqt/qtnetwork/hbqtnetwork.hbx
|
||||
* contrib/hbqt/qtnetwork/qth/filelist.hbm
|
||||
! Adjusted: to take use of new classes intead of NULL pointers.
|
||||
+ contrib/hbqt/qtnetwork/qth/QNetworkProxy.qth
|
||||
+ contrib/hbqt/qtnetwork/qth/QUrlInfo.qth
|
||||
+ Added: two pending classes.
|
||||
|
||||
2011-03-01 16:02 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* examples/hbqt_tut/win01.prg
|
||||
* examples/hbqt_tut/win02.prg
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
#include <QtGui/QListWidgetItem>
|
||||
#include <QtGui/QTreeWidgetItem>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QKeyEvent>
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
@@ -587,6 +588,45 @@ static void hbqt_lib_exit( void * cargo )
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
}
|
||||
|
||||
HB_FUNC( HBQT_PUSHEVENT )
|
||||
{
|
||||
switch( hb_parni( 2 ) )
|
||||
{
|
||||
case QEvent::KeyPress:
|
||||
case QEvent::KeyRelease:
|
||||
case QEvent::ShortcutOverride:
|
||||
{
|
||||
QKeyEvent pKeyEvent = QKeyEvent( ( QEvent::Type ) hb_parni( 2 ),
|
||||
hb_parni( 3 ),
|
||||
( Qt::KeyboardModifiers ) hb_parni( 4 ),
|
||||
( HB_ISCHAR( 5 ) ? hbqt_par_QString( 5 ) : QString() ),
|
||||
( HB_ISLOG( 6 ) ? hb_parl( 6 ) : false ),
|
||||
( HB_ISNUM( 7 ) ? hb_parni( 7 ) : 1 ) );
|
||||
|
||||
QObject * pObj = ( QObject * ) hbqt_gcpointer( 1 );
|
||||
s_app->sendEvent( pObj, &pKeyEvent );
|
||||
break;
|
||||
}
|
||||
case QEvent::MouseButtonPress:
|
||||
case QEvent::MouseButtonRelease:
|
||||
case QEvent::MouseButtonDblClick:
|
||||
case QEvent::MouseMove:
|
||||
{
|
||||
#if 0 /* QPoint is in qrcore so how to handle ? qtcore is always required anyway for any Qt appln */
|
||||
QKeyEvent pMouseEvent = QMouseEvent( ( QEvent::Type ) hb_parni( 2 ),
|
||||
hbqt_par_QPoint( 3 ),
|
||||
( Qt::MouseButton ) hb_parni( 4 ),
|
||||
( Qt::MouseButtons ) hb_parni( 5 ),
|
||||
( Qt::KeyboardModifiers ) hb_parni( 6 ) );
|
||||
|
||||
QObject * pObj = ( QObject * ) hbqt_gcpointer( 1 );
|
||||
s_app->sendEvent( pObj, &pMouseEvent );
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HB_CALL_ON_STARTUP_BEGIN( _hbqtgui_init_ )
|
||||
hb_vmAtInit( hbqt_lib_init, NULL );
|
||||
hb_vmAtExit( hbqt_lib_exit, NULL );
|
||||
|
||||
Reference in New Issue
Block a user