2026-05-29 21:52 UTC-0700 Pritpal Bedi (bedipritpal at hotmail.com)(r485)

32 views
Skip to first unread message

Pritpal Bedi

unread,
May 30, 2026, 1:41:25 AM (9 days ago) May 30
to QtContribs
2026-05-29 21:52 UTC-0700 Pritpal Bedi (bedipritpal at hotmail.com)(r485)
  * hbide/misc.prg
    + Added: can open files in the editor of type .hrb and .o also.
  * hbqt/qtcore/qth/QProcess.qth
    + Added: some more methods.
  * hbqt/hbqtgui.ch
    + Added: QProcess_* defines.
  * hbqt/qtgui/qth/QAbstractScrollArea.qth
  * hbqt/qtgui/qth/QAction.qth
  * hbqt/qtgui/qth/QScreen.qth
    + Added: more methods.  
  * hbqtwidgets/alert.prg
  * hbqtwidgets/hbqtbrowse.prg
  * hbqtwidgets/hbqtwidgets.hbp
  * hbqtwidgets/hbqtwidgets.qrc
  + hbqtwidgets/resources/aa-collapse.png
  + hbqtwidgets/resources/approved-01.png
  + hbqtwidgets/resources/closetab-02.png
  + hbqtwidgets/resources/compliance-01.png
  + hbqtwidgets/resources/compliance-02.png
  + hbqtwidgets/resources/configuration.png
  + hbqtwidgets/resources/dashboard-3.png
  + hbqtwidgets/resources/dashboard-4.png
  + hbqtwidgets/resources/data-2.png
  + hbqtwidgets/resources/data.png
  + hbqtwidgets/resources/devices-01.png
  + hbqtwidgets/resources/devices-02.png
  + hbqtwidgets/resources/duplicate-01.png
  + hbqtwidgets/resources/folder.png
  + hbqtwidgets/resources/go-service.png
  + hbqtwidgets/resources/lock-02.png
  + hbqtwidgets/resources/out-service.png
  + hbqtwidgets/resources/pause-01.png
  + hbqtwidgets/resources/power-1.png
  + hbqtwidgets/resources/push-folder-2.png
  + hbqtwidgets/resources/push-folder.png
  + hbqtwidgets/resources/reboot2.png
  + hbqtwidgets/resources/refresh-01.png
  + hbqtwidgets/resources/refresh-reload.png
  + hbqtwidgets/resources/reload-01.png
  + hbqtwidgets/resources/reload-02.png
  + hbqtwidgets/resources/restart-1.png
  + hbqtwidgets/resources/stop-01.png
  + hbqtwidgets/resources/table-04.png
  + hbqtwidgets/resources/ticket-add.png
  + hbqtwidgets/resources/tools-5.png
  + hbqtwidgets/resources/unlock-01.png
  + hbqtwidgets/resources/unlock-02.png
  + hbqtwidgets/resources/upgrade-1.png
  + hbqtwidgets/resources/upgrade.png

alex;

unread,
May 30, 2026, 5:49:08 AM (9 days ago) May 30
to QtContribs
Hi Pritpal, I think I did something wrong.


суббота, 30 мая 2026 г. в 08:41:25 UTC+3, Pritpal Bedi:
Screenshot 2026-05-30 124843.png

Pritpal Bedi

unread,
May 30, 2026, 4:49:46 PM (9 days ago) May 30
to QtContribs
Oops I did not updated in .ch. 
Actually, I have lost track of hbqt commits. Refreshing myself.
But I build many big applications in production during last 5 years.

Thanks for the pointer.

Pritpal Bedi
a student of software analysis & concepts

Zoran Sibinovic

unread,
Jun 3, 2026, 5:37:00 AM (5 days ago) Jun 3
to QtContribs
Hi Pritpal,
I compiled this revision with Qt 5.8.0 but cannot with Qt 5.5.1 due missed functions alerts.
I have not changed anything in the building from rev.484 with which it works.
The log is in the attachment.
hbqt551.log
Message has been deleted

