2009-11-25 18:53 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

* contrib/hbide/hbide.prg
  * contrib/hbide/ideactions.prg

  * contrib/hbqt/generator/qt45.qtp

  * contrib/hbqt/hbqt.ch
  * contrib/hbqt/hbqt.h
  * contrib/hbqt/hbqt.hbc
  * contrib/hbqt/hbqt_destruct.cpp
  * contrib/hbqt/hbqt_garbage.h

  * contrib/hbqt/qtcore/filelist.mk

  + contrib/hbqt/qtcore/QUiLoader.cpp
  + contrib/hbqt/qtcore/TQUiLoader.prg
  + contrib/hbqt/qth/QUiLoader.qth

  * contrib/hbxbp/xbpcombobox.prg
  * contrib/hbxbp/xbpparthandler.prg
  * contrib/hbxbp/xbppushbutton.prg
  * contrib/hbxbp/xbpwindow.prg

  * contrib/hbide/resources/finddialog.ui
    + Implemented some very basic support for "Qt Creator" designer created .ui forms.
    + Based on above implementation hbide now supports "Find" operation. It is set to 
      search "Harbour" at present and is scheduled to be perfected this week-end.
This commit is contained in:
Pritpal Bedi
2009-11-26 03:05:18 +00:00
parent e1ba8c6f23
commit ee48139899
18 changed files with 1018 additions and 38 deletions

View File

@@ -17,6 +17,34 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-11-25 18:53 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbide/hbide.prg
* contrib/hbide/ideactions.prg
* contrib/hbqt/generator/qt45.qtp
* contrib/hbqt/hbqt.ch
* contrib/hbqt/hbqt.h
* contrib/hbqt/hbqt.hbc
* contrib/hbqt/hbqt_destruct.cpp
* contrib/hbqt/hbqt_garbage.h
* contrib/hbqt/qtcore/filelist.mk
+ contrib/hbqt/qtcore/QUiLoader.cpp
+ contrib/hbqt/qtcore/TQUiLoader.prg
+ contrib/hbqt/qth/QUiLoader.qth
* contrib/hbxbp/xbpcombobox.prg
* contrib/hbxbp/xbpparthandler.prg
* contrib/hbxbp/xbppushbutton.prg
* contrib/hbxbp/xbpwindow.prg
* contrib/hbide/resources/finddialog.ui
+ Implemented some very basic support for "Qt Creator" designer created .ui forms.
+ Based on above implementation hbide now supports "Find" operation. It is set to
search "Harbour" at present and is scheduled to be perfected this week-end.
2009-11-26 03:45 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
* harbour/include/hbvm.h

View File

