2009-07-20 08:45 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* contrib/hbqt/hbqt_slots.cpp
  * contrib/hbqt/hbqt_slots.h
  * contrib/hbqt/moc_slots.cpp
    + Added "timeout()" signal. I am not sure if it will work.
      Please let me know if I am right, otherwise I have to restructure
      this mechanism from bottom-up.
This commit is contained in:
Pritpal Bedi
2009-07-20 15:47:28 +00:00
parent 8f26e540ec
commit cd7375406b
4 changed files with 42 additions and 4 deletions

View File

@@ -17,6 +17,14 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-07-20 08:45 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbqt/hbqt_slots.cpp
* contrib/hbqt/hbqt_slots.h
* contrib/hbqt/moc_slots.cpp
+ Added "timeout()" signal. I am not sure if it will work.
Please let me know if I am right, otherwise I have to restructure
this mechanism from bottom-up.
2009-07-20 13:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/itemapi.c
* cleaned hb_itemPutC*() functions. Now each function which accepts

View File

@@ -110,6 +110,20 @@ static void SlotsExec( QWidget* widget, char* event )
}
}
static void SlotsExecObject( QObject* widget, char* event )
{
if( widget )
{
int i = widget->property( event ).toInt();
if( ( i > 0 ) && ( s_s->listActv.at( i - 1 ) == true ) )
{
PHB_ITEM pWidget = hb_itemPutPtr( NULL, ( QObject* ) widget );
hb_vmEvalBlockV( ( PHB_ITEM ) s_s->listBlock.at( i - 1 ), 1, pWidget );
hb_itemRelease( pWidget );
}
}
}
static void SlotsExecBool( QWidget* widget, char* event, bool bBool )
{
if( widget )
@@ -902,6 +916,13 @@ void Slots::undoAvailable( bool available )
QWidget *oWidget = qobject_cast<QWidget *>( sender() );
SlotsExecBool( oWidget, ( char* ) "undoAvailable(available)", available );
}
void Slots::timeout()
{
QObject *oObject = qobject_cast<QObject *>( sender() );
SlotsExecObject( oObject, ( char* ) "timeout()" );
}
/*
* harbour function to connect signals with slots
*/
@@ -1328,6 +1349,12 @@ HB_FUNC( QT_CONNECT_SIGNAL )
ret = widget->connect( widget, SIGNAL( undoAvailable( bool ) ),
s_s, SLOT( undoAvailable( bool ) ), Qt::AutoConnection );
}
if( signal == ( QString ) "timeout()" )
{
ret = widget->connect( widget, SIGNAL( timeout() ),
s_s, SLOT( timeout() ), Qt::AutoConnection );
}
hb_retl( ret );

View File

@@ -206,6 +206,7 @@ public slots:
void redoAvailable( bool available );
void textChanged();
void undoAvailable( bool available );
void timeout();
};
class Events: public QObject

View File

@@ -1,7 +1,7 @@
/****************************************************************************
** Meta object code from reading C++ file 'hbqt_slots.h'
**
** Created: Fri Jul 10 15:03:49 2009
** Created: Mon Jul 20 08:14:21 2009
** by: The Qt Meta Object Compiler version 61 (Qt 4.5.0)
**
** WARNING! All changes made in this file will be lost!
@@ -137,7 +137,7 @@ static const uint qt_meta_data_Slots[] = {
2, // revision
0, // classname
0, 0, // classinfo
82, 12, // methods
83, 12, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
@@ -225,6 +225,7 @@ static const uint qt_meta_data_Slots[] = {
2242, 2232, 6, 6, 0x0a,
2262, 6, 6, 6, 0x0a,
2276, 2232, 6, 6, 0x0a,
2296, 6, 6, 6, 0x0a,
0 // eod
};
@@ -292,7 +293,7 @@ static const char qt_meta_stringdata_Slots[] = {
"f\0currentCharFormatChanged(QTextCharFormat)\0"
"cursorPositionChanged()\0available\0"
"redoAvailable(bool)\0textChanged()\0"
"undoAvailable(bool)\0"
"undoAvailable(bool)\0timeout()\0"
};
const QMetaObject Slots::staticMetaObject = {
@@ -402,9 +403,10 @@ int Slots::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
case 79: redoAvailable((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 80: textChanged(); break;
case 81: undoAvailable((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 82: timeout(); break;
default: ;
}
_id -= 82;
_id -= 83;
}
return _id;
}