2011-03-22 18:12 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbqt/qtcore/qth/QMimeData.qth
  * contrib/hbqt/qtgui/qth/QDropEvent.qth
  * contrib/hbqt/qtgui/qth/QGraphicsSceneDragDropEvent.qth
    ! Fixed: some manual code which was not taking use of new protocol.

  * contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp
  * contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp
  * contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp
    ! Changed: hbqt_create_object() => hbqt_create_objectGC()
This commit is contained in:
Pritpal Bedi
2011-03-23 01:18:51 +00:00
parent 5e2f9f9a96
commit de3c57518e
7 changed files with 43 additions and 14 deletions

View File

@@ -16,6 +16,17 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-03-22 18:12 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtcore/qth/QMimeData.qth
* contrib/hbqt/qtgui/qth/QDropEvent.qth
* contrib/hbqt/qtgui/qth/QGraphicsSceneDragDropEvent.qth
! Fixed: some manual code which was not taking use of new protocol.
* contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp
* contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp
* contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp
! Changed: hbqt_create_object() => hbqt_create_objectGC()
2011-03-22 15:05 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtcore/hbqt_hbqevents.cpp
* contrib/hbqt/qtcore/hbqt_hbqslots.cpp

View File

@@ -62,15 +62,15 @@ QList<QUrl> urls () const
# Harbour Callable Function Till QList<QUrl> is not resolved
#
QStringList * hbUrlList() const{
QMimeData * p = hbqt_par_QMimeData( 1 );
if( p )
QMimeData * _mimedata = ( QMimeData * ) hbqt_pPtrFromObj( 0 );
if( _mimedata )
{
QStringList strList;
foreach ( QUrl url, ( p )->urls() )
foreach ( QUrl url, ( _mimedata )->urls() )
{
strList << ( QString ) url.toString().toAscii().data();
}
hb_retptrGC( hbqt_gcAllocate_QStringList( new QStringList( strList ), true ) );
hbqt_create_objectGC( hbqt_gcAllocate_QStringList( new QStringList( strList ), true ), "hb_QStringList" );
}
}
</PROTOS>

View File

