codegen/QtUiTools: updated

codegen/QtUiTools: updated

Modified:
codegen/QtUiTools/QUiLoader.prg

%%
%% Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4
%%
%% Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%

$header

#include "hbclass.ch"

$addRequests

$beginClassFrom=QObject

$addMethods

$endClass

$destructor

#pragma BEGINDUMP

$includes

#include <QStringList>
#include <QDir>
#include <QAction>
#include <QLayout>

$prototype=QUiLoader ( QObject * parent = 0 )
$constructor=|new|QObject *=0

$deleteMethod

$prototype=void addPluginPath ( const QString & path )
$method=|void|addPluginPath|const QString &

$prototype=QStringList availableLayouts () const
$method=|QStringList|availableLayouts|

$prototype=QStringList availableWidgets () const
$method=|QStringList|availableWidgets|

$prototype=void clearPluginPaths ()
$method=|void|clearPluginPaths|

$prototype=virtual QAction * createAction ( QObject * parent = 0, const QString & name = QString() )
$virtualMethod=|QAction *|createAction|QObject *=0,const QString &=QString()

$prototype=virtual QActionGroup * createActionGroup ( QObject * parent = 0, const QString & name = QString() )
$virtualMethod=|QActionGroup *|createActionGroup|QObject *=0,const QString &=QString()

$prototype=virtual QLayout * createLayout ( const QString & className, QObject * parent = 0, const QString & name = QString() )
$virtualMethod=|QLayout *|createLayout|const QString &,QObject *=0,const QString &=QString()

$prototype=virtual QWidget * createWidget ( const QString & className, QWidget * parent = 0, const QString & name = QString() )
$virtualMethod=|QWidget *|createWidget|const QString &,QWidget *=0,const QString &=QString()

$prototype=bool isLanguageChangeEnabled () const
$method=|bool|isLanguageChangeEnabled|

$prototype=QWidget * load ( QIODevice * device, QWidget * parentWidget = 0 )
$method=|QWidget *|load|QIODevice *,QWidget *=0

$prototype=QStringList pluginPaths () const
$method=|QStringList|pluginPaths|

$prototype=void setLanguageChangeEnabled ( bool enabled )
$method=|void|setLanguageChangeEnabled|bool

$prototype=void setWorkingDirectory ( const QDir & dir )
$method=|void|setWorkingDirectory|const QDir &

$prototype=QDir workingDirectory () const
$method=|QDir|workingDirectory|

#pragma ENDDUMP

%%
%% Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4
%%
%% Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%

$header

#include "hbclass.ch"

$addRequests

$beginClassFrom=QObject

   METHOD new
   METHOD delete
   METHOD addPluginPath
   METHOD availableLayouts
   METHOD availableWidgets
   METHOD clearPluginPaths
   METHOD createAction
   METHOD createActionGroup
   METHOD createLayout
   METHOD createWidget
   METHOD isLanguageChangeEnabled
   METHOD load
   METHOD pluginPaths
   METHOD setLanguageChangeEnabled
   METHOD setWorkingDirectory
   METHOD workingDirectory

$endClass

$destructor

#pragma BEGINDUMP

$includes

#include <QStringList>
#include <QDir>
#include <QAction>
#include <QLayout>

$prototype=QUiLoader ( QObject * parent = 0 )
$constructor=|new|QObject *=0

$deleteMethod

$prototype=void addPluginPath ( const QString & path )
$method=|void|addPluginPath|const QString &

$prototype=QStringList availableLayouts () const
$method=|QStringList|availableLayouts|

$prototype=QStringList availableWidgets () const
$method=|QStringList|availableWidgets|

$prototype=void clearPluginPaths ()
$method=|void|clearPluginPaths|

$prototype=virtual QAction * createAction ( QObject * parent = 0, const QString & name = QString() )
$virtualMethod=|QAction *|createAction|QObject *=0,const QString &=QString()

$prototype=virtual QActionGroup * createActionGroup ( QObject * parent = 0, const QString & name = QString() )
$virtualMethod=|QActionGroup *|createActionGroup|QObject *=0,const QString &=QString()

$prototype=virtual QLayout * createLayout ( const QString & className, QObject * parent = 0, const QString & name = QString() )
$virtualMethod=|QLayout *|createLayout|const QString &,QObject *=0,const QString &=QString()

$prototype=virtual QWidget * createWidget ( const QString & className, QWidget * parent = 0, const QString & name = QString() )
$virtualMethod=|QWidget *|createWidget|const QString &,QWidget *=0,const QString &=QString()

$prototype=bool isLanguageChangeEnabled () const
$method=|bool|isLanguageChangeEnabled|

$prototype=QWidget * load ( QIODevice * device, QWidget * parentWidget = 0 )
$method=|QWidget *|load|QIODevice *,QWidget *=0

$prototype=QStringList pluginPaths () const
$method=|QStringList|pluginPaths|

$prototype=void setLanguageChangeEnabled ( bool enabled )
$method=|void|setLanguageChangeEnabled|bool

$prototype=void setWorkingDirectory ( const QDir & dir )
$method=|void|setWorkingDirectory|const QDir &

$prototype=QDir workingDirectory () const
$method=|QDir|workingDirectory|

#pragma ENDDUMP


[Tests] Changed VFP test to run in the current build