@@ -121,6 +121,7 @@ CLASS HbIde
DATA qSplitterL
DATA qSplitterR
DATA qTabWidget
DATA qFindDlg
ACCESS qCurEdit INLINE iif( ::getCurrentTab() > 0, ::aTabs[ ::getCurrentTab(), 2 ], NIL )
/* XBP Objects */
@@ -290,8 +291,6 @@ METHOD HbIde:create( cProjectOrSource )
::qSplitter:show()
#endif
::loadUI( "newproject" )
::oDlg:setPos( { 100, 60 } )
/* Editor's Font */
@@ -323,12 +322,22 @@ METHOD HbIde:create( cProjectOrSource )
::closeAllSources()
EXIT
ELSEIF ( ::nEvent == xbeP_Keyboard .and. ::mp1 == xbeK_ESC )
::closeSource()
IF ::qTabWidget:count() == 0
::oDockR:hide()
::lDockRVisible := .f.
ENDIF
ELSEIF ::nEvent == xbeP_Keyboard
DO CASE
CASE ::mp1 == xbeK_ESC
::closeSource()
IF ::qTabWidget:count() == 0
::oDockR:hide()
::lDockRVisible := .f.
ENDIF
CASE ::mp1 == xbeK_CTRL_F
IF !empty( ::qCurEdit )
::loadUI( "finddialog" )
ENDIF
ENDCASE
ENDIF
::oXbp:handleEvent( ::nEvent, ::mp1, ::mp2 )
@@ -350,22 +359,17 @@ METHOD HbIde:executeAction( cKey )
CASE cKey == "Exit"
PostAppEvent( xbeP_Close, NIL, NIL, ::oDlg )
CASE cKey == "NewProject"
::fetchProjectProperties( .t. )
CASE cKey == "Open"
IF !empty( cFile := ::selectSource( "open" ) )
::oProjRoot:addItem( cFile )
::editSource( cFile )
ENDIF
CASE cKey == "Save"
::saveSource( ::getCurrentTab(), .f. )
CASE cKey == "Close"
::closeSource()
CASE cKey == "Undo"
IF !empty( ::qCurEdit )
::qCurEdit:undo()
@@ -390,6 +394,10 @@ METHOD HbIde:executeAction( cKey )
IF !empty( ::qCurEdit )
::qCurEdit:selectAll()
ENDIF
CASE cKey == "Find"
IF !empty( ::qCurEdit )
::loadUI( "finddialog" )
ENDIF
CASE cKey == "ToUpper"
::convertSelection( cKey )
CASE cKey == "ToLower"
@@ -404,7 +412,6 @@ METHOD HbIde:executeAction( cKey )
IF !empty( ::qCurEdit )
::qCurEdit:zoomOut()
ENDIF
CASE cKey == "11"
IF ::lDockBVisible
::oDockB:hide()
@@ -417,7 +424,6 @@ METHOD HbIde:executeAction( cKey )
::oDockB2:show()
::lDockBVisible := .t.
ENDIF
CASE cKey == "12"
IF ::lDockRVisible
::oDockR:hide()
@@ -426,6 +432,8 @@ METHOD HbIde:executeAction( cKey )
ENDIF
::lDockRVisible := !( ::lDockRVisible )
CASE cKey == "Compile"
ENDCASE
::manageFocusInEditor()
@@ -1098,24 +1106,36 @@ METHOD HbIde:fetchProjectProperties( lNewProject )
/*----------------------------------------------------------------------*/
METHOD HbIde:loadUI( cUi )
LOCAL qUiLoader, qFile, cUiFull
HB_SYMBOL_UNUSED( cUi )
STATIC oPBFind, oPBRepl, oPBClose, qFind, qRepl
#if 0
LOCAL qUiLoader, qStrList
LOCAL cUiFull := s_resPath + cUi + ".ui"
IF ::qFindDlg == NIL
cUiFull := s_resPath + cUi + ".ui"
qFile := QFile():new( cUiFull )
IF qFile:open( 1 )
qUiLoader := QUiLoader():new()
::qFindDlg := QDialog():configure( qUiLoader:load( QT_PTROF( qFile ), QT_PTROFXBP( ::oDlg ) ) )
qFile:close()
::qFindDlg:setWindowFlags( Qt_Sheet )
//
oPBFind := XbpPushButton():new():createFromQtPtr( , , , , , , Qt_findChild( QT_PTROF( ::qFindDlg ), "buttonFind" ) )
oPBFind:activate := {|| ::qCurEdit:find( "Harbour" ) }
HBXBP_DEBUG( 0, cUiFull )
qUiLoader := QUiLoader():new()
HBXBP_DEBUG( 1 )
qUiLoader:load( cUiFull, QT_PTROFXBP( ::oDlg ) )
HBXBP_DEBUG( 2 )
qStrList := QStringList():configure( qUiLoader:availableWidgets() )
HBXBP_DEBUG( 3 )
HBXBP_DEBUG( qStrList:count() )
HBXBP_DEBUG( 4 )
HBXBP_DEBUG( qUiLoader:workingDirectory() )
#endif
oPBRepl := XbpPushButton():new():createFromQtPtr( , , , , , , Qt_findChild( QT_PTROF( ::qFindDlg ), "buttonReplace" ) )
oPBRepl:activate := {|| ::qCurEdit:find( "something" ) }
oPBClose := XbpPushButton():new():createFromQtPtr( , , , , , , Qt_findChild( QT_PTROF( ::qFindDlg ), "buttonClose" ) )
oPBClose:activate := {|| ::qFindDlg:hide() /*done( 1 )*/ }
qFind := XbpComboBox():new():createFromQtPtr( , , , , , , Qt_findChild( QT_PTROF( ::qFindDlg ), "comboFindWhat" ) )
qRepl := XbpComboBox():new():createFromQtPtr( , , , , , , Qt_findChild( QT_PTROF( ::qFindDlg ), "comboReplaceWith" ) )
JustACall( qFind, qRepl )
ENDIF
ENDIF
::qFindDlg:show()
RETURN Self

View File

@@ -107,8 +107,8 @@ FUNCTION buildToolBar( oWnd, oIde )
oTBar:addItem( "Select All" , cResPath + "selectall.png" , , , , , "SelectAll" )
oTBar:addItem( "Column/Stream Selection" , cResPath + "stream.png" , , , , , "19" )
oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR )
oTBar:addItem( "Find" , cResPath + "find.png" , , , , , "20" )
oTBar:addItem( "Search" , cResPath + "search.png" , , , , , "21" )
oTBar:addItem( "Find" , cResPath + "find.png" , , , , , "Find" )
oTBar:addItem( "Search" , cResPath + "search.png" , , , , , "Search" )
oTBar:addItem( , , , , , XBPTOOLBAR_BUTTON_SEPARATOR )
oTBar:addItem( "Place/Remove Mark" , cResPath + "placeremovemark.png", , , , , "22" )
oTBar:addItem( "Goto Mark" , cResPath + "gotomark.png" , , , , , "23" )

