Page 80 of 106

Re: Welcome to the Project Developers' Table

Posted: Fri Oct 22, 2010 12:45 am
by bedipritpal
Roberto Lopez wrote: ::qPainter:drawText_6( QRectF , cData , QTextOption )
[/code]

Is possible that the problem be in drawText() call regarding the new code that allows us avoid the 'method_n()' format ?
This is the sequence:

Code: Select all

   CASE 3
      DO CASE
      CASE hb_isNumeric( hb_pvalue( 1 ) ) .AND. hb_isNumeric( hb_pvalue( 2 ) ) .AND. hb_isChar( hb_pvalue( 3 ) )
         RETURN Qt_QPainter_drawText_4( ::pPtr, ... )
      CASE hb_isObject( hb_pvalue( 1 ) ) .AND. hb_isChar( hb_pvalue( 2 ) ) .AND. hb_isObject( hb_pvalue( 3 ) )
         RETURN Qt_QPainter_drawText_6( ::pPtr, ... )         //        above code's call should be reaching here 
                                                                                       //        I do not know what is happening at your end.
                                                                                       //        Check tracing in TQPainter.prg if you reach here.
      CASE hb_isObject( hb_pvalue( 1 ) ) .AND. hb_isNumeric( hb_pvalue( 2 ) ) .AND. hb_isChar( hb_pvalue( 3 ) )
         SWITCH __objGetClsName( hb_pvalue( 1 ) )
         CASE "QRECT"
            RETURN Qt_QPainter_drawText_3( ::pPtr, ... )
         CASE "QRECTF"
            RETURN Qt_QPainter_drawText_2( ::pPtr, ... )
         ENDSWITCH
      ENDCASE
      EXIT


/*
 * void drawText ( const QRectF & rectangle, const QString & text, const QTextOption & option = QTextOption() )
 */
HB_FUNC( QT_QPAINTER_DRAWTEXT_6 )
{
   QPainter * p = hbqt_par_QPainter( 1 );
   if( p )
   {
      void * pText;
      ( p )->drawText( *hbqt_par_QRectF( 2 ), hb_parstr_utf8( 3, &pText, NULL ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QTextOption( 4 ) : QTextOption() ) );
      hb_strfree( pText );
   }
}


Re: Welcome to the Project Developers' Table

Posted: Fri Oct 22, 2010 1:44 am
by Roberto Lopez
bedipritpal wrote:
Roberto Lopez wrote: ::qPainter:drawText_6( QRectF , cData , QTextOption )
[/code]

Is possible that the problem be in drawText() call regarding the new code that allows us avoid the 'method_n()' format ?
This is the sequence:
<...>
I've done some tracing and verified that the nAlignment value passed to QTextOption is correct, values passed to QRectF are correct and that Qt_QPainter_drawText_6 is effectively called.

Even so, alignment still not working.

I'll continue searching...

Re: Welcome to the Project Developers' Table

Posted: Fri Oct 22, 2010 7:59 am
by mrduck
Sorry Pritpal,
I was looking at the following line
bedipritpal wrote:

Code: Select all

      ( p )->drawText( *hbqt_par_QRectF( 2 ), hb_parstr_utf8( 3, &pText, NULL ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QTextOption( 4 ) : QTextOption() ) );
I see that HB_ISPOINTER is used... is it correct ? actually the calling code is

Code: Select all

CASE hb_isObject( hb_pvalue( 1 ) ) .AND. hb_isChar( hb_pvalue( 2 ) ) .AND. hb_isObject( hb_pvalue( 3 ) )
         RETURN Qt_QPainter_drawText_6( ::pPtr, ... )
Isn't the last parameter a OBJECT and not a POINTER ? This could explain why Roberto "defaults" to left-alignment, standard one... it is not used the one passed but created a default new one...

Re: Welcome to the Project Developers' Table

Posted: Fri Oct 22, 2010 8:24 am
by bedipritpal
mrduck wrote:Sorry Pritpal,
I was looking at the following line
bedipritpal wrote:

Code: Select all

      ( p )->drawText( *hbqt_par_QRectF( 2 ), hb_parstr_utf8( 3, &pText, NULL ), ( HB_ISPOINTER( 4 ) ? *hbqt_par_QTextOption( 4 ) : QTextOption() ) );
I see that HB_ISPOINTER is used... is it correct ? actually the calling code is

Code: Select all

CASE hb_isObject( hb_pvalue( 1 ) ) .AND. hb_isChar( hb_pvalue( 2 ) ) .AND. hb_isObject( hb_pvalue( 3 ) )
         RETURN Qt_QPainter_drawText_6( ::pPtr, ... )
Isn't the last parameter a OBJECT and not a POINTER ? This could explain why Roberto "defaults" to left-alignment, standard one... it is not used the one passed but created a default new one...
You have hit the bulls eye.
It just dd not come to my mind at all.
I have to revisit the generator.

Thanks.

Re: Welcome to the Project Developers' Table

Posted: Fri Oct 22, 2010 8:26 am
by bedipritpal
Hello Everybody

This commit might be useful for many:

2010-10-22 01:01 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbide/projectpropertiesex.ui
% Rearranged: tab names in accordance with new Project Management.

* contrib/hbide/hbide.hbp
! Loaded in hbIDE, added hbide.ch, and saved.

