2009-12-10 23:22 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbqt/qth/QAbstractItemModel.qth
  * contrib/hbqt/qth/QTableView.qth
  * contrib/hbqt/hbqt_events.cpp
  * contrib/hbqt/hbqt_slots.cpp
  * contrib/hbqt/hbqt_hbqmainwindow.cpp
    + Added TOFIX (also one QUESTION) to these code parts.
      All of them are potential leak or GPF generator issues.
      Could someone take a look at these?

  * contrib/hbqt/Makefile
  - contrib/hbqt/hbqt_hbdrawingarea.h
  - contrib/hbqt/hbqt_hbdrawingarea.cpp
    - Deleted unused custom class.

  * contrib/hbqt/qtgui/QTableView.cpp
  * contrib/hbqt/qtcore/QAbstractItemModel.cpp
    * Regenerated.
This commit is contained in:
Viktor Szakats
2009-12-10 22:23:10 +00:00
parent b12029835e
commit f78ca011e7
11 changed files with 31 additions and 179 deletions

View File

@@ -17,6 +17,25 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-12-10 23:22 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbqt/qth/QAbstractItemModel.qth
* contrib/hbqt/qth/QTableView.qth
* contrib/hbqt/hbqt_events.cpp
* contrib/hbqt/hbqt_slots.cpp
* contrib/hbqt/hbqt_hbqmainwindow.cpp
+ Added TOFIX (also one QUESTION) to these code parts.
All of them are potential leak or GPF generator issues.
Could someone take a look at these?
* contrib/hbqt/Makefile
- contrib/hbqt/hbqt_hbdrawingarea.h
- contrib/hbqt/hbqt_hbdrawingarea.cpp
- Deleted unused custom class.
* contrib/hbqt/qtgui/QTableView.cpp
* contrib/hbqt/qtcore/QAbstractItemModel.cpp
* Regenerated.
2009-12-10 22:46 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbqt/hbqt_events.cpp
* contrib/hbqt/hbqt_slots.cpp

View File

@@ -18,7 +18,6 @@ ifneq ($(HB_HAS_QT),)
MOC_HEADERS := \
hbqt_events.h \
hbqt_hbdbfmodel.h \
hbqt_hbdrawingarea.h \
hbqt_hbqmainwindow.h \
hbqt_hbqsyntaxhighlighter.h \
hbqt_hbqtableview.h \
@@ -31,7 +30,6 @@ ifneq ($(HB_HAS_QT),)
hbqt_destruct.cpp \
hbqt_events.cpp \
hbqt_hbdbfmodel.cpp \
hbqt_hbdrawingarea.cpp \
hbqt_hbqmainwindow.cpp \
hbqt_hbqsyntaxhighlighter.cpp \
hbqt_hbqtableview.cpp \

View File