View File

@@ -0,0 +1,268 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogFind</class>
<widget class="QDialog" name="DialogFind">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>463</width>
<height>212</height>
</rect>
</property>
<property name="windowTitle">
<string>Find and Replace</string>
</property>
<widget class="QGroupBox" name="groupBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>12</x>
<y>12</y>
<width>353</width>
<height>189</height>
</rect>
</property>
<property name="title">
<string/>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>16</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Find what:</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>10</x>
<y>132</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Replace with:</string>
</property>
</widget>
<widget class="QCheckBox" name="checkMatchCase">
<property name="geometry">
<rect>
<x>90</x>
<y>40</y>
<width>81</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string>Match case</string>
</property>
</widget>
<widget class="QCheckBox" name="checkListOnly">
<property name="geometry">
<rect>
<x>260</x>
<y>40</y>
<width>71</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string>List only</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_2">
<property name="geometry">
<rect>
<x>88</x>
<y>68</y>
<width>161</width>
<height>49</height>
</rect>
</property>
<property name="title">
<string/>
</property>
<widget class="QRadioButton" name="radioFromCursor">
<property name="geometry">
<rect>
<x>12</x>
<y>4</y>
<width>141</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string>Start from cursor position</string>
</property>
</widget>
<widget class="QRadioButton" name="radioEntire">
<property name="geometry">
<rect>
<x>12</x>
<y>24</y>
<width>141</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string>Entire file</string>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox_3">
<property name="geometry">
<rect>
<x>260</x>
<y>68</y>
<width>81</width>
<height>49</height>
</rect>
</property>
<property name="title">
<string/>
</property>
<widget class="QRadioButton" name="radioUp">
<property name="geometry">
<rect>
<x>10</x>
<y>4</y>
<width>41</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string>up</string>
</property>
</widget>
<widget class="QRadioButton" name="radioDown">
<property name="geometry">
<rect>
<x>10</x>
<y>24</y>
<width>51</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string>Down</string>
</property>
</widget>
</widget>
<widget class="QComboBox" name="comboFindWhat">
<property name="geometry">
<rect>
<x>88</x>
<y>12</y>
<width>253</width>
<height>22</height>
</rect>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
<widget class="QComboBox" name="comboReplaceWith">
<property name="geometry">
<rect>
<x>88</x>
<y>128</y>
<width>253</width>
<height>22</height>
</rect>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
<widget class="QCheckBox" name="checkGlobal">
<property name="geometry">
<rect>
<x>88</x>
<y>160</y>
<width>71</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string>Global</string>
</property>
</widget>
<widget class="QCheckBox" name="checkNoPrompting">
<property name="geometry">
<rect>
<x>248</x>
<y>160</y>
<width>89</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string>No prompting</string>
</property>
</widget>
</widget>
<widget class="QPushButton" name="buttonFind">
<property name="geometry">
<rect>
<x>376</x>
<y>24</y>
<width>75</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>Find</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="buttonReplace">
<property name="geometry">
<rect>
<x>376</x>
<y>140</y>
<width>75</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>Replace</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
<widget class="QPushButton" name="buttonClose">
<property name="geometry">
<rect>
<x>376</x>
<y>172</y>
<width>75</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>Close</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -260,6 +260,7 @@ QTranslator.qth
QTreeView.qth
QTreeWidget.qth
QTreeWidgetItem.qth
;QUiLoader.qth
QUrl.qth
QValidator.qth
QVariant.qth

View File