USING System
USING System.Collections.Generic
USING System.Linq
USING System.Text
USING XUnit
BEGIN NAMESPACE XSharp.VFP.Tests

	CLASS FoxArrayTests
        [Fact, Trait("Category", "FoxArray")];
		ASYNC METHOD SimpleArrayTests() AS VOID
            XSharp.RuntimeState.Dialect := XSharpDialect.FoxPro
            LOCAL ARRAY a
            Dimension a(10)
            // You cannot assign an array to an element of a FOX array
            AWAIT Assert.ThrowsAsync<Error>( { => a[1] := {1,2,3} })

            Assert.True( IsNil(a[1]) )
            Assert.True( IsNil(a[2]))
            FillArray(a)
            Assert.True( a[1] == 1 )
            Assert.True( a[2] == 2)
            a:Redim(5,2)
            Assert.True( a[1,1] == 1 )
            Assert.True( a[1,2] == 2)
            Assert.True( a[2,1] == 3)
            Assert.True( a[5,2] == 10)
            // Alen with nArrayAttribute
            Assert.True( ALen(a,1) == 5)
            Assert.True( ALen(a,2) == 2)
            Assert.True( ALen(a) == 10)
            // AElement = returns element number
            Assert.True( AElement(a, 1,1) == 1)
            Assert.True( AElement(a, 1,2) == 2)
            Assert.True( AElement(a, 2,1) == 3)
            Assert.True( AElement(a, 2,2) == 4)
            Assert.True( AElement(a, 3,1) == 5)
            Assert.True( AElement(a, 3,2) == 6)
            Assert.True( AElement(a, 4,1) == 7)
            Assert.True( AElement(a, 4,2) == 8)
            Assert.True( AElement(a, 5,1) == 9)
            Assert.True( AElement(a, 5,2) == 10)
            // Now delete column 1
            FillArray(a)
            ADel(a, 1, 2)
            Assert.True( a[ 1,1] == 2)
            Assert.True( a[ 1,2] == NIL)
            Assert.True( a[ 2,1] == 4)
            Assert.True( a[ 2,2] == NIL)
            Assert.True( a[ 3,1] == 6)
            Assert.True( a[ 3,2] == NIL)
            Assert.True( a[ 4,1] == 8)
            Assert.True( a[ 4,2] == NIL)
            Assert.True( a[ 5,1] == 10)
            Assert.True( a[ 5,2] == NIL)
            // Now insert column 1
            FillArray(a)
            AIns(a, 1, 2)
            Assert.True( a[ 1,1] == NIL)
            Assert.True( a[ 1,2] == 1)
            Assert.True( a[ 2,1] == NIL)
            Assert.True( a[ 2,2] == 3)
            Assert.True( a[ 3,1] == NIL)
            Assert.True( a[ 3,2] == 5)
            Assert.True( a[ 4,1] == NIL)
            Assert.True( a[ 4,2] == 7)
            Assert.True( a[ 5,1] == NIL)
            Assert.True( a[ 5,2] == 9)
            FillArray(a)
            AIns(a, 2, 2)
            Assert.True( a[ 1,1] == 1)
            Assert.True( a[ 1,2] == NIL)
            Assert.True( a[ 2,1] == 3)
            Assert.True( a[ 2,2] == NIL)
            Assert.True( a[ 3,1] == 5)
            Assert.True( a[ 3,2] == NIL)
            Assert.True( a[ 4,1] == 7)
            Assert.True( a[ 4,2] == NIL)
            Assert.True( a[ 5,1] == 9)
            Assert.True( a[ 5,2] == NIL)
            FillArray(a)
            // delete row 1
            ADel(a, 1, 1)
            Assert.True( a[ 1,1] == 3)
            Assert.True( a[ 1,2] == 4)
            Assert.True( a[ 2,1] == 5)
            Assert.True( a[ 2,2] == 6)
            Assert.True( a[ 3,1] == 7)
            Assert.True( a[ 3,2] == 8)
            Assert.True( a[ 4,1] == 9)
            Assert.True( a[ 4,2] == 10)
            Assert.True( a[ 5,1] == NIL)
            Assert.True( a[ 5,2] == NIL)

            FillArray(a)
            // delete row 5
            ADel(a, 5, 1)
            Assert.True( a[ 1,1] == 1)
            Assert.True( a[ 1,2] == 2)
            Assert.True( a[ 2,1] == 3)
            Assert.True( a[ 2,2] == 4)
            Assert.True( a[ 3,1] == 5)
            Assert.True( a[ 3,2] == 6)
            Assert.True( a[ 4,1] == 7)
            Assert.True( a[ 4,2] == 8)
            Assert.True( a[ 5,1] == NIL)
            Assert.True( a[ 5,2] == NIL)

            FillArray(a)
            // delete row 5
            AIns(a, 1, 1)
            Assert.True( a[ 1,1] == NIL)
            Assert.True( a[ 1,2] == NIL)
            Assert.True( a[ 2,1] == 1)
            Assert.True( a[ 2,2] == 2)
            Assert.True( a[ 3,1] == 3)
            Assert.True( a[ 3,2] == 4)
            Assert.True( a[ 4,1] == 5)
            Assert.True( a[ 4,2] == 6)
            Assert.True( a[ 5,1] == 7)
            Assert.True( a[ 5,2] == 8)

            FillArray(a)
            // delete row 5
            AIns(a, 5, 1)
            Assert.True( a[ 1,1] == 1)
            Assert.True( a[ 1,2] == 2)
            Assert.True( a[ 2,1] == 3)
            Assert.True( a[ 2,2] == 4)
            Assert.True( a[ 3,1] == 5)
            Assert.True( a[ 3,2] == 6)
            Assert.True( a[ 4,1] == 7)
            Assert.True( a[ 4,2] == 8)
            Assert.True( a[ 5,1] == NIL)
            Assert.True( a[ 5,2] == NIL)

       [Fact, Trait("Category", "FoxArray")];
		METHOD UsualArrayTests() AS VOID
            XSharp.RuntimeState.Dialect := XSharpDialect.FoxPro
            LOCAL a
            Dimension a(10)
            FillArray(a)
            LOCAL u := a AS USUAL
            Assert.True(IsArray(u))
            Assert.True(u[1] == 1)
            Assert.True(u[10] == 10)
            Dimension u(5,2)
            Assert.True(u[1,1] == 1)
            Assert.True(u[1,2] == 2)
            Assert.True(u[5,2] == 10)
            //Assert.True(u[6,2] == 10)

        STATIC METHOD FillArray(a AS __FoxArray) AS VOID
            FOR VAR i := 1 TO ALen(a)
                a[i] := i
            NEXT
        [Fact, Trait("Category", "FoxArray")];
        METHOD AinsTests() AS VOID
            XSharp.RuntimeState.Dialect := XSharpDialect.FoxPro
            DIMENSION aOneDim ( 4 )

            aOneDim [1] := 1
            aOneDim [2] := 2
            aOneDim [3] := 3
            aOneDim [4] := 4

            ?

            AIns ( aOneDim , 1 )
            ShowArray ( aOneDim )
            ?

            AIns ( aOneDim , 1 , 1 )
            ShowArray ( aOneDim )
            ?

            AIns ( aOneDim , 1 , 0 )
            ShowArray ( aOneDim )
            ?

            AIns ( aOneDim , 1 )
            ShowArray ( aOneDim )
            ?
            FOR VAR i := 1 TO ALen ( aOneDim )

	            Assert.True(IsNil ( aOneDim[i] ))
	            Assert.True(IsLogic ( aOneDim[i] ))
            NEXT

            ? "-------- two-dim array ----"
            ?

            DIMENSION aTwoDim ( 2, 4  )
            FOR VAR i := 1 TO ALen (aTwoDim)
               aTwoDim[i] := i
            ENDFOR
            ShowArray ( aTwoDim )
            ?

            // ----  There are 3 options to get this array content

            /*

            a[1] [1,1] = 1 (N)
            a[2] [1,2] = 2 (N)
            a[3] [1,3] = 3 (N)
            a[4] [1,4] = 4 (N)
            a[5] [2,1] = .F. (Nil)
            a[6] [2,2] = .F. (Nil)
            a[7] [2,3] = .F. (Nil)
            a[8] [2,4] = .F. (Nil)

            */

            AIns ( aTwoDim , 2 , 1  )
            ShowArray ( aTwoDim )
            ?

            AIns ( aTwoDim , 2 , 0  )
            ShowArray ( aTwoDim )
            ?

            AIns ( aTwoDim , 2 )
            ShowArray ( aTwoDim )

            // ? AIns ( aTwoDim , 0 , 2 ) //  Exception: 'nElementNumber' number is out of range
            // ? AIns ( aTwoDim , 0  ) //  Exception: 'nElementNumber' number is out of range
            // ? AIns ( aTwoDim , 3  ) //  Exception: 'nElementNumber' number is out of range
            // ? AIns ( aTwoDim , 2 , 4 ) // Exception 'nInsertType' number is out of range

            // ------------------------

            FOR VAR i := 1 TO ALen (aTwoDim)
               aTwoDim[i] := i
            ENDFOR

            AIns ( aTwoDim , 1 , 2  )
            Assert.True(IsNil(aTwoDim [1,1]))
            Assert.True(IsNil(aTwoDim [2,1]))
            Assert.True(IsLogic(aTwoDim [1,1]))
            Assert.True(IsLogic(aTwoDim [2,1]))
            /*
            a[1] [1,1] = .F. (NIL)
            a[2] [1,2] = 1 (N)
            a[3] [1,3] = 2 (N)
            a[4] [1,4] = 3 (N)
            a[5] [2,1] = .F. (NIL)
            a[6] [2,2] = 5 (N)
            a[7] [2,3] = 6 (N)
            a[8] [2,4] = 7 (N)
            */
            ShowArray ( aTwoDim )
            ?
            AIns ( aTwoDim , 2 , 2  )
            Assert.True(IsNil(aTwoDim [1,2]))
            Assert.True(IsNil(aTwoDim [2,2]))
            Assert.True(IsLogic(aTwoDim [1,2]))
            Assert.True(IsLogic(aTwoDim [2,2]))

        [Fact, Trait("Category", "FoxArray")];
        METHOD ASubScriptTests() AS VOID
            XSharp.RuntimeState.Dialect := XSharpDialect.FoxPro
            LOCAL x, y AS DWORD
            LOCAL aTest
            DIMENSION aTest(4)

             aTest[1] :=  'E'
             aTest[2] :=  'F'
             aTest[3] :=  'G'
             aTest[4] :=  'H'
            ShowArray(aTest)

            ? aTest [ ASubscript ( aTest , 4 , 1) ] // "H"
            ? aTest [ ASubscript ( aTest , 2 , 1) ] // "F"

            Assert.True( "H" == (STRING) aTest [ASubscript ( aTest , 4 , 1)])
            Assert.True( "F" == (STRING) aTest [ASubscript ( aTest , 2 , 1)])
            // ? aTest [ ASubscript ( aTest , 4 ) ] // Fox and X# compile error - third param is missing

            // ? ASubscript ( aTest , 8 , 1) // throws the exception 'nElementNumber' number is out of range
            // ? ASubscript ( aTest , 4 , 2) // throws the exception "a one-dimensional array has no columns"

            DIMENSION aTest(2,3)

            /*

            now the content OF the ARRAY looks like

            aTest[1] [1,1] = E (C)
            aTest[2] [1,2] = F (C)
            aTest[3] [1,3] = G (C)
            aTest[4] [2,1] = H (C)
            aTest[5] [2,2] = .F. (NIL)
            aTest[6] [2,3] = .F. (NIL)

            */

            x := ASubscript (aTest , 4 , 1 ) // Element 4 , 1 = get the corresponding row subscript
            y := ASubscript (aTest , 4 , 2 ) // Element 4 , 2 = get the corresponding col subscript
            ? "aTest ["+x:Tostring()+"," + y:Tostring()+ "] must show 'H':" , aTest [x,y]

            Assert.True( "H" == (STRING) aTest [x,y])

            x := ASubscript (aTest , 3 , 1 ) // Element 3 , 1 = get the corresponding row subscript
            y := ASubscript (aTest , 3 , 2 ) // Element 3 , 2 = get the corresponding col subscript
            ? "aTest ["+x:Tostring()+"," + y:Tostring()+ "] must show 'G':" , aTest [x,y]
            Assert.True( "G" == (STRING) aTest [x,y])

            x := ASubscript (aTest , 6 , 1 ) // Element 6 , 1 = get the corresponding row subscript
            y := ASubscript (aTest , 6 , 2 ) // Element 6 , 2 = get the corresponding col subscript
            ? "aTest ["+x:Tostring()+"," + y:Tostring()+ "] must show '.F.':" , aTest [x,y]
            Assert.True( .F. == (LOGIC) aTest [x,y])

        [Fact, Trait("Category", "FoxArray")];
		ASYNC METHOD ALenTests() AS VOID
            LOCAL arr
			DIMENSION arr(1,1)
            Assert.Equal(1U, ALen(arr,0))
            Assert.Equal(1U, ALen(arr,1))
            Assert.Equal(1U, ALen(arr,2))

			DIMENSION arr(3,1)
            Assert.Equal(3U, ALen(arr,0))
            Assert.Equal(3U, ALen(arr,1))
            Assert.Equal(1U, ALen(arr,2))

			DIMENSION arr(1,3)
            Assert.Equal(3U, ALen(arr,0))
            Assert.Equal(1U, ALen(arr,1))
            Assert.Equal(3U, ALen(arr,2))
            Assert.Throws<ArgumentOutOfRangeException>( { => ALen(arr,3) == 3 })

            DIMENSION arr(4,5)
            Assert.Equal(20U, ALen(arr,0))
            Assert.Equal(4U,  ALen(arr,1))
            Assert.Equal(5U,  ALen(arr,2))

            DIMENSION arr(100)
            Assert.Equal(100U, ALen(arr,0))
            Assert.Equal(100U, ALen(arr,1))
            Assert.Equal(0U,   ALen(arr,2))
    END CLASS
END NAMESPACE