@@ -89,11 +89,13 @@ static Events * qt_getEventFilter( void )
return p_events->t_events;
}
/* TOFIX: Possible GPF is below pointer is used by .prg after release. */
HB_FUNC( QT_GETEVENTFILTER )
{
hb_retptr( qt_getEventFilter() );
}
/* TOFIX: Leak if .prg code doesn't call this explicitly. */
HB_FUNC( QT_EVENTS_DESTROY )
{
PHB_EVENTS p_events = HB_QTTHREAD_EVENTS();
@@ -113,6 +115,7 @@ Events::Events( QObject * parent ) : QObject( parent )
Events::~Events()
{
/* TOFIX: Possible leak of PHB_ITEMs stored in list. */
listBlock.clear();
}
@@ -123,7 +126,7 @@ bool Events::eventFilter( QObject * object, QEvent * event )
if( ( int ) eventtype == 0 )
return false;
char prop[ 10 ];
char prop[ 20 ];
hb_snprintf( prop, sizeof( prop ), "%s%i%s", "P", eventtype, "P" );
int found = object->property( prop ).toInt();

View File

@@ -1,96 +0,0 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* QT wrapper main header
*
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
*
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
* www - http://www.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 "hbapi.h"
#include "hbqt.h"
#if QT_VERSION >= 0x040500
#include "hbqt_hbdrawingarea.h"
HBDrawingArea::HBDrawingArea(QWidget *parent) : QWidget(parent)
{
setAttribute( Qt::WA_StaticContents );
setAttribute( Qt::WA_PaintOnScreen );
setAttribute( Qt::WA_DeleteOnClose );
setAttribute( Qt::WA_WindowPropagation );
setFocusPolicy( Qt::StrongFocus );
setMouseTracking( true );
setAttribute( Qt::WA_InputMethodEnabled, true );
}
HBDrawingArea::~HBDrawingArea( void )
{
}
void HBDrawingArea::mouseMoveEvent( QMouseEvent * event )
{
emit sg_mouseMoveEvent( event );
}
void HBDrawingArea::keyPressEvent( QKeyEvent * event )
{
emit sg_keyPressEvent( event );
}
HB_FUNC( QT_HBDRAWINGAREA )
{
hb_retptr( ( HBDrawingArea * ) new HBDrawingArea() );
}
#endif

View File

@@ -1,80 +0,0 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* QT wrapper main header
*
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
*
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
* www - http://www.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.
*
*/
#ifndef HBQT_HBDRAWINGAREA_H
#define HBQT_HBDRAWINGAREA_H
/*----------------------------------------------------------------------*/
#include <QWidget>
class HBDrawingArea : public QWidget
{
Q_OBJECT
public:
HBDrawingArea( QWidget *parent = 0 );
virtual ~HBDrawingArea( void );
void keyPressEvent( QKeyEvent * event );
void mouseMoveEvent( QMouseEvent * event );
signals:
void sg_mouseMoveEvent( QMouseEvent * event );
void sg_keyPressEvent( QKeyEvent * event );
};
/*----------------------------------------------------------------------*/
#endif

View File

@@ -289,6 +289,7 @@ HB_FUNC( QT_HBQMAINWINDOW )
hb_retptr( ( HBQMainWindow * ) new HBQMainWindow( hb_itemNew( hb_param( 1, HB_IT_BLOCK ) ), hb_parni( 2 ) ) );
}
/* TOFIX: Leak if .prg code doesn't call this explicitly. */
HB_FUNC( QT_HBQMAINWINDOW_DESTROY )
{
hbqt_par_HBQMainWindow( 1 )->~HBQMainWindow();

View File

@@ -87,6 +87,8 @@ static Slots * qt_getEventSlots( void )
return p_slots->t_slots;
}
/* TOFIX: Leak if .prg code doesn't call this explicitly.
QUESTION: Should there be all remaining active slots disconnected at this point? */
HB_FUNC( QT_SLOTS_DESTROY )
{
PHB_SLOTS p_slots = HB_QTTHREAD_SLOTS();
@@ -106,6 +108,7 @@ Slots::Slots( QObject* parent ) : QObject( parent )
Slots::~Slots()
{
/* TOFIX: Possible leak of PHB_ITEMs stored in list. */
listBlock.clear();
}

View File

@@ -116,6 +116,7 @@ HB_FUNC( QT_HBDBFMODEL_HBSETROWCOLUMNS )
hbqt_par_HBDbfModel( 1 )->hbSetRowColumns( hb_parni( 2 ), hb_parni( 3 ) );
}
/* TOFIX: Leak if .prg code doesn't call this explicitly. */
HB_FUNC( QT_HBDBFMODEL_DESTROY )
{
// BI:TODO fix the GPF hbqt_par_HBDbfModel( 1 )->~HBDbfModel();

View File

@@ -87,6 +87,7 @@ HB_FUNC( QT_HBQTABLEVIEW_NAVIGATE )
hb_retptr( new QModelIndex( hbqt_par_HBQTableView( 1 )->navigate( hb_parni( 2 ) ) ) );
}
/* TOFIX: Leak if .prg code doesn't call this explicitly. */
HB_FUNC( QT_HBQTABLEVIEW_DESTROY )
{
hbqt_par_HBQTableView( 1 )->~HBQTableView();

View File

@@ -127,6 +127,7 @@ HB_FUNC( QT_HBDBFMODEL_HBSETROWCOLUMNS )
hbqt_par_HBDbfModel( 1 )->hbSetRowColumns( hb_parni( 2 ), hb_parni( 3 ) );
}
/* TOFIX: Leak if .prg code doesn't call this explicitly. */
HB_FUNC( QT_HBDBFMODEL_DESTROY )
{
// BI:TODO fix the GPF hbqt_par_HBDbfModel( 1 )->~HBDbfModel();

View File

@@ -104,6 +104,7 @@ HB_FUNC( QT_HBQTABLEVIEW_NAVIGATE )
hb_retptr( new QModelIndex( hbqt_par_HBQTableView( 1 )->navigate( hb_parni( 2 ) ) ) );
}
/* TOFIX: Leak if .prg code doesn't call this explicitly. */
HB_FUNC( QT_HBQTABLEVIEW_DESTROY )
{
hbqt_par_HBQTableView( 1 )->~HBQTableView();