@@ -2169,6 +2169,39 @@
#define QTextDocument_StyleSheetResource 3 // The resource contains CSS.
#define QTextDocument_UserResource 100 // The first available value for user defined resource types.
// This enum describes the errors that may be returned by the error() function.
#define QFile_NoError 0 // No error occurred.
#define QFile_ReadError 1 // An error occurred when reading from the file.
#define QFile_WriteError 2 // An error occurred when writing to the file.
#define QFile_FatalError 3 // A fatal error occurred.
#define QFile_ResourceError 4 //
#define QFile_OpenError 5 // The file could not be opened.
#define QFile_AbortError 6 // The operation was aborted.
#define QFile_TimeOutError 7 // A timeout occurred.
#define QFile_UnspecifiedError 8 // An unspecified error occurred.
#define QFile_RemoveError 9 // The file could not be removed.
#define QFile_RenameError 10 // The file could not be renamed.
#define QFile_PositionError 11 // The position in the file could not be changed.
#define QFile_ResizeError 12 // The file could not be resized.
#define QFile_PermissionsError 13 // The file could not be accessed.
#define QFile_CopyError 14 // The file could not be copied.
#define QFile_NoOptions 0 // No options.
// This enum is used by the permission() function to report the permissions and ownership of a file. The values may be OR-ed together to test multiple permissions and ownership values.
#define QFile_ReadOwner 0x4000 // The file is readable by the owner of the file.
#define QFile_WriteOwner 0x2000 // The file is writable by the owner of the file.
#define QFile_ExeOwner 0x1000 // The file is executable by the owner of the file.
#define QFile_ReadUser 0x0400 // The file is readable by the user.
#define QFile_WriteUser 0x0200 // The file is writable by the user.
#define QFile_ExeUser 0x0100 // The file is executable by the user.
#define QFile_ReadGroup 0x0040 // The file is readable by the group.
#define QFile_WriteGroup 0x0020 // The file is writable by the group.
#define QFile_ExeGroup 0x0010 // The file is executable by the group.
#define QFile_ReadOther 0x0004 // The file is readable by anyone.
#define QFile_WriteOther 0x0002 // The file is writable by anyone.
#define QFile_ExeOther 0x0001 // The file is executable by anyone.
/*----------------------------------------------------------------------*/
#define _HBQT_CH

View File

@@ -350,6 +350,7 @@ const HB_GC_FUNCS * gcFuncs( void );
#define hbqt_par_QTreeView( n ) ( ( QTreeView * ) hbqt_gcpointer( n ) )
#define hbqt_par_QTreeWidget( n ) ( ( QTreeWidget * ) hbqt_gcpointer( n ) )
#define hbqt_par_QTreeWidgetItem( n ) ( ( QTreeWidgetItem * ) hbqt_gcpointer( n ) )
#define hbqt_par_QUiLoader( n ) ( ( QUiLoader * ) hbqt_gcpointer( n ) )
#define hbqt_par_QUrl( n ) ( ( QUrl * ) hbqt_gcpointer( n ) )
#define hbqt_par_QValidator( n ) ( ( QValidator * ) hbqt_gcpointer( n ) )
#define hbqt_par_QVariant( n ) ( ( QVariant * ) hbqt_gcpointer( n ) )

View File

@@ -10,7 +10,7 @@ libs=hbqt
libs=hbqtcore hbqtgui hbqtnetwork
{win}libs=version shlwapi
{allwin}libs=QtCore4 QtGui4 QtNetwork4
{allwin}libs=QtCore4 QtGui4 QtNetwork4 QtUiTools
{linux}libs=QtCore QtGui QtNetwork
{darwin}libs=/Library/Frameworks/QtCore.framework/QtCore
{darwin}libs=/Library/Frameworks/QtGui.framework/QtGui

View File

@@ -66,6 +66,8 @@
#if QT_VERSION >= 0x040500
#include <QtCore/QObject>
static int s_iObjectReleaseMethod = HBQT_RELEASE_WITH_DELETE_LATER;
/*----------------------------------------------------------------------*/
@@ -131,6 +133,11 @@ HB_FUNC( HBQT_QTPTR_FROM_GCPOINTER )
}
}
HB_FUNC( QT_FINDCHILD )
{
hb_retptr( ( QObject * ) hbqt_par_QObject( 1 )->findChild< QObject * >( hbqt_par_QString( 2 ) ) );
}
#if defined( __HB_DEBUG__ )
#if defined( HB_OS_WIN )

View File

@@ -254,6 +254,7 @@ extern QT_G_FUNC( release_QTranslator );
extern QT_G_FUNC( release_QTreeView );
extern QT_G_FUNC( release_QTreeWidget );
extern QT_G_FUNC( release_QTreeWidgetItem );
extern QT_G_FUNC( release_QUiLoader );
extern QT_G_FUNC( release_QUrl );
extern QT_G_FUNC( release_QValidator );
extern QT_G_FUNC( release_QVariant );
@@ -522,6 +523,7 @@ extern void * gcAllocate_QTranslator( void * pObj );
extern void * gcAllocate_QTreeView( void * pObj );
extern void * gcAllocate_QTreeWidget( void * pObj );
extern void * gcAllocate_QTreeWidgetItem( void * pObj );
extern void * gcAllocate_QUiLoader( void * pObj );
extern void * gcAllocate_QUrl( void * pObj );
extern void * gcAllocate_QValidator( void * pObj );
extern void * gcAllocate_QVariant( void * pObj );

View File

