2010-01-03 14:07 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbqt/qth/QApplication.qth
    * Minor optimizations.
    % One static var deleted.
    ; TOFIX/TOCHECK: argv/argc usage.

  * contrib/hbqt/qtgui/QApplication.cpp
  * contrib/hbqt/hbqt_garbage.h
    * Regenerated.

  * contrib/hbxbp/xbpgeneric.prg
    - Deleted unused statics.
    ; TOFIX: HBQT has an irregularity which I couldn't find a
             reason yet. It maintains a pointer to QApplication
             in a static variable on C level, plus every HBQT
             app maintains a copy of the QApp object in a .prg
             level STATIC var. Both are inited using C/prg
             level init/exit functions.
This commit is contained in:
Viktor Szakats
2010-01-03 13:08:07 +00:00
parent d2c818eab8
commit 87e26037c0
5 changed files with 33 additions and 42 deletions

View File

@@ -17,6 +17,25 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-01-03 14:07 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbqt/qth/QApplication.qth
* Minor optimizations.
% One static var deleted.
; TOFIX/TOCHECK: argv/argc usage.
* contrib/hbqt/qtgui/QApplication.cpp
* contrib/hbqt/hbqt_garbage.h
* Regenerated.
* contrib/hbxbp/xbpgeneric.prg
- Deleted unused statics.
; TOFIX: HBQT has an irregularity which I couldn't find a
reason yet. It maintains a pointer to QApplication
in a static variable on C level, plus every HBQT
app maintains a copy of the QApp object in a .prg
level STATIC var. Both are inited using C/prg
level init/exit functions.
2010-01-03 13:40 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* ChangeLog
! Fixed accindentally committed corrupted file in prev commit.

View File

@@ -1,14 +1,13 @@
/*
* $Id$
*
*
* --------------------------------------------------------------------
* WARNING: Automatically generated source file. DO NOT EDIT!
* Instead, edit corresponding .qth file,
* or the generator tool itself, and run regenarate.
* --------------------------------------------------------------------
*/
/* -------------------------------------------------------------------- */
/* WARNING: Automatically generated source file. DO NOT EDIT! */
/* Instead, edit corresponding .qth file, */
/* or the generator tool itself, and run regenarate. */
/* -------------------------------------------------------------------- */
extern QT_G_FUNC( hbqt_gcRelease_QAbstractButton );
extern QT_G_FUNC( hbqt_gcRelease_QAbstractItemDelegate );
extern QT_G_FUNC( hbqt_gcRelease_QAbstractItemModel );

View File

@@ -91,10 +91,7 @@
#include <QtCore/QLocale>
#include <QtGui/QIcon>
//void release_codeblocks();
static QApplication * s_app = NULL;
static bool s_hbqtinit = false;
static int s_argc;
static char ** s_argv;
@@ -114,8 +111,6 @@ HB_FUNC( HB_QT ) {;}
static void hbqt_Exit( void * cargo )
{
HB_SYMBOL_UNUSED( cargo );
//release_codeblocks();
}
static void hbqt_Init( void * cargo )
@@ -127,19 +122,15 @@ static void hbqt_Init( void * cargo )
s_app = new QApplication( s_argc, s_argv );
if( s_app )
s_hbqtinit = true;
if( ! s_hbqtinit )
if( ! s_app )
hb_errInternal( 11001, "hbqt_Init(): QT Initilization Error.", NULL, NULL );
hb_cmdargInit( s_argc, s_argv );
hb_vmAtExit( hbqt_Exit, NULL );
}
HB_CALL_ON_STARTUP_BEGIN( _hb_hbqt_init_ )
hb_vmAtInit( hbqt_Init, NULL );
hb_vmAtExit( hbqt_Exit, NULL );
HB_CALL_ON_STARTUP_END( _hb_hbqt_init_ )
#if defined( HB_PRAGMA_STARTUP )

View File

@@ -78,10 +78,7 @@ New =
#include <QtCore/QLocale>
#include <QtGui/QIcon>
//void release_codeblocks();
static QApplication * s_app = NULL;
static bool s_hbqtinit = false;
static int s_argc;
static char ** s_argv;
@@ -105,8 +102,6 @@ HB_FUNC( QT_QAPPLICATION )
static void hbqt_Exit( void * cargo )
{
HB_SYMBOL_UNUSED( cargo );
//release_codeblocks();
}
static void hbqt_Init( void * cargo )
@@ -118,19 +113,15 @@ static void hbqt_Init( void * cargo )
s_app = new QApplication( s_argc, s_argv );
if( s_app )
s_hbqtinit = true;
if( ! s_hbqtinit )
if( ! s_app )
hb_errInternal( 11001, "hbqt_Init(): QT Initilization Error.", NULL, NULL );
hb_cmdargInit( s_argc, s_argv );
hb_vmAtExit( hbqt_Exit, NULL );
}
HB_CALL_ON_STARTUP_BEGIN( _hb_hbqt_init_ )
hb_vmAtInit( hbqt_Init, NULL );
hb_vmAtExit( hbqt_Exit, NULL );
HB_CALL_ON_STARTUP_END( _hb_hbqt_init_ )
#if defined( HB_PRAGMA_STARTUP )

View File

@@ -78,27 +78,24 @@
/*----------------------------------------------------------------------*/
STATIC s_oDeskTop
STATIC s_mutex := hb_mutexCreate()
STATIC s_oApp
THREAD STATIC t_aEventLoop
THREAD STATIC t_events
THREAD STATIC t_nEventIn := 0
THREAD STATIC t_nEventOut := 0
THREAD STATIC t_oDummy
THREAD STATIC t_oAppWindow
THREAD STATIC t_oEventLoop
THREAD STATIC t_oXbpInFocus
/*----------------------------------------------------------------------*/
INIT PROCEDURE hbxbp_Start()
t_oDummy := XbpObject():new()
s_oApp := QApplication():new()
s_oApp := QApplication():new()
RETURN
@@ -106,17 +103,13 @@ INIT PROCEDURE hbxbp_Start()
EXIT PROCEDURE hbxbp_End()
t_oDummy := NIL
t_oAppWindow := NIL
t_oAppWindow := NIL
IF hb_isObject( s_oDeskTop )
s_oDeskTop:oWidget:pPtr := 0
endif
s_oApp:quit()
#if 0
s_oApp:oWidget:pPtr := 0
#endif
RETURN
@@ -227,8 +220,6 @@ FUNCTION SetAppWindow( oXbp )
FUNCTION SetAppFocus( oXbp )
LOCAL oldXbpInFocus
THREAD STATIC t_oXbpInFocus
oldXbpInFocus := t_oXbpInFocus
IF hb_isObject( oXbp )