Zoran Sibinovic

unread,
Jun 3, 2026, 1:25:46 PM (5 days ago) Jun 3
to QtContribs
I asked AI and it says:

To make QAction.qth in r485 compatible with Qt 5.5.1, you must keep the garbage collector macro __HB_RETPTRGC__ intact but explicitly wrap the string extraction in QString::fromUtf8().
Using hbqt_ret() or removing __HB_RETPTRGC__ breaks Harbour's garbage collection system in older Qt setups. Explicitly casting to QString::fromUtf8 ensures that both Qt 5.5.1 and Qt 5.8.0 can resolve the string parameter perfectly without template ambiguity.

Change in the QAction.qth only this:
else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
{
       void * pText01 = NULL;
       // FIX: Wrap the raw char pointer in QString::fromUtf8 inside the macro
      __HB_RETPTRGC__( new QAction( QString::fromUtf8( hb_parstr_utf8( 1, &pText01, NULL ) ) ) );
       hb_strfree( pText01 );
}
Why This Specific Fix Works
- Preserves Harbour GC: __HB_RETPTRGC__ must be retained so Harbour's automatic memory management tracks this QAction instance.
- Enforces Explicit Construction: Older compilers or settings used with Qt 5.5.1 sometimes lose track of implicit conversion sequences when nested deeply inside complex Harbour macros. Forcing a QString object resolves this ambiguity instantly.

not tried yet, just a clue
Zoran



On Wednesday, June 3, 2026 at 7:24:05 PM UTC+2 Zoran Sibinovic wrote:
I asked AI and it says:

To make QAction.qth in r485 compatible with Qt 5.5.1, you must keep the garbage collector macro __HB_RETPTRGC__ intact but explicitly wrap the string extraction in QString::fromUtf8().
Using hbqt_ret() or removing __HB_RETPTRGC__ breaks Harbour's garbage collection system in older Qt setups. Explicitly casting to QString::fromUtf8 ensures that both Qt 5.5.1 and Qt 5.8.0 can resolve the string parameter perfectly without template ambiguity.

Change in the QAction.qth only this:
else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
{
       void * pText01 = NULL;
       // FIX: Wrap the raw char pointer in QString::fromUtf8 inside the macro
      __HB_RETPTRGC__( new QAction( QString::fromUtf8( hb_parstr_utf8( 1, &pText01, NULL ) ) ) );
       hb_strfree( pText01 );
}
not tried yet, just a clue
Zoran

  

Pritpal Bedi

unread,
Jun 3, 2026, 5:00:12 PM (5 days ago) Jun 3
to QtContribs
Hi

I do not look at 5.5 anymore. So you need to jump to 5.8. Sorry but I have very limited time for HbQt. 

Pritpal Bedi



Zoran Sibinovic

unread,
Jun 4, 2026, 3:52:14 AM (4 days ago) Jun 4
to QtContribs
Hi Pritpal,
I understand you completely :) 
I followed qtcontribs and Qt versions all the way and stuck on Qt 5.5 due the 
Unrecoverable error 6005: Exception error: Exception Code:C0000005 ACCESS_VIOLATION  error (topic). 
All my apps use hbqtui to load ui files and the composite.prg as an basic example for menues and emerging dialogs who holds gets and browse objects.
I dont know the number of as that face this problem but my users complained about the crashes in their everyday usage after i introduced the newer  Qt versions (5.6, 5.7, 5.8 ...) and, since I was not been able to handle the error, I remain at this version of Qt.
Additionally, now, the latest revison that compiles is r484. So stuck again :).
If the above access violation error can be be fixed I will be very happy, the same moment,  to jump the newer version.

Best regards
Zoran

Francesco Perillo

unread,
Jun 4, 2026, 6:05:36 AM (4 days ago) Jun 4
to qtcon...@googlegroups.com
There is something I can't understand....