@@ -0,0 +1,266 @@
/*
* $Id$
*/
/* -------------------------------------------------------------------- */
/* WARNING: Automatically generated source file. DO NOT EDIT! */
/* Instead, edit corresponding .qth file, */
/* or the generator tool itself, and run regenarate. */
/* -------------------------------------------------------------------- */
/*
* Harbour Project source code:
* QT wrapper main header
*
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
*
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot 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 <QtCore/QPointer>
#include <QtUiTools/QUiLoader>
#include <QtCore/QDir>
#include <QtCore/QStringList>
/*
* QUiLoader ( QObject * parent = 0 )
* virtual ~QUiLoader ()
*/
typedef struct
{
void * ph;
QT_G_FUNC_PTR func;
QPointer< QUiLoader > pq;
} QGC_POINTER_QUiLoader;
QT_G_FUNC( release_QUiLoader )
{
QGC_POINTER_QUiLoader * p = ( QGC_POINTER_QUiLoader * ) Cargo;
HB_TRACE( HB_TR_DEBUG, ( "release_QUiLoader p=%p", p));
HB_TRACE( HB_TR_DEBUG, ( "release_QUiLoader ph=%p pq=%p", p->ph, (void *)(p->pq)));
if( p && p->ph && p->pq )
{
const QMetaObject * m = ( ( QObject * ) p->ph )->metaObject();
if( ( QString ) m->className() != ( QString ) "QObject" )
{
( ( QUiLoader * ) p->ph )->~QUiLoader();
p->ph = NULL;
HB_TRACE( HB_TR_DEBUG, ( "release_QUiLoader Object deleted!" ) );
#if defined(__debug__)
just_debug( " YES release_QUiLoader %i B %i KB", ( int ) hb_xquery( 1001 ), hb_getMemUsed() );
#endif
}
else
{
HB_TRACE( HB_TR_DEBUG, ( "release_QUiLoader Object Name Missing!" ) );
#if defined(__debug__)
just_debug( " NO release_QUiLoader" );
#endif
}
}
else
{
HB_TRACE( HB_TR_DEBUG, ( "release_QUiLoader Object Allready deleted!" ) );
#if defined(__debug__)
just_debug( " DEL release_QUiLoader" );
#endif
}
}
void * gcAllocate_QUiLoader( void * pObj )
{
QGC_POINTER_QUiLoader * p = ( QGC_POINTER_QUiLoader * ) hb_gcAllocate( sizeof( QGC_POINTER_QUiLoader ), gcFuncs() );
p->ph = pObj;
p->func = release_QUiLoader;
new( & p->pq ) QPointer< QUiLoader >( ( QUiLoader * ) pObj );
#if defined(__debug__)
just_debug( " new_QUiLoader %i B %i KB", ( int ) hb_xquery( 1001 ), hb_getMemUsed() );
#endif
return( p );
}
HB_FUNC( QT_QUILOADER )
{
void * pObj = NULL;
if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) )
{
pObj = new QUiLoader( hbqt_par_QObject( 1 ) ) ;
}
else
{
pObj = new QUiLoader() ;
}
hb_retptrGC( gcAllocate_QUiLoader( pObj ) );
}
/*
* void addPluginPath ( const QString & path )
*/
HB_FUNC( QT_QUILOADER_ADDPLUGINPATH )
{
hbqt_par_QUiLoader( 1 )->addPluginPath( hbqt_par_QString( 2 ) );
}
/*
* QStringList availableLayouts () const
*/
HB_FUNC( QT_QUILOADER_AVAILABLELAYOUTS )
{
hb_retptrGC( gcAllocate_QStringList( new QStringList( hbqt_par_QUiLoader( 1 )->availableLayouts() ) ) );
}
/*
* QStringList availableWidgets () const
*/
HB_FUNC( QT_QUILOADER_AVAILABLEWIDGETS )
{
hb_retptrGC( gcAllocate_QStringList( new QStringList( hbqt_par_QUiLoader( 1 )->availableWidgets() ) ) );
}
/*
* void clearPluginPaths ()
*/
HB_FUNC( QT_QUILOADER_CLEARPLUGINPATHS )
{
hbqt_par_QUiLoader( 1 )->clearPluginPaths();
}
/*
* virtual QAction * createAction ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC( QT_QUILOADER_CREATEACTION )
{
hb_retptr( ( QAction* ) hbqt_par_QUiLoader( 1 )->createAction( hbqt_par_QObject( 2 ), hbqt_par_QString( 3 ) ) );
}
/*
* virtual QActionGroup * createActionGroup ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC( QT_QUILOADER_CREATEACTIONGROUP )
{
hb_retptr( ( QActionGroup* ) hbqt_par_QUiLoader( 1 )->createActionGroup( hbqt_par_QObject( 2 ), hbqt_par_QString( 3 ) ) );
}
/*
* virtual QLayout * createLayout ( const QString & className, QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC( QT_QUILOADER_CREATELAYOUT )
{
hb_retptr( ( QLayout* ) hbqt_par_QUiLoader( 1 )->createLayout( hbqt_par_QString( 2 ), hbqt_par_QObject( 3 ), hbqt_par_QString( 4 ) ) );
}
/*
* virtual QWidget * createWidget ( const QString & className, QWidget * parent = 0, const QString & name = QString() )
*/
HB_FUNC( QT_QUILOADER_CREATEWIDGET )
{
hb_retptr( ( QWidget* ) hbqt_par_QUiLoader( 1 )->createWidget( hbqt_par_QString( 2 ), hbqt_par_QWidget( 3 ), hbqt_par_QString( 4 ) ) );
}
/*
* bool isLanguageChangeEnabled () const
*/
HB_FUNC( QT_QUILOADER_ISLANGUAGECHANGEENABLED )
{
hb_retl( hbqt_par_QUiLoader( 1 )->isLanguageChangeEnabled() );
}
/*
* QWidget * load ( QIODevice * device, QWidget * parentWidget = 0 )
*/
HB_FUNC( QT_QUILOADER_LOAD )
{
hb_retptr( ( QWidget* ) hbqt_par_QUiLoader( 1 )->load( hbqt_par_QIODevice( 2 ), hbqt_par_QWidget( 3 ) ) );
}
/*
* QStringList pluginPaths () const
*/
HB_FUNC( QT_QUILOADER_PLUGINPATHS )
{
hb_retptrGC( gcAllocate_QStringList( new QStringList( hbqt_par_QUiLoader( 1 )->pluginPaths() ) ) );
}
/*
* void setLanguageChangeEnabled ( bool enabled )
*/
HB_FUNC( QT_QUILOADER_SETLANGUAGECHANGEENABLED )
{
hbqt_par_QUiLoader( 1 )->setLanguageChangeEnabled( hb_parl( 2 ) );
}
/*
* void setWorkingDirectory ( const QDir & dir )
*/
HB_FUNC( QT_QUILOADER_SETWORKINGDIRECTORY )
{
hbqt_par_QUiLoader( 1 )->setWorkingDirectory( *hbqt_par_QDir( 2 ) );
}
/*
* QDir workingDirectory () const
*/
HB_FUNC( QT_QUILOADER_WORKINGDIRECTORY )
{
hb_retptrGC( gcAllocate_QDir( new QDir( hbqt_par_QUiLoader( 1 )->workingDirectory() ) ) );
}
/*----------------------------------------------------------------------*/
#endif /* #if QT_VERSION >= 0x040500 */
/*----------------------------------------------------------------------*/