@@ -67,6 +67,7 @@
HB_EXTERN_BEGIN
extern void * hbqt_gcAllocate_QPainter( void * pObj, bool bNew );
extern void * hbqt_gcAllocate_QGraphicsSceneContextMenuEvent( void * pObj, bool bNew );
HB_EXTERN_END
HBQGraphicsItem::HBQGraphicsItem( int type, QGraphicsItem * parent ) : QGraphicsItem( parent )
@@ -487,7 +488,7 @@ void HBQGraphicsItem::contextMenuEvent( QGraphicsSceneContextMenuEvent * event )
{
if( block ){
PHB_ITEM p1 = hb_itemPutNI( NULL, QEvent::GraphicsSceneContextMenu );
PHB_ITEM p2 = hbqt_create_object( event, "hb_QGraphicsSceneContextMenuEvent" );
PHB_ITEM p2 = hbqt_create_objectGC( hbqt_gcAllocate_QGraphicsSceneContextMenuEvent( event, false ), "hb_QGraphicsSceneContextMenuEvent" );
PHB_ITEM p3 = hb_itemPutC( NULL, objectName().toLatin1().data() );
hb_vmEvalBlockV( block, 3, p1, p2, p3 );
hb_itemRelease( p1 );

View File

@@ -64,6 +64,10 @@
#include "hbqt_hbqgraphicsscene.h"
HB_EXTERN_BEGIN
extern void * hbqt_gcAllocate_QGraphicsSceneContextMenuEvent( void * pObj, bool bNew );
extern void * hbqt_gcAllocate_QGraphicsSceneDragDropEvent( void * pObj, bool bNew );
HB_EXTERN_END
HBQGraphicsScene::HBQGraphicsScene( QObject * parent ) : QGraphicsScene( parent )
{
@@ -407,7 +411,7 @@ void HBQGraphicsScene::contextMenuEvent( QGraphicsSceneContextMenuEvent * event
if( ! item ){
if( block ){
PHB_ITEM p1 = hb_itemPutNI( NULL, QEvent::GraphicsSceneContextMenu );
PHB_ITEM p2 = hbqt_create_object( event, "hb_QGraphicsSceneContextMenuEvent" );
PHB_ITEM p2 = hbqt_create_objectGC( hbqt_gcAllocate_QGraphicsSceneContextMenuEvent( event, false ), "hb_QGraphicsSceneContextMenuEvent" );
hb_vmEvalBlockV( block, 2, p1, p2 );
hb_itemRelease( p1 );
hb_itemRelease( p2 );
@@ -421,7 +425,7 @@ void HBQGraphicsScene::dragEnterEvent( QGraphicsSceneDragDropEvent * event )
if( block )
{
PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDragEnter );
PHB_ITEM p2 = hbqt_create_object( event, "hb_QGraphicsSceneDragDropEvent" );
PHB_ITEM p2 = hbqt_create_objectGC( hbqt_gcAllocate_QGraphicsSceneDragDropEvent( event, false ), "hb_QGraphicsSceneDragDropEvent" );
hb_vmEvalBlockV( block, 2, p1, p2 );
hb_itemRelease( p1 );
hb_itemRelease( p2 );
@@ -436,7 +440,7 @@ void HBQGraphicsScene::dragLeaveEvent( QGraphicsSceneDragDropEvent * event )
if( block )
{
PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDragLeave );
PHB_ITEM p2 = hbqt_create_object( event, "hb_QGraphicsSceneDragDropEvent" );
PHB_ITEM p2 = hbqt_create_objectGC( hbqt_gcAllocate_QGraphicsSceneDragDropEvent( event, false ), "hb_QGraphicsSceneDragDropEvent" );
hb_vmEvalBlockV( block, 2, p1, p2 );
hb_itemRelease( p1 );
hb_itemRelease( p2 );
@@ -451,7 +455,7 @@ void HBQGraphicsScene::dragMoveEvent( QGraphicsSceneDragDropEvent * event )
if( block )
{
PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDragMove );
PHB_ITEM p2 = hbqt_create_object( event, "hb_QGraphicsSceneDragDropEvent" );
PHB_ITEM p2 = hbqt_create_objectGC( hbqt_gcAllocate_QGraphicsSceneDragDropEvent( event, false ), "hb_QGraphicsSceneDragDropEvent" );
hb_vmEvalBlockV( block, 2, p1, p2 );
hb_itemRelease( p1 );
hb_itemRelease( p2 );
@@ -470,7 +474,7 @@ void HBQGraphicsScene::dropEvent( QGraphicsSceneDragDropEvent * event )
if( mime->hasFormat( ( QString ) "application/x-qabstractitemmodeldatalist" ) )
{
PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDrop );
PHB_ITEM p2 = hbqt_create_object( event, "hb_QGraphicsSceneDragDropEvent" );
PHB_ITEM p2 = hbqt_create_objectGC( hbqt_gcAllocate_QGraphicsSceneDragDropEvent( event, false ), "hb_QGraphicsSceneDragDropEvent" );
PHB_ITEM p3 = hb_itemNew( NULL );
QTreeWidget * tree = dynamic_cast< QTreeWidget * >( event->source() );
@@ -498,7 +502,7 @@ void HBQGraphicsScene::dropEvent( QGraphicsSceneDragDropEvent * event )
else
{
PHB_ITEM p1 = hb_itemPutNI( NULL, ( int ) QEvent::GraphicsSceneDrop );
PHB_ITEM p2 = hbqt_create_object( event, "hb_QGraphicsSceneDragDropEvent" );
PHB_ITEM p2 = hbqt_create_objectGC( hbqt_gcAllocate_QGraphicsSceneDragDropEvent( event, false ), "hb_QGraphicsSceneDragDropEvent" );
hb_vmEvalBlockV( block, 2, p1, p2 );
hb_itemRelease( p1 );
hb_itemRelease( p2 );

View File

@@ -74,6 +74,10 @@
#include "hbqt_hbqplaintextedit.h"
HB_EXTERN_BEGIN
extern void * hbqt_gcAllocate_QKeyEvent( void * pObj, bool bNew );
HB_EXTERN_END
#include <QtGui/QApplication>
#define selectionState_off 0
@@ -1246,7 +1250,7 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event )
hb_arraySetNI( p2, 4, columnEnds );
hb_arraySetNI( p2, 5, selectionMode );
hb_arraySetNI( p2, 6, selectionState );
hb_arraySet( p2, 7, hbqt_create_object( event, "hb_QKeyEvent" ) );
hb_arraySet( p2, 7, hbqt_create_objectGC( hbqt_gcAllocate_QKeyEvent( event, false ), "hb_QKeyEvent" ) );
hb_vmEvalBlockV( block, 2, p1, p2 );
hb_itemRelease( p1 );
hb_itemRelease( p2 );

View File

@@ -21,6 +21,7 @@ Constructor = no
<CODE>
#include <QtGui/QDropEvent>
#include <QtCore/QMimeData>
/*
@@ -51,7 +52,11 @@ Qt::KeyboardModifiers keyboardModifiers () const
# how to construct dynamically - no separate keyword ???
#
const QMimeData * mimeData () const{
hb_retptrGC( hbqt_gcAllocate_QMimeData( ( void* ) hbqt_par_QDropEvent( 1 )->mimeData(), false ) );
QDropEvent * _dropevent = ( QDropEvent * ) hbqt_pPtrFromObj( 0 );
if( _dropevent )
{
hbqt_create_objectGC( hbqt_gcAllocate_QMimeData( ( void* ) _dropevent->mimeData(), true ), "hb_QMimeData" );
}
}
#
#

View File

@@ -45,7 +45,11 @@ void acceptProposedAction ()
Qt::MouseButtons buttons () const
Qt::DropAction dropAction () const
const QMimeData * mimeData () const{
hb_retptrGC( hbqt_gcAllocate_QMimeData( ( void* ) hbqt_par_QGraphicsSceneDragDropEvent( 1 )->mimeData(), false ) );
QGraphicsSceneDragDropEvent * _graphicsscenedragdropevent = ( QGraphicsSceneDragDropEvent * ) hbqt_pPtrFromObj( 0 );
if( _graphicsscenedragdropevent )
{
hbqt_create_objectGC( hbqt_gcAllocate_QMimeData( ( void* ) _graphicsscenedragdropevent->mimeData(), true ), "hb_QMimeData" );
}
}
Qt::KeyboardModifiers modifiers () const
QPointF pos () const