I'm using Qt5.5.0 and Qt Assistant tells me that QAction is this:

QAction
(QObject * parent)

QAction(const QString & text, QObject * parent)

QAction(const QIcon & icon, const QString & text, QObject * parent)

It seems that since 5.7 QAction changed to

QAction(QObject *parent = nullptr)

QAction(const QString &text, QObject *parent = nullptr)

QAction(const QIcon &icon, const QString &text, QObject *parent = nullptr)
Note that now parent can be null

The code you posted is
else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
{
       void * pText01 = NULL;
       // FIX: Wrap the raw char pointer in QString::fromUtf8 inside the macro
      __HB_RETPTRGC__( new QAction( QString::fromUtf8( hb_parstr_utf8( 1, &pText01, NULL ) ) ) );
       hb_strfree( pText01 );
}


and the AI was "correct" saying that adding QString gives more clues to the compiler, but it hasn't been necessary for years...

the problem is that now QAction is called with ONE parameter, a string, something you can do from 5.7 but you can't do in 5.5 and 5.6 where parent was mandatory

This is the problem the compiler was reporting to you.

Probably a #if / #endif will be enough.

This is one of the reasons I "freeeze" a harbour/c compiler/lib version kit and do not upgrade. My hbQt version is old, the programs using it very few, users don't get any error (despite a 5.5.0 release) and I don't feel the urgency to upgrade and face other problems.

About your crashes, please check carefully that users don't have DLL from different Qt versions

Francesco
PS: I didn't look at the new Pritpal commit, just the few lines you posted.


--
You received this message because you are subscribed to the Google Groups "QtContribs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qtcontribs+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/qtcontribs/85238364-cb49-40c4-9cfa-c20852325806n%40googlegroups.com.

Francesco Perillo

unread,
Jun 4, 2026, 9:28:54 AM (4 days ago) Jun 4
to qtcon...@googlegroups.com
Once correctly understood which version added the change, it is possible to solve with a
#if QT_VERSION >= 0x050700
else if( hb_pcount() == 1 && HB_ISCHAR( 1 ) )
{
       void * pText01 = NULL;
       // FIX: Wrap the raw char pointer in QString::fromUtf8 inside the macro
      __HB_RETPTRGC__( new QAction( QString::fromUtf8( hb_parstr_utf8( 1, &pText01, NULL ) ) ) );
       hb_strfree( pText01 );
}

#endif

also recovering the old lines of code

Zoran Sibinovic

unread,
Jun 4, 2026, 12:37:43 PM (4 days ago) Jun 4
to QtContribs
Hi Francesco,
no, as soon is out a new harbour and qtcontribs revision I compile and  deliver them with the new harbour-32.dll that is the only thing that changes, the Qt environment necessities does not change since they are always the same from the Qt 5.5.1.
Regarding the code I wrote I have not tried yet but maybe is not the only adaptation to make. I will let know If there is some success.

Anyway I will persistently try to get the clue for the solution of the ACCESS VIOLATION problem. When it will be solved I will move to Qt 5.8. and later I hope forward
Pritpal is right on the other hand. There is no point to mantain and adapt qtcontribs for Qt versions before Qt 5.6-7 that changes the whole game.

Best regards 

Francesco Perillo

unread,
Jun 4, 2026, 4:28:16 PM (4 days ago) Jun 4
to qtcon...@googlegroups.com
I did a quick look at the repository and I think that the code I posted here should work, please try to add the #if.... /#endif

Francesco Perillo

unread,
Jun 4, 2026, 4:32:38 PM (4 days ago) Jun 4
to qtcon...@googlegroups.com
Unfortunately hbQt is a big project composed from several parts: a layer to interface with Qt and a pletora of programs and libraries, the get system. hbdbu, hbide, etc.

I strongly believe that the interface layer (the core of the lib)  should be a separate project from the "user-facing" code.


Reply all
Reply to author
Forward
0 new messages