View File

@@ -0,0 +1,160 @@
/*
* $Id$
*/
/* -------------------------------------------------------------------- */
/* WARNING: Automatically generated source file. DO NOT EDIT! */
/* Instead, edit corresponding .qth file, */
/* or the generator tool itself, and run regenarate. */
/* -------------------------------------------------------------------- */
/*
* Harbour Project source code:
* QT wrapper main header
*
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
*
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot 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 "hbclass.ch"
CREATE CLASS QUiLoader INHERIT QObject
VAR pPtr
METHOD new()
METHOD configure( xObject )
METHOD addPluginPath( cPath )
METHOD availableLayouts()
METHOD availableWidgets()
METHOD clearPluginPaths()
METHOD createAction( pParent, cName )
METHOD createActionGroup( pParent, cName )
METHOD createLayout( cClassName, pParent, cName )
METHOD createWidget( cClassName, pParent, cName )
METHOD isLanguageChangeEnabled()
METHOD load( pDevice, pParentWidget )
METHOD pluginPaths()
METHOD setLanguageChangeEnabled( lEnabled )
METHOD setWorkingDirectory( pDir )
METHOD workingDirectory()
ENDCLASS
/*----------------------------------------------------------------------*/
METHOD QUiLoader:new( pParent )
::pPtr := Qt_QUiLoader( pParent )
RETURN Self
METHOD QUiLoader:configure( xObject )
IF hb_isObject( xObject )
::pPtr := xObject:pPtr
ELSEIF hb_isPointer( xObject )
::pPtr := xObject
ENDIF
RETURN Self
METHOD QUiLoader:addPluginPath( cPath )
RETURN Qt_QUiLoader_addPluginPath( ::pPtr, cPath )
METHOD QUiLoader:availableLayouts()
RETURN Qt_QUiLoader_availableLayouts( ::pPtr )
METHOD QUiLoader:availableWidgets()
RETURN Qt_QUiLoader_availableWidgets( ::pPtr )
METHOD QUiLoader:clearPluginPaths()
RETURN Qt_QUiLoader_clearPluginPaths( ::pPtr )
METHOD QUiLoader:createAction( pParent, cName )
RETURN Qt_QUiLoader_createAction( ::pPtr, pParent, cName )
METHOD QUiLoader:createActionGroup( pParent, cName )
RETURN Qt_QUiLoader_createActionGroup( ::pPtr, pParent, cName )
METHOD QUiLoader:createLayout( cClassName, pParent, cName )
RETURN Qt_QUiLoader_createLayout( ::pPtr, cClassName, pParent, cName )
METHOD QUiLoader:createWidget( cClassName, pParent, cName )
RETURN Qt_QUiLoader_createWidget( ::pPtr, cClassName, pParent, cName )
METHOD QUiLoader:isLanguageChangeEnabled()
RETURN Qt_QUiLoader_isLanguageChangeEnabled( ::pPtr )
METHOD QUiLoader:load( pDevice, pParentWidget )
RETURN Qt_QUiLoader_load( ::pPtr, pDevice, pParentWidget )
METHOD QUiLoader:pluginPaths()
RETURN Qt_QUiLoader_pluginPaths( ::pPtr )
METHOD QUiLoader:setLanguageChangeEnabled( lEnabled )
RETURN Qt_QUiLoader_setLanguageChangeEnabled( ::pPtr, lEnabled )
METHOD QUiLoader:setWorkingDirectory( pDir )
RETURN Qt_QUiLoader_setWorkingDirectory( ::pPtr, pDir )
METHOD QUiLoader:workingDirectory()
RETURN Qt_QUiLoader_workingDirectory( ::pPtr )