USING System
USING System.Collections.Generic
USING System.Linq
USING System.Text
USING XUnit
BEGIN NAMESPACE XSharp.VFP.Tests

	CLASS FoxArrayTests
        [Fact, Trait("Category", "FoxArray")];
		ASYNC METHOD SimpleArrayTests() AS VOID
            XSharp.RuntimeState.Dialect := XSharpDialect.FoxPro
            LOCAL a
            Dimension a(10)
            // You cannot assign an array to an element of a FOX array
            AWAIT Assert.ThrowsAsync<Error>( { => a[1] := {1,2,3} })

            Assert.True( IsNil(a[1]) )
            Assert.True( IsNil(a[2]))
            FillArray(a)
            Assert.True( a[1] == 1 )
            Assert.True( a[2] == 2)
            a:Redim(5,2)
            Assert.True( a[1,1] == 1 )
            Assert.True( a[1,2] == 2)
            Assert.True( a[2,1] == 3)
            Assert.True( a[5,2] == 10)
            // Alen with nArrayAttribute
            Assert.True( ALen(a,1) == 5)
            Assert.True( ALen(a,2) == 2)
            Assert.True( ALen(a) == 10)
            // AElement = returns element number
            Assert.True( AElement(a, 1,1) == 1)
            Assert.True( AElement(a, 1,2) == 2)
            Assert.True( AElement(a, 2,1) == 3)
            Assert.True( AElement(a, 2,2) == 4)
            Assert.True( AElement(a, 3,1) == 5)
            Assert.True( AElement(a, 3,2) == 6)
            Assert.True( AElement(a, 4,1) == 7)
            Assert.True( AElement(a, 4,2) == 8)
            Assert.True( AElement(a, 5,1) == 9)
            Assert.True( AElement(a, 5,2) == 10)
            // Now delete column 1
            FillArray(a)
            ADel(a, 1, 2)
            Assert.True( a[ 1,1] == 2)
            Assert.True( a[ 1,2] == NIL)
            Assert.True( a[ 2,1] == 4)
            Assert.True( a[ 2,2] == NIL)
            Assert.True( a[ 3,1] == 6)
            Assert.True( a[ 3,2] == NIL)
            Assert.True( a[ 4,1] == 8)
            Assert.True( a[ 4,2] == NIL)
            Assert.True( a[ 5,1] == 10)
            Assert.True( a[ 5,2] == NIL)
            // Now insert column 1
            FillArray(a)
            AIns(a, 1, 2)
            Assert.True( a[ 1,1] == NIL)
            Assert.True( a[ 1,2] == 1)
            Assert.True( a[ 2,1] == NIL)
            Assert.True( a[ 2,2] == 3)
            Assert.True( a[ 3,1] == NIL)
            Assert.True( a[ 3,2] == 5)
            Assert.True( a[ 4,1] == NIL)
            Assert.True( a[ 4,2] == 7)
            Assert.True( a[ 5,1] == NIL)
            Assert.True( a[ 5,2] == 9)
            FillArray(a)
            AIns(a, 2, 2)
            Assert.True( a[ 1,1] == 1)
            Assert.True( a[ 1,2] == NIL)
            Assert.True( a[ 2,1] == 3)
            Assert.True( a[ 2,2] == NIL)
            Assert.True( a[ 3,1] == 5)
            Assert.True( a[ 3,2] == NIL)
            Assert.True( a[ 4,1] == 7)
            Assert.True( a[ 4,2] == NIL)
            Assert.True( a[ 5,1] == 9)
            Assert.True( a[ 5,2] == NIL)
            FillArray(a)
            // delete row 1
            ADel(a, 1, 1)
            Assert.True( a[ 1,1] == 3)
            Assert.True( a[ 1,2] == 4)
            Assert.True( a[ 2,1] == 5)
            Assert.True( a[ 2,2] == 6)
            Assert.True( a[ 3,1] == 7)
            Assert.True( a[ 3,2] == 8)
            Assert.True( a[ 4,1] == 9)
            Assert.True( a[ 4,2] == 10)
            Assert.True( a[ 5,1] == NIL)
            Assert.True( a[ 5,2] == NIL)

            FillArray(a)
            // delete row 5
            ADel(a, 5, 1)
            Assert.True( a[ 1,1] == 1)
            Assert.True( a[ 1,2] == 2)
            Assert.True( a[ 2,1] == 3)
            Assert.True( a[ 2,2] == 4)
            Assert.True( a[ 3,1] == 5)
            Assert.True( a[ 3,2] == 6)
            Assert.True( a[ 4,1] == 7)
            Assert.True( a[ 4,2] == 8)
            Assert.True( a[ 5,1] == NIL)
            Assert.True( a[ 5,2] == NIL)

            FillArray(a)
            // delete row 5
            AIns(a, 1, 1)
            Assert.True( a[ 1,1] == NIL)
            Assert.True( a[ 1,2] == NIL)
            Assert.True( a[ 2,1] == 1)
            Assert.True( a[ 2,2] == 2)
            Assert.True( a[ 3,1] == 3)
            Assert.True( a[ 3,2] == 4)
            Assert.True( a[ 4,1] == 5)
            Assert.True( a[ 4,2] == 6)
            Assert.True( a[ 5,1] == 7)
            Assert.True( a[ 5,2] == 8)

            FillArray(a)
            // delete row 5
            AIns(a, 5, 1)
            Assert.True( a[ 1,1] == 1)
            Assert.True( a[ 1,2] == 2)
            Assert.True( a[ 2,1] == 3)
            Assert.True( a[ 2,2] == 4)
            Assert.True( a[ 3,1] == 5)
            Assert.True( a[ 3,2] == 6)
            Assert.True( a[ 4,1] == 7)
            Assert.True( a[ 4,2] == 8)
            Assert.True( a[ 5,1] == NIL)
            Assert.True( a[ 5,2] == NIL)

       [Fact, Trait("Category", "FoxArray")];
		METHOD UsualArrayTests() AS VOID
            XSharp.RuntimeState.Dialect := XSharpDialect.FoxPro
            LOCAL a
            Dimension a(10)
            FillArray(a)
            LOCAL u := a AS USUAL
            Assert.True(IsArray(u))
            Assert.True(u[1] == 1)
            Assert.True(u[10] == 10)
            Dimension u(5,2)
            Assert.True(u[1,1] == 1)
            Assert.True(u[1,2] == 2)
            Assert.True(u[5,2] == 10)
            //Assert.True(u[6,2] == 10)

        STATIC METHOD FillArray(a AS __FoxArray) AS VOID
            FOR VAR i := 1 TO ALen(a)
                a[i] := i
            NEXT
        [Fact, Trait("Category", "FoxArray")];
        METHOD AinsTests() AS VOID
            XSharp.RuntimeState.Dialect := XSharpDialect.FoxPro
            DIMENSION aOneDim ( 4 )

            aOneDim [1] := 1
            aOneDim [2] := 2
            aOneDim [3] := 3
            aOneDim [4] := 4

            ?

            AIns ( aOneDim , 1 )
            ShowArray ( aOneDim )
            ?

            AIns ( aOneDim , 1 , 1 )
            ShowArray ( aOneDim )
            ?

            AIns ( aOneDim , 1 , 0 )
            ShowArray ( aOneDim )
            ?

            AIns ( aOneDim , 1 )
            ShowArray ( aOneDim )
            ?
            FOR VAR i := 1 TO ALen ( aOneDim )

	            Assert.True(IsNil ( aOneDim[i] ))
	            Assert.True(IsLogic ( aOneDim[i] ))
            NEXT

            ? "-------- two-dim array ----"
            ?

            DIMENSION aTwoDim ( 2, 4  )
            FOR VAR i := 1 TO ALen (aTwoDim)
               aTwoDim[i] := i
            ENDFOR
            ShowArray ( aTwoDim )
            ?

            // ----  There are 3 options to get this array content

            /*

            a[1] [1,1] = 1 (N)
            a[2] [1,2] = 2 (N)
            a[3] [1,3] = 3 (N)
            a[4] [1,4] = 4 (N)
            a[5] [2,1] = .F. (Nil)
            a[6] [2,2] = .F. (Nil)
            a[7] [2,3] = .F. (Nil)
            a[8] [2,4] = .F. (Nil)

            */

            AIns ( aTwoDim , 2 , 1  )
            ShowArray ( aTwoDim )
            ?

            AIns ( aTwoDim , 2 , 0  )
            ShowArray ( aTwoDim )
            ?

            AIns ( aTwoDim , 2 )
            ShowArray ( aTwoDim )

            // ? AIns ( aTwoDim , 0 , 2 ) //  Exception: 'nElementNumber' number is out of range
            // ? AIns ( aTwoDim , 0  ) //  Exception: 'nElementNumber' number is out of range
            // ? AIns ( aTwoDim , 3  ) //  Exception: 'nElementNumber' number is out of range
            // ? AIns ( aTwoDim , 2 , 4 ) // Exception 'nInsertType' number is out of range

            // ------------------------

            FOR VAR i := 1 TO ALen (aTwoDim)
               aTwoDim[i] := i
            ENDFOR

            AIns ( aTwoDim , 1 , 2  )
            Assert.True(IsNil(aTwoDim [1,1]))
            Assert.True(IsNil(aTwoDim [2,1]))
            Assert.True(IsLogic(aTwoDim [1,1]))
            Assert.True(IsLogic(aTwoDim [2,1]))
            /*
            a[1] [1,1] = .F. (NIL)
            a[2] [1,2] = 1 (N)
            a[3] [1,3] = 2 (N)
            a[4] [1,4] = 3 (N)
            a[5] [2,1] = .F. (NIL)
            a[6] [2,2] = 5 (N)
            a[7] [2,3] = 6 (N)
            a[8] [2,4] = 7 (N)
            */
            ShowArray ( aTwoDim )
            ?
            AIns ( aTwoDim , 2 , 2  )
            Assert.True(IsNil(aTwoDim [1,2]))
            Assert.True(IsNil(aTwoDim [2,2]))
            Assert.True(IsLogic(aTwoDim [1,2]))
            Assert.True(IsLogic(aTwoDim [2,2]))

        [Fact, Trait("Category", "FoxArray")];
        METHOD ASubScriptTests() AS VOID
            XSharp.RuntimeState.Dialect := XSharpDialect.FoxPro
            LOCAL x, y AS DWORD
            LOCAL aTest
            DIMENSION aTest(4)

             aTest[1] :=  'E'
             aTest[2] :=  'F'
             aTest[3] :=  'G'
             aTest[4] :=  'H'
            ShowArray(aTest)

            ? aTest [ ASubscript ( aTest , 4 , 1) ] // "H"
            ? aTest [ ASubscript ( aTest , 2 , 1) ] // "F"

            Assert.True( "H" == (STRING) aTest [ASubscript ( aTest , 4 , 1)])
            Assert.True( "F" == (STRING) aTest [ASubscript ( aTest , 2 , 1)])
            // ? aTest [ ASubscript ( aTest , 4 ) ] // Fox and X# compile error - third param is missing

            // ? ASubscript ( aTest , 8 , 1) // throws the exception 'nElementNumber' number is out of range
            // ? ASubscript ( aTest , 4 , 2) // throws the exception "a one-dimensional array has no columns"

            DIMENSION aTest(2,3)

            /*

            now the content OF the ARRAY looks like

            aTest[1] [1,1] = E (C)
            aTest[2] [1,2] = F (C)
            aTest[3] [1,3] = G (C)
            aTest[4] [2,1] = H (C)
            aTest[5] [2,2] = .F. (NIL)
            aTest[6] [2,3] = .F. (NIL)

            */

            x := ASubscript (aTest , 4 , 1 ) // Element 4 , 1 = get the corresponding row subscript
            y := ASubscript (aTest , 4 , 2 ) // Element 4 , 2 = get the corresponding col subscript
            ? "aTest ["+x:Tostring()+"," + y:Tostring()+ "] must show 'H':" , aTest [x,y]

            Assert.True( "H" == (STRING) aTest [x,y])

            x := ASubscript (aTest , 3 , 1 ) // Element 3 , 1 = get the corresponding row subscript
            y := ASubscript (aTest , 3 , 2 ) // Element 3 , 2 = get the corresponding col subscript
            ? "aTest ["+x:Tostring()+"," + y:Tostring()+ "] must show 'G':" , aTest [x,y]
            Assert.True( "G" == (STRING) aTest [x,y])

            x := ASubscript (aTest , 6 , 1 ) // Element 6 , 1 = get the corresponding row subscript
            y := ASubscript (aTest , 6 , 2 ) // Element 6 , 2 = get the corresponding col subscript
            ? "aTest ["+x:Tostring()+"," + y:Tostring()+ "] must show '.F.':" , aTest [x,y]
            Assert.True( .F. == (LOGIC) aTest [x,y])

        [Fact, Trait("Category", "FoxArray")];
		ASYNC METHOD ALenTests() AS VOID
            LOCAL arr
			DIMENSION arr(1,1)
            Assert.Equal(1U, ALen(arr,0))
            Assert.Equal(1U, ALen(arr,1))
            Assert.Equal(1U, ALen(arr,2))

			DIMENSION arr(3,1)
            Assert.Equal(3U, ALen(arr,0))
            Assert.Equal(3U, ALen(arr,1))
            Assert.Equal(1U, ALen(arr,2))

			DIMENSION arr(1,3)
            Assert.Equal(3U, ALen(arr,0))
            Assert.Equal(1U, ALen(arr,1))
            Assert.Equal(3U, ALen(arr,2))
            Assert.Throws<ArgumentOutOfRangeException>( { => ALen(arr,3) == 3 })

            DIMENSION arr(4,5)
            Assert.Equal(20U, ALen(arr,0))
            Assert.Equal(4U,  ALen(arr,1))
            Assert.Equal(5U,  ALen(arr,2))

            DIMENSION arr(100)
            Assert.Equal(100U, ALen(arr,0))
            Assert.Equal(100U, ALen(arr,1))
            Assert.Equal(0U,   ALen(arr,2))
    END CLASS
END NAMESPACE


codegen/QtWinExtras: updated

codegen/QtWinExtras: updated

Modified:
codegen/QtWinExtras/QWinJumpList.prg

%%
%% Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5
%%
%% Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%

$project=Qt5xHb
$module=QtWinExtras

$header

#include "hbclass.ch"

$addRequests

$beginClassFrom=QObject

$addMethods

$endClass

$destructor

#pragma BEGINDUMP

$includes=5,2,0

$prototype=explicit QWinJumpList(QObject *parent = 0)
$constructor=5,2,0|new|QObject *=0

$deleteMethod=5,2,0

$prototype=QString identifier() const
$method=5,2,0|QString|identifier|

$prototype=void setIdentifier(const QString &identifier)
$method=5,2,0|void|setIdentifier|const QString &

$prototype=QWinJumpListCategory *recent() const
$method=5,2,0|QWinJumpListCategory *|recent|

$prototype=QWinJumpListCategory *frequent() const
$method=5,2,0|QWinJumpListCategory *|frequent|

$prototype=QWinJumpListCategory *tasks() const
$method=5,2,0|QWinJumpListCategory *|tasks|

$prototype=QList<QWinJumpListCategory *> categories() const
$method=5,2,0|QList<QWinJumpListCategory *>|categories|

$prototype=void addCategory(QWinJumpListCategory *category)
$internalMethod=5,2,0|void|addCategory,addCategory1|QWinJumpListCategory *

$prototype=QWinJumpListCategory *addCategory(const QString &title, const QList<QWinJumpListItem *> items = QList<QWinJumpListItem *>())
%% TODO: $internalMethod=5,2,0|QWinJumpListCategory *|addCategory,addCategory2|const QString &,const QList<QWinJumpListItem *>=QList<QWinJumpListItem *>()

//[1]void addCategory(QWinJumpListCategory *category)
//[2]QWinJumpListCategory *addCategory(const QString &title, const QList<QWinJumpListItem *> items = QList<QWinJumpListItem *>())