* contrib/hbide/idemain.prg
* contrib/hbide/idemisc.prg
* contrib/hbide/ideprojmanager.prg
+ Implemented: in-demand-since-begining feature to contain
anciallary files within the project tree but still keeping
compatibility with hbMK2. Also to have single project
file with all its contents intact, for GUI and command line
interface.

It is how it is achieved: a .hbp is loaded in HBP tab "as is"
except stripping the header part which is readded when the
project is saved. The header part is comprised of :
#
# $Id$
#

-3rd=hbide_* contents.

Rest whole of the on-disk contents of .hbp are made available
for editing. When a source is added via Add button, it is checked
if it is a compilable source. If not then "-3rd=file=" + filename
is added at the bottom.

Compilable sources are recognized by extention:
".c,.cpp,.prg,.hbs,.rc,.res,.hbm,.hbc,.qrc,.ui"
If any is missing, please shout.
TODO: user defined list of extentions for this purpose.

The project tree is now more organized and is listed sorted
on extention and filename. User can easily locate the source
of interest and click to bring it into the editor.

Please test extensively, I might have left new bugs for sure.

Re: Welcome to the Project Developers' Table

Posted: Fri Oct 22, 2010 8:43 am
by bedipritpal
Hi

Please update HMG binaries per this ChangeLog:

2010-10-22 01:39 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtcore/g/HBQString.cpp
* contrib/hbqt/qtcore/g/QAbstractItemModel.cpp
* contrib/hbqt/qtcore/g/QAbstractListModel.cpp
* contrib/hbqt/qtcore/g/QAbstractTableModel.cpp
* contrib/hbqt/qtcore/g/QByteArray.cpp
* contrib/hbqt/qtcore/g/QSettings.cpp
* contrib/hbqt/qtcore/g/QUrl.cpp
* contrib/hbqt/qtgui/g/HBQAbstractItemModel.cpp
* contrib/hbqt/qtgui/g/QComboBox.cpp
* contrib/hbqt/qtgui/g/QCompleter.cpp
* contrib/hbqt/qtgui/g/QDirModel.cpp
* contrib/hbqt/qtgui/g/QGraphicsItem.cpp
* contrib/hbqt/qtgui/g/QGraphicsLayoutItem.cpp
* contrib/hbqt/qtgui/g/QGraphicsScene.cpp
* contrib/hbqt/qtgui/g/QGraphicsView.cpp
* contrib/hbqt/qtgui/g/QIcon.cpp
* contrib/hbqt/qtgui/g/QImage.cpp
* contrib/hbqt/qtgui/g/QPainter.cpp
* contrib/hbqt/qtgui/g/QPainterPath.cpp
* contrib/hbqt/qtgui/g/QPixmap.cpp
* contrib/hbqt/qtgui/g/QStandardItemModel.cpp
* contrib/hbqt/qtgui/g/QStringListModel.cpp
* contrib/hbqt/qtgui/g/QTextDocument.cpp
* contrib/hbqt/qtnetwork/g/QNetworkRequest.cpp
* contrib/hbqt/qtwebkit/g/QWebFrame.cpp
* contrib/hbqt/qtwebkit/g/QWebView.cpp
* Re-generated: HB_ISPOINTER => HB_ISOBJECT.

* contrib/hbqt/utils/hbqtgen.prg
! Fixed: for HB_ISPOINTER => HB_ISOBJECT in C++ code.

Re: Welcome to the Project Developers' Table

Posted: Fri Oct 22, 2010 1:11 pm
by Roberto Lopez
bedipritpal wrote:Hi

Please update HMG binaries per this ChangeLog:
<...>
I'll do it ASAP. All is working fine now.

A little side note:

In the last two problems we reported to you (clipboard and print alignment) your first answer was that the problem come from us.

Since we are learning about QT/HBQT is reasonable that you think in such way.

Moreover, please consider that prior to report a problem to you, usually, we explore all possibilities and make all tests we can to assure that it's not our mistake.

In the case of print class, it was working perfectly prior to conversion, so, it was obvious that the problem was related with that, even so, I've checked that all parameters were correct prior to report the issue.

Of course, we do mistakes, but, please consider that sometimes the problems comes from HBQT too.

Re: Welcome to the Project Developers' Table

Posted: Fri Oct 22, 2010 2:33 pm
by Roberto Lopez
2010-10-22 11:35:00 UTC-0300 Roberto Lopez (<mail.box.hmg@gmail.com>)
* source/grid.prg
* source/listbox.prg
* source/window.prg
! Fixed more references to hb_q*:from( pPointer ) to q*FromPointer( pPointer ).
Contributed by Francesco.

Re: Welcome to the Project Developers' Table

Posted: Fri Oct 22, 2010 3:12 pm
by Roberto Lopez
2010-10-22 12:15:00 UTC-0300 Roberto Lopez (<mail.box.hmg@gmail.com>)
- hbct.hbc
* not required with current binaries anymore.

Re: Welcome to the Project Developers' Table

Posted: Fri Oct 22, 2010 3:58 pm
by bedipritpal
Roberto Lopez wrote: In the last two problems we reported to you (clipboard and print alignment) your first answer was that the problem come from us.
Absolutely WRONG.

I never told that it is YOU who are making mistakes.
I was exploring what has caused these errors, so what I suggested
was in that direction. It is obivious because I have never build any
of HMG's demos. So to reach to a conclusion I asked for those
checkpoints.

hbQT is in development stage and will remain for some time more.
So if you feel I hurt your sentiments, so sorry.
I pull myself out of the forum for the sake of not make any noises.