View File

@@ -54,6 +54,7 @@ CPP_SOURCES := \
QTimer.cpp \
QTranslator.cpp \
QUrl.cpp \
QUiLoader.cpp \
QVariant.cpp \
@@ -103,6 +104,7 @@ PRG_SOURCES := \
TQTime.prg \
TQTimer.prg \
TQTranslator.prg \
TQUiLoader.prg \
TQUrl.prg \
TQVariant.prg \

View File

@@ -0,0 +1,113 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* QT Source Generator for Harbour
*
* 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.
*
*/
/*----------------------------------------------------------------------*/
;
; Header File to Generate QT Wrapper Sources
;
<CLASS>
Inherits = QObject
Type = Core
New =
</CLASS>
<CODE>
#include <QtUiTools/QUiLoader>
#include <QtCore/QDir>
#include <QtCore/QStringList>
/*
* QUiLoader ( QObject * parent = 0 )
* virtual ~QUiLoader ()
*/
HB_FUNC( QT_QUILOADER )
{
if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) )
{
hb_retptr( new QUiLoader( hbqt_par_QObject( 1 ) ) );
}
else
{
hb_retptr( new QUiLoader() );
}
}
</CODE>
<ENUMS>
</ENUMS>
<PROTOS>
void addPluginPath ( const QString & path )
QStringList availableLayouts () const
QStringList availableWidgets () const
void clearPluginPaths ()
virtual QAction * createAction ( QObject * parent = 0, const QString & name = QString() )
virtual QActionGroup * createActionGroup ( QObject * parent = 0, const QString & name = QString() )
virtual QLayout * createLayout ( const QString & className, QObject * parent = 0, const QString & name = QString() )
virtual QWidget * createWidget ( const QString & className, QWidget * parent = 0, const QString & name = QString() )
bool isLanguageChangeEnabled () const
QWidget * load ( QIODevice * device, QWidget * parentWidget = 0 )
QStringList pluginPaths () const
void setLanguageChangeEnabled ( bool enabled )
void setWorkingDirectory ( const QDir & dir )
QDir workingDirectory () const
</PROTOS>
<SLOTS>
</SLOTS>
<SIGNALS>
</SIGNALS>

View File

@@ -81,6 +81,7 @@ CLASS XbpComboBox INHERIT XbpWindow
METHOD new()
METHOD create()
METHOD createFromQtPtr()
METHOD configure() VIRTUAL
METHOD destroy()
METHOD exeBlock()
@@ -162,6 +163,38 @@ METHOD XbpComboBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
/*----------------------------------------------------------------------*/
METHOD XbpComboBox:createFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVisible, pQtObject )
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
IF hb_isPointer( pQtObject )
::oWidget := QComboBox()
::oWidget:pPtr := pQtObject
ELSE
::oSLE := XbpSLE():new():create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::oLB := XbpListBox():new():create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::oWidget := QComboBox():New( ::pParent )
::setPosAndSize()
IF ::visible
::show()
ENDIF
::oWidget:setLineEdit( ::XbpSLE:oWidget:pPtr )
::oWidget:setEditable( ::XbpSLE:editable )
::oWidget:setFrame( ::XbpSLE:border )
ENDIF
::connect( ::pWidget, "highlighted(int)" , {|o,i| ::exeBlock( 1,i,o ) } )
::connect( ::pWidget, "activated(int)" , {|o,i| ::exeBlock( 2,i,o ) } )
//::connect( ::pWidget, "currentIndexChanged(int)", {|o,i| ::exeBlock( 2,i,o ) } )
::AddAsChild( SELF )
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpComboBox:destroy()
::xbpWindow:destroy()

