* contrib/hbqt/gtqtc/gtqtc.cpp
* contrib/hbqt/hbmk2_qt.hb
* contrib/hbqt/qtcore/hbqt.h
* contrib/hbqt/qtcore/hbqt_bind.cpp
* contrib/hbqt/qtcore/hbqt_hbqevents.cpp
* contrib/hbqt/qtcore/hbqt_hbqslots.cpp
* contrib/hbqt/qtcore/hbqt_init.cpp
* contrib/hbqt/qtcore/hbqt_misc.prg
* contrib/hbqt/qtcore/hbqt_pointer.cpp
* contrib/hbqt/qtcore/qth/HBQEvents.qth
* contrib/hbqt/qtcore/qth/HBQSlots.qth
* contrib/hbqt/qtcore/qth/QLibraryInfo.qth
* contrib/hbqt/qtcore/qth/QMimeData.qth
* contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp
* contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp
* contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp
* contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp
* contrib/hbqt/qtgui/hbqt_hbqtableview.cpp
* contrib/hbqt/qtgui/hbqt_init.cpp
* contrib/hbqt/qtgui/qth/HBQAbstractItemModel.qth
* contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth
* contrib/hbqt/qtgui/qth/HBQGraphicsScene.qth
* contrib/hbqt/qtgui/qth/HBQPlainTextEdit.qth
* contrib/hbqt/qtgui/qth/HBQTableView.qth
* contrib/hbqt/qtgui/qth/QApplication.qth
* contrib/hbqt/qtgui/qth/QClipboard.qth
* contrib/hbqt/qtgui/qth/QDirModel.qth
* contrib/hbqt/qtgui/qth/QDropEvent.qth
* contrib/hbqt/qtgui/qth/QFileSystemModel.qth
* contrib/hbqt/qtgui/qth/QGraphicsSceneDragDropEvent.qth
* contrib/hbqt/qtnetwork/hbqt_init.cpp
* contrib/hbqt/tests/draggable.prg
* contrib/hbxbp/xbpbrowse.prg
* contrib/hbide/ideedit.prg
* contrib/hbide/idefindreplace.prg
+ Implemented: Revamped HBQT.
The complete code base has been cleaned as per new API
and there is no leftover is kept inside the sources.
All demos and hbIDE seems TO be working fine with few
exceptions here and there, but usually all seems fine.
The only issue left, so far I can assess is that no object
is subject to destrution if a connect is issued onto that.
And I have no idea how TO handle this situation. It is the
programmers responsibility to disconnect whenever an object
is supposed to go out of scope.
TODO: still debug tracelog entries ( under HB_TR_DEBUG ) are
retained in hbqt_bind.c which are schduled TO be
removed once code base stabilizes enough.
162 lines
4.7 KiB
C++
162 lines
4.7 KiB
C++
/*
|
|
* $Id$
|
|
*/
|
|
|
|
/*
|
|
* Harbour Project source code:
|
|
* QT wrapper main header
|
|
*
|
|
* Copyright 2009-2010 Pritpal Bedi <bedipritpal@hotmail.com>
|
|
* www - http://harbour-project.org
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this software; see the file COPYING. If not, write to
|
|
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
|
*
|
|
* As a special exception, the Harbour Project gives permission for
|
|
* additional uses of the text contained in its release of Harbour.
|
|
*
|
|
* The exception is that, if you link the Harbour libraries with other
|
|
* files to produce an executable, this does not by itself cause the
|
|
* resulting executable to be covered by the GNU General Public License.
|
|
* Your use of that executable is in no way restricted on account of
|
|
* linking the Harbour library code into it.
|
|
*
|
|
* This exception does not however invalidate any other reasons why
|
|
* the executable file might be covered by the GNU General Public License.
|
|
*
|
|
* This exception applies only to the code released by the Harbour
|
|
* Project under the name Harbour. If you copy code from other
|
|
* Harbour Project or Free Software Foundation releases into a copy of
|
|
* Harbour, as the General Public License permits, the exception does
|
|
* not apply to the code that you add in this way. To avoid misleading
|
|
* anyone as to the status of such modified files, you must delete
|
|
* this exception notice from them.
|
|
*
|
|
* If you write modifications of your own for Harbour, it is your choice
|
|
* whether to permit this exception to apply to your modifications.
|
|
* If you do not wish that, delete this exception notice.
|
|
*
|
|
*/
|
|
|
|
#include "hbqt.h"
|
|
|
|
#include "hbapiitm.h"
|
|
#include "hbvm.h"
|
|
|
|
#if QT_VERSION >= 0x040500
|
|
|
|
#include "hbqt_hbqtableview.h"
|
|
|
|
#include <QtCore/QPointer>
|
|
|
|
|
|
HBQTableView::HBQTableView( QWidget * parent ) : QTableView( parent )
|
|
{
|
|
block = NULL;
|
|
}
|
|
|
|
HBQTableView::~HBQTableView()
|
|
{
|
|
if( block )
|
|
{
|
|
hb_itemRelease( block );
|
|
block = NULL;
|
|
}
|
|
}
|
|
|
|
void HBQTableView::hbSetBlock( PHB_ITEM b )
|
|
{
|
|
if( b )
|
|
{
|
|
if( block )
|
|
{
|
|
hb_itemRelease( block );
|
|
}
|
|
block = hb_itemNew( b );
|
|
// hb_gcUnlock( block );
|
|
}
|
|
}
|
|
|
|
void HBQTableView::mousePressEvent( QMouseEvent * event )
|
|
{
|
|
if( block )
|
|
{
|
|
PHB_ITEM p0 = hb_itemPutNI( NULL, QEvent::MouseButtonPress );
|
|
PHB_ITEM p1 = hbqt_bindGetHbObject( NULL, ( void * ) event, "HB_QMOUSEEVENT", NULL, 0 );
|
|
hb_vmEvalBlockV( block, 2, p0, p1 );
|
|
hb_itemRelease( p0 );
|
|
hb_itemRelease( p1 );
|
|
}
|
|
QTableView::mousePressEvent( event );
|
|
}
|
|
|
|
void HBQTableView::mouseDoubleClickEvent( QMouseEvent * event )
|
|
{
|
|
if( block )
|
|
{
|
|
PHB_ITEM p0 = hb_itemPutNI( NULL, QEvent::MouseButtonDblClick );
|
|
PHB_ITEM p1 = hbqt_bindGetHbObject( NULL, ( void * ) event, "HB_QMOUSEEVENT", NULL, 0 );
|
|
hb_vmEvalBlockV( block, 2, p0, p1 );
|
|
hb_itemRelease( p0 );
|
|
hb_itemRelease( p1 );
|
|
}
|
|
QTableView::mouseDoubleClickEvent( event );
|
|
}
|
|
|
|
void HBQTableView::wheelEvent( QWheelEvent * event )
|
|
{
|
|
if( block )
|
|
{
|
|
PHB_ITEM p0 = hb_itemPutNI( NULL, QEvent::Wheel );
|
|
PHB_ITEM p1 = hbqt_bindGetHbObject( NULL, ( void * ) event, "HB_QWHEELEVENT", NULL, 0 );
|
|
hb_vmEvalBlockV( block, 2, p0, p1 );
|
|
hb_itemRelease( p0 );
|
|
hb_itemRelease( p1 );
|
|
}
|
|
QTableView::wheelEvent( event );
|
|
}
|
|
|
|
void HBQTableView::scrollContentsBy( int x, int y )
|
|
{
|
|
if( block )
|
|
{
|
|
PHB_ITEM p0 = hb_itemPutNI( NULL, HBQT_HBQTABLEVIEW_scrollContentsBy );
|
|
PHB_ITEM p1 = hb_itemPutNI( NULL, x );
|
|
PHB_ITEM p2 = hb_itemPutNI( NULL, y );
|
|
hb_vmEvalBlockV( block, 3, p0, p1, p2 );
|
|
hb_itemRelease( p0 );
|
|
hb_itemRelease( p1 );
|
|
hb_itemRelease( p2 );
|
|
}
|
|
QTableView::scrollContentsBy( x, y );
|
|
}
|
|
|
|
QModelIndex HBQTableView::moveCursor( HBQTableView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers )
|
|
{
|
|
return QTableView::moveCursor( cursorAction, modifiers );
|
|
}
|
|
|
|
QModelIndex HBQTableView::navigate( int cursorAction )
|
|
{
|
|
return moveCursor( ( HBQTableView::CursorAction ) cursorAction, ( Qt::KeyboardModifiers ) 0 );
|
|
}
|
|
|
|
void HBQTableView::scrollTo( const QModelIndex & index, QAbstractItemView::ScrollHint hint )
|
|
{
|
|
QTableView::scrollTo( index, hint );
|
|
}
|
|
|
|
#endif
|