HB_FUNC_STATIC( QWINJUMPLIST_ADDCATEGORY )
{
  if( ISNUMPAR(1) && ISQWINJUMPLISTCATEGORY(1) )
  {
    QWinJumpList_addCategory1();
  }
%%  else if( ISNUMPAR(2) && ISCHAR(1) && ISOPTARRAY(2) )
%%  {
%%    QWinJumpList_addCategory2();
%%  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}
$addMethod=addCategory

$prototype=void clear()
$method=5,2,0|void|clear|

#pragma ENDDUMP

%%
%% Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5
%%
%% Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%

$project=Qt5xHb
$module=QtWinExtras

$header

#include "hbclass.ch"

$addRequests

$beginClassFrom=QObject

$addMethods

$endClass

$destructor

#pragma BEGINDUMP

$includes=5,2,0

$prototype=explicit QWinJumpList(QObject *parent = 0)
$constructor=5,2,0|new|QObject *=0

$deleteMethod=5,2,0

$prototype=QString identifier() const
$method=5,2,0|QString|identifier|

$prototype=void setIdentifier(const QString &identifier)
$method=5,2,0|void|setIdentifier|const QString &

$prototype=QWinJumpListCategory *recent() const
$method=5,2,0|QWinJumpListCategory *|recent|

$prototype=QWinJumpListCategory *frequent() const
$method=5,2,0|QWinJumpListCategory *|frequent|

$prototype=QWinJumpListCategory *tasks() const
$method=5,2,0|QWinJumpListCategory *|tasks|

$prototype=QList<QWinJumpListCategory *> categories() const
$method=5,2,0|QList<QWinJumpListCategory *>|categories|

$prototype=void addCategory(QWinJumpListCategory *category)
$internalMethod=5,2,0|void|addCategory,addCategory1|QWinJumpListCategory *

$prototype=QWinJumpListCategory *addCategory(const QString &title, const QList<QWinJumpListItem *> items = QList<QWinJumpListItem *>())
$internalMethod=5,2,0|QWinJumpListCategory *|addCategory,addCategory2|const QString &,const QList<QWinJumpListItem *>=QList<QWinJumpListItem *>()

//[1]void addCategory(QWinJumpListCategory *category)
//[2]QWinJumpListCategory *addCategory(const QString &title, const QList<QWinJumpListItem *> items = QList<QWinJumpListItem *>())

HB_FUNC_STATIC( QWINJUMPLIST_ADDCATEGORY )
{
  if( ISNUMPAR(1) && ISQWINJUMPLISTCATEGORY(1) )
  {
    QWinJumpList_addCategory1();
  }
  else if( ISNUMPAR(2) && ISCHAR(1) && ISOPTARRAY(2) )
  {
    QWinJumpList_addCategory2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}
$addMethod=addCategory

$prototype=void clear()
$method=5,2,0|void|clear|

#pragma ENDDUMP


[VOEditors] Fix for DBServer code generation

USING System.Collections
USING System.Collections.Generic
USING System.Windows.Forms
USING System.IO
USING Xide
USING XSharpModel
USING System.Reflection
USING XSharp.VODesigners
BEGIN NAMESPACE XSharp.VOEditors
CLASS XSharp_VODbServerEditor INHERIT VODbServerEditor
	PROTECT oXProject AS XProject

	CONSTRUCTOR(_oSurface AS Control , _oGrid AS DesignerGrid )
		SUPER(_oSurface , _oGrid)
		oXProject  := NULL_OBJECT
	RETURN

	METHOD Open(cFileName AS STRING) AS LOGIC
		LOCAL oFile AS XFile
		LOCAL lOk AS LOGIC
		oFile := XSharpModel.XSolution.FindFile(cFileName)
		IF (oFile != NULL_OBJECT)
			oXProject := oFile:Project
		ENDIF
		IF oXProject == NULL
			XFuncs.ErrorBox("Cannot find project for file "+cFileName)
			RETURN FALSE
		ENDIF
		SELF:ReadAllAvailableFieldSpecs(Funcs.GetModuleFilenameFromBinary(cFileName))
		SELF:aFilesToDelete:Clear()
		SELF:cLoadedDir := FileInfo{cFileName}:DirectoryName
		SELF:cDefaultFileName := cFileName
		SELF:lLoading := TRUE
		lOk := SELF:OpenXML(cFileName)
		IF (! lOk)
			TRY
				lOk := SELF:OpenVNDBS(cFileName)
			CATCH
			END TRY
		ENDIF
		SELF:lLoading := FALSE
		IF lOk
			SELF:oSurface:Controls:Add(SELF:oPanel)
			SELF:oGrid:PropertyModified := SELF:oPropertyUpdatedHandler
			SELF:oGrid:ControlKeyPressed := SELF:oControlKeyPressedHandler
			SELF:InitReadonlyProperties()
			SELF:GiveFocus()
		ENDIF
		RETURN lOk
	METHOD GetAvailableFieldSpec(cFieldSpec AS STRING) AS FSEDesignFieldSpec
		IF aAvailableFieldSpecs == NULL
			aAvailableFieldSpecs  := ArrayList{}
		ENDIF
		FOREACH oFs AS FSEDesignFieldSpec IN aAvailableFieldSpecs
			IF String.Equals(oFS:Name, cFieldSpec, StringComparison.OrdinalIgnoreCase)
				RETURN oFS
			ENDIF
		NEXT
		RETURN NULL
	METHOD ReadAllAvailableFieldSpecs(cModule AS STRING) AS VOID
		LOCAL aFiles AS IList<XFile>
		SELF:aAvailableFieldSpecs:Clear()
		SELF:aFieldSpecsInModule:Clear()
		aFiles := XFuncs.FindItemsOfType(oXProject, XFileType.VOFieldSpec, NULL)
		FOREACH oFile AS XFile IN aFiles
			LOCAL cName AS STRING
			LOCAL lInModule AS LOGIC
			cName	  := oFile:FullPath
			lInModule := Funcs.GetModuleFileNameFromBinary(cName):ToUpper() == cModule:ToUpper()
			IF cName:ToUpper():Contains(".FIELDSPECS.VNFS") .OR. ;
				cName:ToUpper():Contains(".FIELDSPECS.XSFS")
				VAR aFS := VOFieldSpecEditor.OpenXML(cName, NULL)
				SELF:aAvailableFieldSpecs:AddRange(aFs)
				IF (lInModule)
					SELF:aFieldSpecsInModule:AddRange(aFs)
				ENDIF
			ELSE
				LOCAL fs AS FSEDesignFieldSpec
				fs := VOFieldSpecEditor.OPenVNFS(cName, (VOFieldSpecEditor) NULL)
				SELF:aAvailableFieldspecs:Add(fs)
				IF (lInModule)
					SELF:aFieldSpecsInModule:Add(fs)
				ENDIF
			ENDIF
		NEXT

	PROTECTED METHOD GetSaveFileStreams(cSrvFileName AS STRING , oPrgStream AS EditorStream, lVnfrmOnly AS LOGIC) AS LOGIC
		LOCAL cPrgFileName AS STRING
		LOCAL lSuccess AS LOGIC
		LOCAL lError AS LOGIC

		TRY

			cPrgFileName := Funcs.GetModuleFilenameFromBinary(cSrvFileName) + ".prg"
			lError := FALSE
			IF !lVnfrmOnly
				IF !File.Exists(cPrgFileName)
					XFuncs.ErrorBox("File was not found : " + cPrgFileName , "DBServer Editor")
					lError := TRUE
				END IF
			END IF

			lSuccess := FALSE
			IF !lError
				IF !lVnfrmOnly
					oPrgStream:Load(cPrgFileName)
					lSuccess := oPrgStream:IsValid
				ELSE
					lSuccess := TRUE
				END IF
			END IF

		CATCH e AS Exception

			XFuncs.ErrorBox(e:Message )
			lSuccess := FALSE

		END TRY

		IF !lSuccess
			IF oPrgStream:IsValid
				oPrgStream:Close()
			ENDIF
		END IF

	RETURN lSuccess

	METHOD Save(cFileName AS STRING , lSrvOnly AS LOGIC) AS LOGIC
		LOCAL oPrgStream AS XSharp_EditorStream
		LOCAL lSaveFieldSpecs := FALSE AS LOGIC
		LOCAL oCode AS CodeContents
		LOCAL cFieldSpec AS STRING
		LOCAL aCode AS ArrayList
		LOCAL cModule AS STRING
		LOCAL lSuccess := FALSE AS LOGIC
		LOCAL lAutoRecover AS LOGIC

		lAutoRecover := lSrvOnly .OR. cFileName:ToUpper():Contains("~AUTORECOVER")

		IF SELF:oFileNameEdit:Focused
		   IF SELF:oFileNameEdit:Text:Trim() != SELF:oMainDesign:GetProperty("filename"):TextValue
				SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{SELF:oMainDesign:cGuid , "filename" , SELF:oFileNameEdit:Text:Trim()})
			ENDIF
		ENDIF

		IF lAutoRecover
			TRY
				SELF:SaveToXml(cFileName)
				lSuccess := TRUE
			END TRY
			RETURN lSuccess
		END IF

		IF .NOT. SELF:CheckIfValid()
			RETURN FALSE
		END IF

		IF !VODBServerEditor.LoadTemplate(SELF:cLoadedDir)
			RETURN FALSE
		ENDIF
		IF !VOFieldSpecEditor.LoadTemplate(SELF:cLoadedDir)
			RETURN FALSE
		ENDIF

		oCode := SELF:GetCodeContents()

        cModule := Funcs.GetModuleFilenameFromBinary(cFileName)
		SELF:ReadAllAvailableFieldspecs(cModule)
		VAR aFieldSpecs := SELF:aFieldSpecsInModule

		aCode := ArrayList{}
		VAR aDesign := SELF:GetAllDesignItems(DBServerItemType.Field)
		FOREACH oDesign AS DBEDesignDBServer IN aDesign
			cFieldSpec := oDesign:GetProperty("classname"):TextValue
			cFieldSpec := cFieldSpec:Trim():ToUpper()
			IF SELF:IsFieldSpecInModule(cFieldSpec)
				lSaveFieldSpecs := TRUE
				FOREACH oFieldSpec AS FSEDesignFieldSpec IN aFieldSpecs
					IF oFieldSpec:Name:ToUpper() == cFieldSpec
						aCode:Add(oFieldSpec)
						SELF:CopyPropertyValues(oDesign , oFieldSpec)
						EXIT
					END IF
				NEXT
			ELSEIF .NOT. SELF:IsAvailableFieldSpec(cFieldSpec) // New FieldSpec
				lSaveFieldSpecs := TRUE
				VAR oFieldSpec := FSEDesignFieldSpec{NULL , NULL}
				aCode:Add(oFieldSpec)
				SELF:CopyPropertyValues(oDesign , oFieldSpec)
				aFieldSpecs:Add(oFieldSpec)
			END IF
		NEXT

		IF aFieldSpecs:Count != 0 .AND. lSaveFieldSpecs
			LOCAL cFieldSpecFileName AS STRING
			cFieldSpecFileName := cModule + ".FieldSpecs.vnfs"
			XFuncs.DeleteFile(oXProject, cFieldSpecFileName)
			cFieldSpecFileName := cModule + ".FieldSpecs.xsfs"
			VOFieldSpecEditor.SaveToXml( cFieldSpecFileName, aFieldSpecs)
			XFuncs.EnsureFileNodeExists(OXProject, cFieldSpecFileName)

			FOREACH oFieldSpec AS  FSEDesignFieldSpec IN aFieldSpecs
				VAR cFile := oFieldSpec:cVNfsFileName
				IF .NOT. String.IsNullOrEmpty(cFile) .AND. .NOT. oFieldSpec:cVNfsFileName:ToUpper():Contains(".FIELDSPECS.XSFS")
					XFuncs.DeleteFile(oXProject, cFile)
				END IF
			NEXT
		END IF

		SELF:ReadAllAvailableFieldspecs(cModule)

		lSrvOnly		:= lSrvOnly .OR. SELF:lStandalone
		oPrgStream  := XSharp_EditorStream{}
		IF SELF:GetSaveFileStreams(cFileName , oPrgStream , lSrvOnly)
			TRY
				SELF:SaveToXml(cFileName)
				IF !lSrvOnly
					SELF:SavePrg(oPrgStream , oCode , aCode)
				END IF
				lSuccess := TRUE

				IF !lSrvOnly
					SELF:nActionSaved := SELF:nAction
				END IF
			END TRY
		END IF

		IF lSuccess
			FOREACH cFile AS STRING IN SELF:aFilesToDelete
				XFuncs.DeleteFile(oXProject, cFile)
			NEXT
			SELF:aFilesToDelete:Clear()
		END IF

	RETURN lSuccess

	METHOD ProcessExtraEntity(aLines AS List<STRING>, oGenerator AS CodeGenerator, cClass AS STRING, lAdd AS LOGIC) AS VOID
		LOCAL oTempStream AS XSharp_EditorStream
		//LOCAL oTempGenerator AS CodeGenerator
		oTempStream := XSharp_EditorStream{}
		oTempStream:Load(aLines)
		//oTempGenerator := CodeGenerator{oTempStream:Editor}
		VAR oEntity := oTempStream:Editor:GetEntityObject(1)
		IF oEntity != NULL
			IF lAdd
				oGenerator:WriteEntity(oEntity:eType , oEntity:cName , cClass , EntityOptions.None, aLines)
			ELSE
				oGenerator:DeleteEntity(oEntity:eType , oEntity:cName , cClass )
			ENDIF
		END IF
		RETURN

	METHOD SavePrg(oStream AS XSharp_EditorStream , oCode AS CodeContents , aFieldSpecs AS ArrayList) AS LOGIC
		LOCAL cName AS STRING
		VAR oGenerator := CodeGenerator{oStream:Editor}
		oGenerator:BeginCode()

		cName := SELF:oMainDesign:GetProperty("classname"):TextValue
		oGenerator:WriteEntity(XIde.EntityType._Class , cName , cName , EntityOptions.AddUser, oCode:aClass)
		oGenerator:WriteEntity(XIde.EntityType._Constructor,  cName , cName ,EntityOptions.None , oCode:aConstructor)
		oGenerator:WriteEntity(XIde.EntityType._Access,  "FIELDDESC" , cName ,EntityOptions.None , oCode:aFieldDesc)
		oGenerator:WriteEntity(XIde.EntityType._Access,  "INDEXLIST" , cName , EntityOptions.None, oCode:aIndexList)

		FOREACH aAdditional AS List<STRING> IN oCode:aAdditional
			SELF:ProcessExtraEntity(aAdditional, oGenerator, cName, TRUE)
		NEXT
		//
		SELF:SaveAccessAssign(oGenerator , cName , SELF:oMainDesign:GetProperty("noaccass"):TextValue:ToUpper() == "YES")

		oGenerator:WriteEndClass(cName)

		FOREACH  oFieldSpec AS FSEDesignFieldSpec IN aFieldSpecs
			oCode := VOFieldSpecEditor.GetCodeContents(oFieldSpec)
			cName := oFieldSpec:GetProperty("classname"):TextValue
			oGenerator:WriteEntity(XIde.EntityType._Class ,      cName , cName , EntityOptions.AddUser, oCode:aClass)
			oGenerator:WriteEntity(XIde.EntityType._Constructor, cName , cName , EntityOptions.None, oCode:aConstructor)
			oGenerator:WriteEndClass(cName)
		NEXT

		oGenerator:EndCode()
		oStream:Save()

	RETURN TRUE
	METHOD SaveAccessAssign(oGenerator AS CodeGenerator, cClass AS STRING , lNoAccAss AS LOGIC) AS VOID
		LOCAL aValues AS NameValueCollection
		LOCAL aDesign AS ArrayList
		LOCAL cValue AS STRING
		LOCAL oMI AS MEthodInfo
		LOCAL oType AS System.Type

		aDesign := SELF:GetAllDesignItems(DBServerItemType.Field)
		oType := TYPEOF(VODbServerEditor)
		oMI := oType:GetMethod("TranslateLine", BindingFlags.Static | BindingFlags.NonPublic )
		FOREACH oDesign  AS  DBEDesignDBServer IN aDesign
			aValues := NameValueCollection{}
			FOREACH oProp AS  DesignProperty IN oDesign:aProperties
				DO CASE
				CASE oProp:Name == "hlname"
					// it appears that %hlname% tag is translated to %fldname% in VO
					cValue := oDesign:GetProperty("fldname"):TextValue // BIG BAD UGLY HACK
				CASE oProp:cEnumType == "YESNO"
					cValue := IIF(oProp:ValueLogic , "TRUE" , "FALSE")
				CASE oProp:Name == "type"
					IF (INT)oProp:Value == 6
						cValue := "X"
					ELSE
						cValue := oProp:TextValue:Substring(0,1)
					END IF
				OTHERWISE
					cValue := oProp:TextValue
				END CASE
				aValues:Add(oProp:Name , cValue)
			NEXT

			cValue := oDesign:GetProperty("Type"):TextValue:ToUpper()
			DO CASE
			CASE cValue == "CHARACTER" .OR. cValue == "MEMO"
				cValue := "STRING"
			CASE cValue == "NUMERIC"
				cValue := "FLOAT"
			OTHERWISE
				cValue := "USUAL"
			END CASE
			aValues:Add("usualtype" , cValue)

			FOREACH aTempEntity AS List<STRING> IN VODBServerEditor.Template:aAccessAssign
				VAR aEntity := List<STRING>{}
				FOREACH cLine AS STRING IN aTempEntity
					IF (oMI != NULL_OBJECT)
						LOCAL cNew AS STRING
						cNew := (STRING) oMI:Invoke(NULL_OBJECT, <OBJECT>{cLine, aValues})
						aEntity:Add(cNew)
					ELSE
						aEntity:Add(cLine)
					ENDIF
				NEXT
				LOCAL lDelete := lNoAccAss .OR. oDesign:GetProperty("included"):TextValue == "0" AS LOGIC
				SELF:ProcessExtraEntity(aEntity, oGenerator, cClass, !lDelete)
			NEXT
		NEXT

	RETURN
END CLASS
STATIC CLASS BufferExtensions
		STATIC METHOD GetEntityObject(SELF editor AS XSharpBuffer, nItem AS LONG) AS XIDE.EntityObject
			LOCAL oLine := editor:GetLine(nItem) AS XIde.LineObject
			IF oLine != NULL .AND. oLine:ContainsEntity
				RETURN oLine:LastEntity
			ENDIF
			RETURN NULL_OBJECT

END CLASS
END NAMESPACE

USING System.Collections
USING System.Collections.Generic
USING System.Windows.Forms
USING System.IO
USING Xide
USING XSharpModel
USING System.Reflection
USING XSharp.VODesigners
BEGIN NAMESPACE XSharp.VOEditors
CLASS XSharp_VODbServerEditor INHERIT VODbServerEditor
	PROTECT oXProject AS XProject

	CONSTRUCTOR(_oSurface AS Control , _oGrid AS DesignerGrid )
		SUPER(_oSurface , _oGrid)
		oXProject  := NULL_OBJECT
	RETURN

	METHOD Open(cFileName AS STRING) AS LOGIC
		LOCAL oFile AS XFile
		LOCAL lOk AS LOGIC
		oFile := XSharpModel.XSolution.FindFile(cFileName)
		IF (oFile != NULL_OBJECT)
			oXProject := oFile:Project
		ENDIF
		IF oXProject == NULL
			XFuncs.ErrorBox("Cannot find project for file "+cFileName)
			RETURN FALSE
		ENDIF
		SELF:ReadAllAvailableFieldSpecs(Funcs.GetModuleFilenameFromBinary(cFileName))
		SELF:aFilesToDelete:Clear()
		SELF:cLoadedDir := FileInfo{cFileName}:DirectoryName
		SELF:cDefaultFileName := cFileName
		SELF:lLoading := TRUE
		lOk := SELF:OpenXML(cFileName)
		IF (! lOk)
			TRY
				lOk := SELF:OpenVNDBS(cFileName)
			CATCH
			END TRY
		ENDIF
		SELF:lLoading := FALSE
		IF lOk
			SELF:oSurface:Controls:Add(SELF:oPanel)
			SELF:oGrid:PropertyModified := SELF:oPropertyUpdatedHandler
			SELF:oGrid:ControlKeyPressed := SELF:oControlKeyPressedHandler
			SELF:InitReadonlyProperties()
			SELF:GiveFocus()
		ENDIF
		RETURN lOk
	METHOD GetAvailableFieldSpec(cFieldSpec AS STRING) AS FSEDesignFieldSpec
		IF aAvailableFieldSpecs == NULL
			aAvailableFieldSpecs  := ArrayList{}
		ENDIF
		FOREACH oFs AS FSEDesignFieldSpec IN aAvailableFieldSpecs
			IF String.Equals(oFS:Name, cFieldSpec, StringComparison.OrdinalIgnoreCase)
				RETURN oFS
			ENDIF
		NEXT
		RETURN NULL
	METHOD ReadAllAvailableFieldSpecs(cModule AS STRING) AS VOID
		LOCAL aFiles AS IList<XFile>
		SELF:aAvailableFieldSpecs:Clear()
		SELF:aFieldSpecsInModule:Clear()
		aFiles := XFuncs.FindItemsOfType(oXProject, XFileType.VOFieldSpec, NULL)
		FOREACH oFile AS XFile IN aFiles
			LOCAL cName AS STRING
			LOCAL lInModule AS LOGIC
			cName	  := oFile:FullPath
			lInModule := Funcs.GetModuleFileNameFromBinary(cName):ToUpper() == cModule:ToUpper()
			IF cName:ToUpper():Contains(".FIELDSPECS.VNFS") .or. ;
				cName:ToUpper():Contains(".FIELDSPECS.XSFS")
				VAR aFS := VOFieldSpecEditor.OpenXML(cName, NULL)
				SELF:aAvailableFieldSpecs:AddRange(aFs)
				IF (lInModule)
					SELF:aFieldSpecsInModule:AddRange(aFs)
				ENDIF
			ELSE
				LOCAL fs AS FSEDesignFieldSpec
				fs := VOFieldSpecEditor.OPenVNFS(cName, (VOFieldSpecEditor) NULL)
				SELF:aAvailableFieldspecs:Add(fs)
				IF (lInModule)
					SELF:aFieldSpecsInModule:Add(fs)
				ENDIF
			ENDIF
		NEXT

	PROTECTED METHOD GetSaveFileStreams(cSrvFileName AS STRING , oPrgStream AS EditorStream, lVnfrmOnly AS LOGIC) AS LOGIC
		LOCAL cPrgFileName AS STRING
		LOCAL lSuccess AS LOGIC
		LOCAL lError AS LOGIC

		TRY

			cPrgFileName := Funcs.GetModuleFilenameFromBinary(cSrvFileName) + ".prg"
			lError := FALSE
			IF !lVnfrmOnly
				IF !File.Exists(cPrgFileName)
					XFuncs.ErrorBox("File was not found : " + cPrgFileName , "DBServer Editor")
					lError := TRUE
				END IF
			END IF

			lSuccess := FALSE
			IF !lError
				IF !lVnfrmOnly
					oPrgStream:Load(cPrgFileName)
					lSuccess := oPrgStream:IsValid
				ELSE
					lSuccess := TRUE
				END IF
			END IF

		CATCH e AS Exception

			XFuncs.ErrorBox(e:Message )
			lSuccess := FALSE

		END TRY

		IF !lSuccess
			IF oPrgStream:IsValid
				oPrgStream:Close()
			ENDIF
		END IF

	RETURN lSuccess

	METHOD Save(cFileName AS STRING , lSrvOnly AS LOGIC) AS LOGIC
		LOCAL oPrgStream AS XSharp_EditorStream
		LOCAL lSaveFieldSpecs := FALSE AS LOGIC
		LOCAL oCode AS CodeContents
		LOCAL cFieldSpec AS STRING
		LOCAL aCode AS ArrayList
		LOCAL cModule AS STRING
		LOCAL lSuccess := FALSE AS LOGIC
		LOCAL lAutoRecover AS LOGIC

		lAutoRecover := lSrvOnly .or. cFileName:ToUpper():Contains("~AUTORECOVER")

		IF SELF:oFileNameEdit:Focused
		   IF SELF:oFileNameEdit:Text:Trim() != SELF:oMainDesign:GetProperty("filename"):TextValue
				SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{SELF:oMainDesign:cGuid , "filename" , SELF:oFileNameEdit:Text:Trim()})
			ENDIF
		ENDIF

		IF lAutoRecover
			TRY
				SELF:SaveToXml(cFileName)
				lSuccess := TRUE
			END TRY
			RETURN lSuccess
		END IF

		IF .not. SELF:CheckIfValid()
			RETURN FALSE
		END IF

		IF !VODBServerEditor.LoadTemplate(SELF:cLoadedDir)
			RETURN FALSE
		ENDIF
		IF !VOFieldSpecEditor.LoadTemplate(SELF:cLoadedDir)
			RETURN FALSE
		ENDIF

		oCode := SELF:GetCodeContents()

        cModule := Funcs.GetModuleFilenameFromBinary(cFileName)
		SELF:ReadAllAvailableFieldspecs(cModule)
		VAR aFieldSpecs := SELF:aFieldSpecsInModule

		aCode := ArrayList{}
		VAR aDesign := SELF:GetAllDesignItems(DBServerItemType.Field)
		FOREACH oDesign AS DBEDesignDBServer IN aDesign
			cFieldSpec := oDesign:GetProperty("classname"):TextValue
			cFieldSpec := cFieldSpec:Trim():ToUpper()
			IF SELF:IsFieldSpecInModule(cFieldSpec)
				lSaveFieldSpecs := TRUE
				FOREACH oFieldSpec AS FSEDesignFieldSpec IN aFieldSpecs
					IF oFieldSpec:Name:ToUpper() == cFieldSpec
						aCode:Add(oFieldSpec)
						SELF:CopyPropertyValues(oDesign , oFieldSpec)
						EXIT
					END IF
				NEXT
			ELSEIF .not. SELF:IsAvailableFieldSpec(cFieldSpec) // New FieldSpec
				lSaveFieldSpecs := TRUE
				VAR oFieldSpec := FSEDesignFieldSpec{NULL , NULL}
				aCode:Add(oFieldSpec)
				SELF:CopyPropertyValues(oDesign , oFieldSpec)
				aFieldSpecs:Add(oFieldSpec)
			END IF
		NEXT

		IF aFieldSpecs:Count != 0 .and. lSaveFieldSpecs
			LOCAL cFieldSpecFileName AS STRING
			cFieldSpecFileName := cModule + ".FieldSpecs.vnfs"
			XFuncs.DeleteFile(oXProject, cFieldSpecFileName)
			cFieldSpecFileName := cModule + ".FieldSpecs.xsfs"
			VOFieldSpecEditor.SaveToXml( cFieldSpecFileName, aFieldSpecs)
			XFuncs.EnsureFileNodeExists(OXProject, cFieldSpecFileName)

			FOREACH oFieldSpec AS  FSEDesignFieldSpec IN aFieldSpecs
				VAR cFile := oFieldSpec:cVNfsFileName
				IF .not. String.IsNullOrEmpty(cFile) .and. .not. oFieldSpec:cVNfsFileName:ToUpper():Contains(".FIELDSPECS.XSFS")
					XFuncs.DeleteFile(oXProject, cFile)
				END IF
			NEXT
		END IF

		SELF:ReadAllAvailableFieldspecs(cModule)

		lSrvOnly		:= lSrvOnly .or. SELF:lStandalone
		oPrgStream  := XSharp_EditorStream{}
		IF SELF:GetSaveFileStreams(cFileName , oPrgStream , lSrvOnly)
			TRY
				SELF:SaveToXml(cFileName)
				IF !lSrvOnly
					SELF:SavePrg(oPrgStream , oCode , aCode)
				END IF
				lSuccess := TRUE

				IF !lSrvOnly
					SELF:nActionSaved := SELF:nAction
				END IF
			END TRY
		END IF

		IF lSuccess
			FOREACH cFile AS STRING IN SELF:aFilesToDelete
				XFuncs.DeleteFile(oXProject, cFile)
			NEXT
			SELF:aFilesToDelete:Clear()
		END IF

	RETURN lSuccess

	METHOD ProcessExtraEntity(aLines AS List<STRING>, oGenerator AS CodeGenerator, cClass AS STRING, lAdd AS LOGIC) AS VOID
		LOCAL oTempStream AS XSharp_EditorStream
		//LOCAL oTempGenerator AS CodeGenerator
		oTempStream := XSharp_EditorStream{}
		oTempStream:Load(aLines)
		//oTempGenerator := CodeGenerator{oTempStream:Editor}
		VAR oEntity := oTempStream:Editor:GetEntityObject(1)
		IF oEntity != NULL
			IF lAdd
				oGenerator:WriteEntity(oEntity:eType , oEntity:cName , cClass , EntityOptions.None, aLines)
			ELSE
				oGenerator:DeleteEntity(oEntity:eType , oEntity:cName , cClass )
			ENDIF
		END IF
		RETURN

	METHOD SavePrg(oStream AS XSharp_EditorStream , oCode AS CodeContents , aFieldSpecs AS ArrayList) AS LOGIC
		LOCAL cName AS STRING
		VAR oGenerator := CodeGenerator{oStream:Editor}
		oGenerator:BeginCode()

		cName := SELF:oMainDesign:GetProperty("classname"):TextValue
		oGenerator:WriteEntity(XIde.EntityType._Class , cName , cName , EntityOptions.AddUser, oCode:aClass)
		oGenerator:WriteEntity(XIde.EntityType._Constructor,  cName , cName ,EntityOptions.None , oCode:aConstructor)
		oGenerator:WriteEntity(XIde.EntityType._Access,  "FIELDDESC" , cName ,EntityOptions.None , oCode:aFieldDesc)
		oGenerator:WriteEntity(XIde.EntityType._Access,  "INDEXLIST" , cName , EntityOptions.None, oCode:aIndexList)

		FOREACH aAdditional AS List<STRING> IN oCode:aAdditional
			SELF:ProcessExtraEntity(aAdditional, oGenerator, cName, TRUE)
		NEXT
		//
		SELF:SaveAccessAssign(oGenerator , cName , SELF:oMainDesign:GetProperty("noaccass"):TextValue:ToUpper() == "YES")

		FOREACH  oFieldSpec AS FSEDesignFieldSpec IN aFieldSpecs
			oCode := VOFieldSpecEditor.GetCodeContents(oFieldSpec)
			cName := oFieldSpec:GetProperty("classname"):TextValue
			oGenerator:WriteEntity(XIde.EntityType._Class ,      cName , cName , EntityOptions.AddUser, oCode:aClass)
			oGenerator:WriteEntity(XIde.EntityType._Constructor, cName , cName , EntityOptions.None, oCode:aConstructor)
		NEXT
		oGenerator:WriteEndClass(cName)
		oGenerator:EndCode()
		oStream:Save()

	RETURN TRUE
	METHOD SaveAccessAssign(oGenerator AS CodeGenerator, cClass AS STRING , lNoAccAss AS LOGIC) AS VOID
		LOCAL aValues AS NameValueCollection
		LOCAL aDesign AS ArrayList
		LOCAL cValue AS STRING
		LOCAL oMI AS MEthodInfo
		LOCAL oType AS System.Type

		aDesign := SELF:GetAllDesignItems(DBServerItemType.Field)
		oType := TYPEOF(VODbServerEditor)
		oMI := oType:GetMethod("TranslateLine", BindingFlags.Static | BindingFlags.NonPublic )
		FOREACH oDesign  AS  DBEDesignDBServer IN aDesign
			aValues := NameValueCollection{}
			FOREACH oProp AS  DesignProperty IN oDesign:aProperties
				DO CASE
				CASE oProp:Name == "hlname"
					// it appears that %hlname% tag is translated to %fldname% in VO
					cValue := oDesign:GetProperty("fldname"):TextValue // BIG BAD UGLY HACK
				CASE oProp:cEnumType == "YESNO"
					cValue := IIF(oProp:ValueLogic , "TRUE" , "FALSE")
				CASE oProp:Name == "type"
					IF (INT)oProp:Value == 6
						cValue := "X"
					ELSE
						cValue := oProp:TextValue:Substring(0,1)
					END IF
				OTHERWISE
					cValue := oProp:TextValue
				END CASE
				aValues:Add(oProp:Name , cValue)
			NEXT

			cValue := oDesign:GetProperty("Type"):TextValue:ToUpper()
			DO CASE
			CASE cValue == "CHARACTER" .or. cValue == "MEMO"
				cValue := "STRING"
			CASE cValue == "NUMERIC"
				cValue := "FLOAT"
			OTHERWISE
				cValue := "USUAL"
			END CASE
			aValues:Add("usualtype" , cValue)

			FOREACH aTempEntity AS List<STRING> IN VODBServerEditor.Template:aAccessAssign
				VAR aEntity := List<STRING>{}
				FOREACH cLine AS STRING IN aTempEntity
					IF (oMI != NULL_OBJECT)
						LOCAL cNew AS STRING
						cNew := (STRING) oMI:Invoke(NULL_OBJECT, <OBJECT>{cLine, aValues})
						aEntity:Add(cNew)
					ELSE
						aEntity:Add(cLine)
					ENDIF
				NEXT
				LOCAL lDelete := lNoAccAss .or. oDesign:GetProperty("included"):TextValue == "0" AS LOGIC
				SELF:ProcessExtraEntity(aEntity, oGenerator, cClass, !lDelete)
			NEXT
		NEXT

	RETURN