View File

@@ -86,6 +86,7 @@ CLASS XbpPartHandler
METHOD status()
METHOD addChild( oXbp )
METHOD addAsChild()
METHOD childFromName( nNameId )
METHOD childList()
METHOD delChild( oXbp )
@@ -175,6 +176,16 @@ METHOD addChild( oXbp ) CLASS XbpPartHandler
/*----------------------------------------------------------------------*/
METHOD addAsChild() CLASS XbpPartHandler
IF !empty( ::oParent )
::oParent:addChild( Self )
ENDIF
RETURN Self
/*----------------------------------------------------------------------*/
METHOD childFromName( nNameId ) CLASS XbpPartHandler
LOCAL i, oXbp

View File

@@ -88,6 +88,7 @@ CLASS XbpPushButton INHERIT XbpWindow
METHOD new()
METHOD create()
METHOD createFromQtPtr()
METHOD configure()
METHOD destroy()
@@ -117,8 +118,6 @@ METHOD XbpPushButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible
::oWidget := QPushButton():new( QT_PTROF( ::oParent:oWidget ) )
::Connect( QT_PTROF( ::oWidget ), "clicked()", {|| ::exeBlock() } )
::setPosAndSize()
IF ::visible
::oWidget:show()
@@ -130,11 +129,43 @@ METHOD XbpPushButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible
::oWidget:setDefault( .t. )
ENDIF
::Connect( QT_PTROF( ::oWidget ), "clicked()", {|| ::exeBlock() } )
::oParent:AddChild( SELF )
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpPushButton:createFromQtPtr( oParent, oOwner, aPos, aSize, aPresParams, lVisible, pQtObject )
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
IF hb_isPointer( pQtObject )
::oWidget := QPushButton()
::oWidget:pPtr := pQtObject
ELSE
::oWidget := QPushButton():new( QT_PTROF( ::oParent:oWidget ) )
::setPosAndSize()
IF ::visible
::oWidget:show()
ENDIF
::setCaption( ::caption )
IF ::default
::oWidget:setDefault( .t. )
ENDIF
ENDIF
::Connect( QT_PTROF( ::oWidget ), "clicked()", {|| ::exeBlock() } )
::addAsChild()
RETURN Self
/*----------------------------------------------------------------------*/
METHOD XbpPushButton:exeBlock()
IF hb_isBlock( ::sl_lbClick )

View File

@@ -143,6 +143,7 @@ EXPORTED:
/* LIFE CYCLE */
METHOD init()
METHOD create()
METHOD createFromQtPtr() VIRTUAL
METHOD configure()
METHOD destroy()
@@ -324,6 +325,9 @@ METHOD XbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::aSize := aSize
::visible := lVisible
/* Important : 25 Nov 2009 */
// DEFAULT ::oParent TO SetAppWindow()
::XbpPartHandler:create( oParent, oOwner )
IF !empty( aPresParams )
@@ -731,8 +735,8 @@ METHOD XbpWindow:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible
METHOD XbpWindow:destroy()
LOCAL cXbp := __ObjGetClsName( self )
HBXBP_DEBUG( ". " )
HBXBP_DEBUG( ThreadID(),"Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ), memory( 1001 ), hbqt_getMemUsed() )
//HBXBP_DEBUG( ". " )
//HBXBP_DEBUG( ThreadID(),"Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ), memory( 1001 ), hbqt_getMemUsed() )
IF cXbp == "XBPDIALOG"
SetEventLoop( NIL )
@@ -769,7 +773,7 @@ HBXBP_DEBUG( ThreadID(),"Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::
::oWidget:pPtr := 0
::oWidget := NIL
HBXBP_DEBUG( ThreadID()," Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ), memory( 1001 ), hbqt_getMemUsed() )
//HBXBP_DEBUG( ThreadID()," Destroy: "+pad(__ObjGetClsName( self ),12)+ IF(empty(::cargo),'',str(::cargo) ), memory( 1001 ), hbqt_getMemUsed() )
RETURN NIL