END CLASS
STATIC CLASS BufferExtensions
		STATIC METHOD GetEntityObject(SELF editor AS XSharpBuffer, nItem AS LONG) AS XIDE.EntityObject
			LOCAL oLine := editor:GetLine(nItem) AS XIde.LineObject
			IF oLine != NULL .and. oLine:ContainsEntity
				RETURN oLine:LastEntity
			ENDIF
			RETURN NULL_OBJECT

END CLASS
END NAMESPACE


source/QtUiTools: updated

source/QtUiTools: updated

Modified:
source/QtUiTools/QUiLoader.prg

/*

  Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5

  Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QACTION
REQUEST QACTIONGROUP
REQUEST QDIR
REQUEST QLAYOUT
REQUEST QWIDGET
#endif

CLASS QUiLoader INHERIT QObject

   METHOD new
   METHOD delete
   METHOD addPluginPath
   METHOD availableLayouts
   METHOD availableWidgets
   METHOD clearPluginPaths
   METHOD createAction
   METHOD createActionGroup
   METHOD createLayout
   METHOD createWidget
   METHOD isLanguageChangeEnabled
   METHOD load
   METHOD pluginPaths
   METHOD setLanguageChangeEnabled
   METHOD setWorkingDirectory
   METHOD workingDirectory

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject() CLASS QUiLoader
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <QtCore/Qt>

#ifndef __XHARBOUR__
#include <QtUiTools/QUiLoader>
#endif

#include "qt5xhb_common.h"
#include "qt5xhb_macros.h"
#include "qt5xhb_utils.h"
#include "qt5xhb_events.h"
#include "qt5xhb_signals.h"

#ifdef __XHARBOUR__
#include <QtUiTools/QUiLoader>
#endif

#include <QtCore/QStringList>
#include <QtCore/QDir>
#include <QtWidgets/QAction>
#include <QtWidgets/QActionGroup>
#include <QtWidgets/QLayout>

/*
QUiLoader ( QObject * parent = 0 )
*/
HB_FUNC_STATIC( QUILOADER_NEW )
{
  if( ISBETWEEN(0,1) && (ISQOBJECT(1)||ISNIL(1)) )
  {
    QUiLoader * obj = new QUiLoader( OPQOBJECT(1,0) );
    Qt5xHb::returnNewObject( obj, false );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QUILOADER_DELETE )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
    Qt5xHb::Events_disconnect_all_events( obj, true );
    Signals_disconnect_all_signals( obj, true );
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addPluginPath ( const QString & path )
*/
HB_FUNC_STATIC( QUILOADER_ADDPLUGINPATH )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISCHAR(1) )
    {
#endif
      obj->addPluginPath( PQSTRING(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QStringList availableLayouts () const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLELAYOUTS )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RQSTRINGLIST( obj->availableLayouts() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList availableWidgets () const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLEWIDGETS )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RQSTRINGLIST( obj->availableWidgets() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void clearPluginPaths ()
*/
HB_FUNC_STATIC( QUILOADER_CLEARPLUGINPATHS )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      obj->clearPluginPaths();
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
virtual QAction * createAction ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTION )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,2) && (ISQOBJECT(1)||ISNIL(1)) && ISOPTCHAR(2) )
    {
#endif
      QAction * ptr = obj->createAction( OPQOBJECT(1,0), OPQSTRING(2,QString()) );
      Qt5xHb::createReturnQObjectClass( ptr, "QACTION" );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
virtual QActionGroup * createActionGroup ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTIONGROUP )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,2) && (ISQOBJECT(1)||ISNIL(1)) && ISOPTCHAR(2) )
    {
#endif
      QActionGroup * ptr = obj->createActionGroup( OPQOBJECT(1,0), OPQSTRING(2,QString()) );
      Qt5xHb::createReturnQObjectClass( ptr, "QACTIONGROUP" );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
virtual QLayout * createLayout ( const QString & className, QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATELAYOUT )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISCHAR(1) && (ISQOBJECT(2)||ISNIL(2)) && ISOPTCHAR(3) )
    {
#endif
      QLayout * ptr = obj->createLayout( PQSTRING(1), OPQOBJECT(2,0), OPQSTRING(3,QString()) );
      Qt5xHb::createReturnQObjectClass( ptr, "QLAYOUT" );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
virtual QWidget * createWidget ( const QString & className, QWidget * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEWIDGET )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISCHAR(1) && (ISQWIDGET(2)||ISNIL(2)) && ISOPTCHAR(3) )
    {
#endif
      QWidget * ptr = obj->createWidget( PQSTRING(1), OPQWIDGET(2,0), OPQSTRING(3,QString()) );
      Qt5xHb::createReturnQWidgetClass( ptr, "QWIDGET" );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
bool isLanguageChangeEnabled () const
*/
HB_FUNC_STATIC( QUILOADER_ISLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RBOOL( obj->isLanguageChangeEnabled() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QWidget * load ( QIODevice * device, QWidget * parentWidget = 0 )
*/
HB_FUNC_STATIC( QUILOADER_LOAD )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,2) && ISQIODEVICE(1) && (ISQWIDGET(2)||ISNIL(2)) )
    {
#endif
      QWidget * ptr = obj->load( PQIODEVICE(1), OPQWIDGET(2,0) );
      Qt5xHb::createReturnQWidgetClass( ptr, "QWIDGET" );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList pluginPaths () const
*/
HB_FUNC_STATIC( QUILOADER_PLUGINPATHS )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RQSTRINGLIST( obj->pluginPaths() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void setLanguageChangeEnabled ( bool enabled )
*/
HB_FUNC_STATIC( QUILOADER_SETLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISLOG(1) )
    {
#endif
      obj->setLanguageChangeEnabled( PBOOL(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setWorkingDirectory ( const QDir & dir )
*/
HB_FUNC_STATIC( QUILOADER_SETWORKINGDIRECTORY )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISQDIR(1) )
    {
#endif
      obj->setWorkingDirectory( *PQDIR(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QDir workingDirectory () const
*/
HB_FUNC_STATIC( QUILOADER_WORKINGDIRECTORY )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QDir * ptr = new QDir( obj->workingDirectory() );
      Qt5xHb::createReturnClass( ptr, "QDIR", true );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

#pragma ENDDUMP

/*

  Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5

  Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QACTION
REQUEST QACTIONGROUP
REQUEST QDIR
REQUEST QLAYOUT
REQUEST QWIDGET
#endif

CLASS QUiLoader INHERIT QObject

   METHOD new
   METHOD delete
   METHOD addPluginPath
   METHOD availableLayouts
   METHOD availableWidgets
   METHOD clearPluginPaths
   METHOD createAction
   METHOD createActionGroup
   METHOD createLayout
   METHOD createWidget
   METHOD isLanguageChangeEnabled
   METHOD load
   METHOD pluginPaths
   METHOD setLanguageChangeEnabled
   METHOD setWorkingDirectory
   METHOD workingDirectory

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject() CLASS QUiLoader
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <QtCore/Qt>

#ifndef __XHARBOUR__
#include <QtUiTools/QUiLoader>
#endif

#include "qt5xhb_common.h"
#include "qt5xhb_macros.h"
#include "qt5xhb_utils.h"

#ifdef __XHARBOUR__
#include <QtUiTools/QUiLoader>
#endif

#include <QtCore/QStringList>
#include <QtCore/QDir>
#include <QtWidgets/QAction>
#include <QtWidgets/QActionGroup>
#include <QtWidgets/QLayout>

/*
QUiLoader ( QObject * parent = 0 )
*/
HB_FUNC_STATIC( QUILOADER_NEW )
{
  if( ISBETWEEN(0,1) && (ISQOBJECT(1)||ISNIL(1)) )
  {
    QUiLoader * o = new QUiLoader( OPQOBJECT(1,0) );
    Qt5xHb::returnNewObject( o, false );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QUILOADER_DELETE )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addPluginPath ( const QString & path )
*/
HB_FUNC_STATIC( QUILOADER_ADDPLUGINPATH )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISCHAR(1) )
    {
#endif
      obj->addPluginPath( PQSTRING(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QStringList availableLayouts () const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLELAYOUTS )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RQSTRINGLIST( obj->availableLayouts() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList availableWidgets () const
*/
HB_FUNC_STATIC( QUILOADER_AVAILABLEWIDGETS )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RQSTRINGLIST( obj->availableWidgets() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void clearPluginPaths ()
*/
HB_FUNC_STATIC( QUILOADER_CLEARPLUGINPATHS )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      obj->clearPluginPaths();
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
virtual QAction * createAction ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTION )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,2) && (ISQOBJECT(1)||ISNIL(1)) && ISOPTCHAR(2) )
    {
#endif
      QAction * ptr = obj->createAction( OPQOBJECT(1,0), OPQSTRING(2,QString()) );
      Qt5xHb::createReturnQObjectClass( ptr, "QACTION" );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
virtual QActionGroup * createActionGroup ( QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEACTIONGROUP )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,2) && (ISQOBJECT(1)||ISNIL(1)) && ISOPTCHAR(2) )
    {
#endif
      QActionGroup * ptr = obj->createActionGroup( OPQOBJECT(1,0), OPQSTRING(2,QString()) );
      Qt5xHb::createReturnQObjectClass( ptr, "QACTIONGROUP" );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
virtual QLayout * createLayout ( const QString & className, QObject * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATELAYOUT )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISCHAR(1) && (ISQOBJECT(2)||ISNIL(2)) && ISOPTCHAR(3) )
    {
#endif
      QLayout * ptr = obj->createLayout( PQSTRING(1), OPQOBJECT(2,0), OPQSTRING(3,QString()) );
      Qt5xHb::createReturnQObjectClass( ptr, "QLAYOUT" );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
virtual QWidget * createWidget ( const QString & className, QWidget * parent = 0, const QString & name = QString() )
*/
HB_FUNC_STATIC( QUILOADER_CREATEWIDGET )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISCHAR(1) && (ISQWIDGET(2)||ISNIL(2)) && ISOPTCHAR(3) )
    {
#endif
      QWidget * ptr = obj->createWidget( PQSTRING(1), OPQWIDGET(2,0), OPQSTRING(3,QString()) );
      Qt5xHb::createReturnQWidgetClass( ptr, "QWIDGET" );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
bool isLanguageChangeEnabled () const
*/
HB_FUNC_STATIC( QUILOADER_ISLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RBOOL( obj->isLanguageChangeEnabled() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QWidget * load ( QIODevice * device, QWidget * parentWidget = 0 )
*/
HB_FUNC_STATIC( QUILOADER_LOAD )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,2) && ISQIODEVICE(1) && (ISQWIDGET(2)||ISNIL(2)) )
    {
#endif
      QWidget * ptr = obj->load( PQIODEVICE(1), OPQWIDGET(2,0) );
      Qt5xHb::createReturnQWidgetClass( ptr, "QWIDGET" );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList pluginPaths () const
*/
HB_FUNC_STATIC( QUILOADER_PLUGINPATHS )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RQSTRINGLIST( obj->pluginPaths() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void setLanguageChangeEnabled ( bool enabled )
*/
HB_FUNC_STATIC( QUILOADER_SETLANGUAGECHANGEENABLED )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISLOG(1) )
    {
#endif
      obj->setLanguageChangeEnabled( PBOOL(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setWorkingDirectory ( const QDir & dir )
*/
HB_FUNC_STATIC( QUILOADER_SETWORKINGDIRECTORY )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISQDIR(1) )
    {
#endif
      obj->setWorkingDirectory( *PQDIR(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QDir workingDirectory () const
*/
HB_FUNC_STATIC( QUILOADER_WORKINGDIRECTORY )
{
  QUiLoader * obj = (QUiLoader *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QDir * ptr = new QDir( obj->workingDirectory() );
      Qt5xHb::createReturnClass( ptr, "QDIR", true );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

#pragma ENDDUMP


QtMacExtras module updated to use the file qt5xhb_common.h

/*

  Qt5xHb - bibliotecas de ligao entre Harbour/xHarbour e Qt Framework 5

  Copyright (C) 2012-2017 Marcos Antonio Gambeta <marcosgambeta@uol.com.br>

*/

#include "hbclass.ch"
#include "qt5xhb_clsid.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QVARIANT
REQUEST QBYTEARRAY
#endif

CLASS QMacPasteboardMime

   DATA pointer
   DATA class_id INIT Class_Id_QMacPasteboardMime
   DATA class_flags INIT 0
   DATA self_destruction INIT .F.

   METHOD new
   METHOD delete
   METHOD convertorName
   METHOD canConvert
   METHOD mimeFor
   METHOD flavorFor
   METHOD convertToMime
   METHOD convertFromMime
   METHOD count
   METHOD newFrom
   METHOD newFromObject
   METHOD newFromPointer
   METHOD selfDestruction
   METHOD setSelfDestruction
   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QMacPasteboardMime
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <Qt>

#ifndef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
#include <QMacPasteboardMime>
#endif
#endif

#include "qt5xhb_common.h"
#include "qt5xhb_clsid.h"
#include "qt5xhb_utils.h"

#ifdef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
#include <QMacPasteboardMime>
#endif
#endif

/*
QMacPasteboardMime(char)
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEW )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  char par1 = ISCHAR(1)? (char) hb_parc(1)[0] : (ISNUM(1)? hb_parni(1) : 0);
  QMacPasteboardMime * o = new QMacPasteboardMime ( par1 );
  PHB_ITEM self = hb_stackSelfItem();
  PHB_ITEM ptr = hb_itemPutPtr( NULL,(QMacPasteboardMime *) o );
  hb_objSendMsg( self, "_pointer", 1, ptr );
  hb_itemRelease( ptr );
  hb_itemReturn( self );
#endif
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_DELETE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }
  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
virtual QString convertorName() = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CONVERTORNAME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retc( (const char *) obj->convertorName (  ).toLatin1().data() );
  }
#endif
}

/*
virtual bool canConvert(const QString &mime, QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CANCONVERT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    QString par2 = QLatin1String( hb_parc(2) );
    hb_retl( obj->canConvert ( par1, par2 ) );
  }
#endif
}

/*
virtual QString mimeFor(QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_MIMEFOR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    hb_retc( (const char *) obj->mimeFor ( par1 ).toLatin1().data() );
  }
#endif
}

/*
virtual QString flavorFor(const QString &mime) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_FLAVORFOR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    hb_retc( (const char *) obj->flavorFor ( par1 ).toLatin1().data() );
  }
#endif
}

/*
virtual QVariant convertToMime(const QString &mime, QList<QByteArray> data, QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CONVERTTOMIME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    QList<QByteArray> par2;
    PHB_ITEM aList2 = hb_param(2, HB_IT_ARRAY);
    int i2;
    int nLen2 = hb_arrayLen(aList2);
    for (i2=0;i2<nLen2;i2++)
    {
      par2 << *(QByteArray *) hb_itemGetPtr( hb_objSendMsg( hb_arrayGetItemPtr( aList2, i2+1 ), "POINTER", 0 ) );
    }
    QString par3 = QLatin1String( hb_parc(3) );
    QVariant * ptr = new QVariant( obj->convertToMime ( par1, par2, par3 ) );
    _qt5xhb_createReturnClass ( ptr, "QVARIANT", true );
  }
#endif
}

/*
virtual QList<QByteArray> convertFromMime(const QString &mime, QVariant data, QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CONVERTFROMMIME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    QVariant * par2 = (QVariant *) _qt5xhb_itemGetPtr(2);
    QString par3 = QLatin1String( hb_parc(3) );
    QList<QByteArray> list = obj->convertFromMime ( par1, *par2, par3 );
    PHB_DYNS pDynSym;
    #ifdef __XHARBOUR__
    pDynSym = hb_dynsymFind( "QBYTEARRAY" );
    #else
    pDynSym = hb_dynsymFindName( "QBYTEARRAY" );
    #endif
    PHB_ITEM pArray;
    pArray = hb_itemArrayNew(0);
    int i;
    for(i=0;i<list.count();i++)
    {
      if( pDynSym )
      {
        #ifdef __XHARBOUR__
        hb_vmPushSymbol( pDynSym->pSymbol );
        #else
        hb_vmPushDynSym( pDynSym );
        #endif
        hb_vmPushNil();
        hb_vmDo( 0 );
        PHB_ITEM pObject = hb_itemNew( NULL );
        hb_itemCopy( pObject, hb_stackReturnItem() );
        PHB_ITEM pItem = hb_itemNew( NULL );
        hb_itemPutPtr( pItem, (QByteArray *) new QByteArray ( list[i] ) );
        hb_objSendMsg( pObject, "_POINTER", 1, pItem );
        hb_itemRelease( pItem );
        hb_arrayAddForward( pArray, pObject );
        hb_itemRelease( pObject );
      }
    }
    hb_itemReturnRelease(pArray);
  }
#endif
}

/*
virtual int count(QMimeData *mimeData)
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_COUNT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QMimeData * par1 = (QMimeData *) _qt5xhb_itemGetPtr(1);
    hb_retni( obj->count ( par1 ) );
  }
#endif
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEWFROM )
{
  PHB_ITEM self = hb_stackSelfItem();
  if( hb_pcount() == 1 && ISOBJECT(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else if( hb_pcount() == 1 && ISPOINTER(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_param(1, HB_IT_POINTER ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  hb_itemReturn( self );
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEWFROMOBJECT )
{
  HB_FUNC_EXEC( QMACPASTEBOARDMIME_NEWFROM );
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEWFROMPOINTER )
{
  HB_FUNC_EXEC( QMACPASTEBOARDMIME_NEWFROM );
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_SELFDESTRUCTION )
{
  hb_retl( (bool) hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) );
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_SETSELFDESTRUCTION )
{
  PHB_ITEM self = hb_stackSelfItem();
  if( hb_pcount() == 1 && ISLOG(1) )
  {
    PHB_ITEM des = hb_itemPutL( NULL, hb_parl(1) );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  hb_itemReturn( self );
}

#pragma ENDDUMP

/*

  Qt5xHb - bibliotecas de ligao entre Harbour/xHarbour e Qt Framework 5

  Copyright (C) 2012-2017 Marcos Antonio Gambeta <marcosgambeta@uol.com.br>

*/

#include "hbclass.ch"
#include "qt5xhb_clsid.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QVARIANT
REQUEST QBYTEARRAY
#endif

CLASS QMacPasteboardMime

   DATA pointer
   DATA class_id INIT Class_Id_QMacPasteboardMime
   DATA class_flags INIT 0
   DATA self_destruction INIT .F.

   METHOD new
   METHOD delete
   METHOD convertorName
   METHOD canConvert
   METHOD mimeFor
   METHOD flavorFor
   METHOD convertToMime
   METHOD convertFromMime
   METHOD count
   METHOD newFrom
   METHOD newFromObject
   METHOD newFromPointer
   METHOD selfDestruction
   METHOD setSelfDestruction
   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QMacPasteboardMime
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <Qt>

#ifndef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
#include <QMacPasteboardMime>
#endif
#endif

#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbvm.h"
#include "hbstack.h"

#ifndef __XHARBOUR__
#include "hbapicls.h"
#define ISNIL HB_ISNIL
#define ISLOG HB_ISLOG
#define ISNUM HB_ISNUM
#define ISCHAR HB_ISCHAR
#define ISPOINTER HB_ISPOINTER
#define ISOBJECT HB_ISOBJECT
#define ISARRAY HB_ISARRAY
#endif

#include "qt5xhb_clsid.h"
#include "qt5xhb_utils.h"

#ifdef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
#include <QMacPasteboardMime>
#endif
#endif

/*
QMacPasteboardMime(char)
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEW )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  char par1 = ISCHAR(1)? (char) hb_parc(1)[0] : (ISNUM(1)? hb_parni(1) : 0);
  QMacPasteboardMime * o = new QMacPasteboardMime ( par1 );
  PHB_ITEM self = hb_stackSelfItem();
  PHB_ITEM ptr = hb_itemPutPtr( NULL,(QMacPasteboardMime *) o );
  hb_objSendMsg( self, "_pointer", 1, ptr );
  hb_itemRelease( ptr );
  hb_itemReturn( self );
#endif
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_DELETE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }
  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
virtual QString convertorName() = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CONVERTORNAME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    hb_retc( (const char *) obj->convertorName (  ).toLatin1().data() );
  }
#endif
}

/*
virtual bool canConvert(const QString &mime, QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CANCONVERT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    QString par2 = QLatin1String( hb_parc(2) );
    hb_retl( obj->canConvert ( par1, par2 ) );
  }
#endif
}

/*
virtual QString mimeFor(QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_MIMEFOR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    hb_retc( (const char *) obj->mimeFor ( par1 ).toLatin1().data() );
  }
#endif
}

/*
virtual QString flavorFor(const QString &mime) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_FLAVORFOR )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    hb_retc( (const char *) obj->flavorFor ( par1 ).toLatin1().data() );
  }
#endif
}

/*
virtual QVariant convertToMime(const QString &mime, QList<QByteArray> data, QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CONVERTTOMIME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    QList<QByteArray> par2;
    PHB_ITEM aList2 = hb_param(2, HB_IT_ARRAY);
    int i2;
    int nLen2 = hb_arrayLen(aList2);
    for (i2=0;i2<nLen2;i2++)
    {
      par2 << *(QByteArray *) hb_itemGetPtr( hb_objSendMsg( hb_arrayGetItemPtr( aList2, i2+1 ), "POINTER", 0 ) );
    }
    QString par3 = QLatin1String( hb_parc(3) );
    QVariant * ptr = new QVariant( obj->convertToMime ( par1, par2, par3 ) );
    _qt5xhb_createReturnClass ( ptr, "QVARIANT", true );
  }
#endif
}

/*
virtual QList<QByteArray> convertFromMime(const QString &mime, QVariant data, QString flav) = 0
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_CONVERTFROMMIME )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QString par1 = QLatin1String( hb_parc(1) );
    QVariant * par2 = (QVariant *) _qt5xhb_itemGetPtr(2);
    QString par3 = QLatin1String( hb_parc(3) );
    QList<QByteArray> list = obj->convertFromMime ( par1, *par2, par3 );
    PHB_DYNS pDynSym;
    #ifdef __XHARBOUR__
    pDynSym = hb_dynsymFind( "QBYTEARRAY" );
    #else
    pDynSym = hb_dynsymFindName( "QBYTEARRAY" );
    #endif
    PHB_ITEM pArray;
    pArray = hb_itemArrayNew(0);
    int i;
    for(i=0;i<list.count();i++)
    {
      if( pDynSym )
      {
        #ifdef __XHARBOUR__
        hb_vmPushSymbol( pDynSym->pSymbol );
        #else
        hb_vmPushDynSym( pDynSym );
        #endif
        hb_vmPushNil();
        hb_vmDo( 0 );
        PHB_ITEM pObject = hb_itemNew( NULL );
        hb_itemCopy( pObject, hb_stackReturnItem() );
        PHB_ITEM pItem = hb_itemNew( NULL );
        hb_itemPutPtr( pItem, (QByteArray *) new QByteArray ( list[i] ) );
        hb_objSendMsg( pObject, "_POINTER", 1, pItem );
        hb_itemRelease( pItem );
        hb_arrayAddForward( pArray, pObject );
        hb_itemRelease( pObject );
      }
    }
    hb_itemReturnRelease(pArray);
  }
#endif
}

/*
virtual int count(QMimeData *mimeData)
*/
HB_FUNC_STATIC( QMACPASTEBOARDMIME_COUNT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,2,0))
  QMacPasteboardMime * obj = (QMacPasteboardMime *) _qt5xhb_itemGetPtrStackSelfItem();
  if( obj )
  {
    QMimeData * par1 = (QMimeData *) _qt5xhb_itemGetPtr(1);
    hb_retni( obj->count ( par1 ) );
  }
#endif
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEWFROM )
{
  PHB_ITEM self = hb_stackSelfItem();
  if( hb_pcount() == 1 && ISOBJECT(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else if( hb_pcount() == 1 && ISPOINTER(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_param(1, HB_IT_POINTER ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  hb_itemReturn( self );
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEWFROMOBJECT )
{
  HB_FUNC_EXEC( QMACPASTEBOARDMIME_NEWFROM );
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_NEWFROMPOINTER )
{
  HB_FUNC_EXEC( QMACPASTEBOARDMIME_NEWFROM );
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_SELFDESTRUCTION )
{
  hb_retl( (bool) hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) );
}

HB_FUNC_STATIC( QMACPASTEBOARDMIME_SETSELFDESTRUCTION )
{
  PHB_ITEM self = hb_stackSelfItem();
  if( hb_pcount() == 1 && ISLOG(1) )
  {
    PHB_ITEM des = hb_itemPutL( NULL, hb_parl(1) );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  hb_itemReturn( self );
}

#pragma ENDDUMP