* contrib/hbqt/qtcore/hbqt_bind.cpp
+ Implemented: requested by the group protocol - to handle
parent-child relations internally by hbQT leading not
to hold everything in scoped variables. All objects will
behave accordingly except QAction() which is never get a
parent accoring to Qt docs.
; NOTE: will explain this in detail in reply to the message
of this commit.
* contrib/hbqt/hbmk2_qt.hb
! Changed: hb_itemReturn() => hb_itemReturnRelease() to honor
Harbour variable scoping protocol. We need another method to
keep it alive inside new methodology.
+ contrib/hbqt/qtcore/hbqt_destroyer.cpp
+ contrib/hbqt/qtcore/hbqt_destroyer.h
+ Contains: HBQDestroyer() a generic class whose sole purpose
is to catch "destroyed()" signal of any QObject and then
forward it to new engine to delete harbour object.
* contrib/hbqt/qtcore/hbqt_bind.cpp
+ Added: "destroyed()" signal on QObject() derived classes.
* contrib/hbqt/qtcore/hbqt_misc.prg
+ Added: #define __HBQT_REVAMP__ then commented out.
Activated: destructor guarded against above define.
* contrib/hbqt/qtcore/hbqtcore.hbm
+ Added: new sources.
; NOTE: this implementation prevents double freeing of Qt objects
while keeping Harbour variable's scope protocol intact. So
if Qt deletes an object, Harbour object is also cleared
automatically. The same applies if Harbour variable goes
out of scope, Qt object is deleted, which is safe, because
Qt allows it.
Now no GPF on exit on any demo, including hbIDE, with
__HBQT_REVAMP__ enabled.
* contrib/hbqt/qtgui/qth/QCalendarWidget.qth
* contrib/hbqt/qtgui/qth/QCheckBox.qth
* contrib/hbqt/qtgui/qth/QCloseEvent.qth
* contrib/hbqt/qtgui/qth/QCommandLinkButton.qth
* contrib/hbqt/qtgui/qth/QCompleter.qth
* contrib/hbqt/qtgui/qth/QConicalGradient.qth
* contrib/hbqt/qtgui/qth/QDateEdit.qth
* contrib/hbqt/qtgui/qth/QDateTimeEdit.qth
* contrib/hbqt/qtgui/qth/QDeclarativeContext.qth
* contrib/hbqt/qtgui/qth/QDial.qth
* contrib/hbqt/qtgui/qth/QDialog.qth
* contrib/hbqt/qtgui/qth/QDockWidget.qth
* contrib/hbqt/qtgui/qth/QDoubleSpinBox.qth
* contrib/hbqt/qtgui/qth/QDrag.qth
* contrib/hbqt/qtgui/qth/QErrorMessage.qth
* contrib/hbqt/qtgui/qth/QFileSystemModel.qth
* contrib/hbqt/qtgui/qth/QFocusFrame.qth
* contrib/hbqt/qtgui/qth/QFontComboBox.qth
* contrib/hbqt/qtgui/qth/QFontMetrics.qth
* contrib/hbqt/qtgui/qth/QFontMetricsF.qth
* contrib/hbqt/qtgui/qth/QGroupBox.qth
* contrib/hbqt/qtgui/qth/QInputDialog.qth
* contrib/hbqt/qtgui/qth/QItemSelection.qth
* contrib/hbqt/qtgui/qth/QKeySequence.qth
* contrib/hbqt/qtgui/qth/QLCDNumber.qth
* contrib/hbqt/qtgui/qth/QListView.qth
* contrib/hbqt/qtgui/qth/QMatrix.qth
* contrib/hbqt/qtgui/qth/QMessageBox.qth
* contrib/hbqt/qtgui/qth/QMovie.qth
* contrib/hbqt/qtgui/qth/QPainterPath.qth
* contrib/hbqt/qtgui/qth/QPixmap.qth
* contrib/hbqt/qtgui/qth/QProgressBar.qth
* contrib/hbqt/qtgui/qth/QProgressDialog.qth
* contrib/hbqt/qtgui/qth/QRadioButton.qth
* contrib/hbqt/qtgui/qth/QSpacerItem.qth
! Fixed: constructors.
This has been a tidious process and I could have
broken something in the process, though, all demoes
and hbIDE is working fine. If you find some inconsistency,
please shout. Also if someone can overlook the .qth's
for remaining files yet needs the constructors reworked,
it will be a great help.
* contrib/hbide/hbqtoolbar.prg
* contrib/hbide/ideactions.prg
* contrib/hbide/ideeditor.prg
* contrib/hbide/idethemes.prg
! Changed: a little to pass correct parameters to methods
as per the changes in constructors.
; NOTE: now hbIDE neither throws any GPF on exit nor reports
"object destructure failure : reference to freed block"
* contrib/hbqt/qtgui/qth/HBQTableView.qth
* contrib/hbqt/qtgui/qth/QHeaderView.qth
* contrib/hbqt/qtgui/qth/QListWidgetItem.qth
* contrib/hbqt/qtgui/qth/QStatusBar.qth
* contrib/hbqt/qtgui/qth/QTextDocument.qth
* contrib/hbqt/qtgui/qth/QTreeWidgetItem.qth
! Fixed: constructors for few more classes.
Now contrib/hbxbp/demoxbp.prg shows up at least.
* contrib/hbqt/qtgui/qth/QApplication.qth
* contrib/hbqt/qtgui/qth/QColorDialog.qth
* contrib/hbqt/qtgui/qth/QDirModel.qth
* contrib/hbqt/qtgui/qth/QHBoxLayout.qth
* contrib/hbqt/qtgui/qth/QPageSetupDialog.qth
* contrib/hbqt/qtgui/qth/QScrollBar.qth
* contrib/hbqt/qtgui/qth/QTableView.qth
* contrib/hbqt/qtgui/qth/QVBoxLayout.qth
* contrib/hbqt/qtgui/qth/QWizard.qth
! Fixed: constructors which was basically wrong way to get a
class object. This became visible only when QPointer< QClass >
guard is eliminated which was hiding this wrong way.
* contrib/hbqt/hbmk2_qt.hb
* contrib/hbqt/qtcore/hbqt.h
+ contrib/hbqt/qtcore/hbqt_bind.cpp
+ contrib/hbqt/qtcore/hbqt_obj.prg
* contrib/hbqt/qtcore/hbqt_pointer.cpp
* contrib/hbqt/qtcore/hbqtcore.hbm
* contrib/hbqt/qtcore/hbqtcore.hbx
+ Implemented Przemek's draft concept with some changes.
This can be invoked by uncommenting #define __HBQT_REVAMP__
directive in hbqt.h and hbmk2_qt.hb and recompiling hbQT.
; NOTE: all demo tests in contrib/hbqt/tests/* are working ok with new
revamped engine, which, I hope will be matured with time, and
only if Przemek will revive his interest in this project.
The demos are working ok with a GPF on exit. I did not
tried hard to track but hopefully will be a minor issue.
This implementation is not taking use of QPointer<> guard
and is operational on pure pointers, it has discovered
a fundamental flaw in some of the .qth where constructors
were not adhering to primary rules. It may take me a while
to visit all the classes and make the correction. Today's
implementation has fixes for those classes which are used
in demo programs.
This commit became essential in the wake of divided thoughts
about having two implementations in parallel. This commit
shows the way that we do not need that, just few changes in
core engine will establish the solid foundation.
* contrib/hbqt/qtcore/hbqt_pointer.cpp
+ Added: HB_FUNC( SIGNAL2SLOT ) which simulates exactly Qt's way
of signal/slot mechanism. Now hbQT has yet another way to
mimic signal/slots.
+ contrib/hbqt/tests/signalslots.prg
+ Added: deno program to demonstrate Qt's way of signal/slot
affinity in Harbour.
NOTE: above contribution is made by Francessco Perrilo, thanks.
* harbour/config/postinst.hb
! remove old links before hb_FLinkSym() is called.
Without it old links were not overloaded and
I've just noticed that I have still active links
to old harbour shared library in my system.
* contrib/hbide/hbqtoolbar.prg
* contrib/hbide/ideactions.prg
* contrib/hbide/idebrowse.prg
* contrib/hbide/idedocks.prg
* contrib/hbide/idemisc.prg
! Streamlined: HBQToolbar class adding more methods and refining
others. All toolbars in hbIDE except the one, are now based
on HBQToolbar() class and probably it becomes candidate to be
transferred to hbQT after a bit of polishing.
* contrib/hbxbp/xbptoolbar.prg
! Fixed: one regression based on recent hbQT mem leak fixes.
* contrib/hbide/ideedit.prg
* Fixed: recursively attching self to some instance variable.
* Normalized: code.
* contrib/hbide/ideactions.prg
* contrib/hbide/idemisc.prg
* Fixed: some lost actions resulting after recent hbQT changes.
NOTE: more are left still, stay tuned.
* contrib/hbxbp/xbpfiledialog.prg
* Fixed: how :connect()/:disconnect() was applied.
NOTE: until a :disconnect() is performed on an object
which has an actice :connect(), it never goes
out-of-scope.
* harbour/src/vm/arrays.c
* allow to call hb_arrayId() with NULL parameter
* harbour/include/hbapiitm.h
* harbour/src/vm/itemapi.c
+ added internal HVM function hb_itemPutPtrRawGC() - it's
necessary for blocks allocated with hb_gcAllocRaw().
* harbour/src/vm/thread.c
! use hb_itemPutPtrRawGC() instead of hb_itemPutPtrGC()
It fixes internal errors (i.e. reported in build process)
after my previous commit.
* contrib/hbwin/win_reg.prg
* contrib/hbwin/tests/test_reg.prg
* added nRegSam (access mask) parameter into functions: win_regRead,
win_regWrite, win_regGet, win_regDelete, win_regQuery, win_regSet.
This parameter can be used in win32 applications, running under
win64 systems for access to 32-bit or 64-bit registry.
* contrib/hbqt/hbmk2_qt.hb
! Fix to last fix.
* contrib/hbqt/qtgui/qth/QListWidget.qth
* contrib/hbqt/qtgui/qth/QMainWindow.qth
+ Added: attach/detach/return_not_new tags.
[*D=n;A=n;R=n*]
* contrib/hbqt/tests/demoqt.prg
! On path to prevent memory leaks.
Please investigate the code changes and you will know
how many objects were been around without any mechanism
to free them. You can take help of Qt documentation.
; NOTE: currently demoqt.prg is the test bed for oncoming
GC related changes.
* contrib/hbide/hbqreportsmanager.prg
* contrib/hbide/hbqtoolbar.prg
* contrib/hbide/idebrowse.prg
* contrib/hbide/ideeditor.prg
* contrib/hbide/ideharbourhelp.prg
! On path to preparation for memory leakage.
; WARNING: hbIDE is not at stable stage present.
; I always wondered why memory consumption goes on increasing
with time application written with hbQT. Now I have the answer,
and hopefully in few coming days a great amount of them will be
covered.
* contrib/hbqt/hbmk2_qt.hb
+ Implemented: detach a returned object of a method where parent
do not retain the ownership of the child with itself. In that case
Harbour has to delete it explicitly. This can be activated with
[*R=1*] tag postfixing the method call in relevant .qth.
EXAMPLE: QToolBar():addAction( cText )
* contrib/hbqt/qtgui/qth/QMenu.qth
* contrib/hbqt/qtgui/qth/QMenuBar.qth
* contrib/hbqt/qtgui/qth/QToolBar.qth
+ Added: [*R=1*] tags whereever necessary.
; NOTE: I have tried with QAction() only to locate where it is
returned as a not-owned object. Please dig into Qt documentation
to find the other occurances. I know it is a tedious job, but
we have to do it anyway, which me alone cannot achieve.
* harbour/include/hbgtinfo.ch
+ added new HB_GTI_FONTATTRIBUTE value: HB_GTI_FONTA_CTRLCHARS
When used it forces using CTRL characters (from chr(0) to chr(31))
directly without translation to CP437 unicode values.
In windows some fonts need it to correctly display them.
* harbour/src/rtl/gtwvt/gtwvt.h
* harbour/src/rtl/gtwvt/gtwvt.c
+ added support for
hb_gtInfo( HB_GTI_FONTATTRIBUTE, HB_GTI_FONTA_CTRLCHARS )
* harbour/src/rtl/hbgtcore.c
! do not replace CTRL chars with '?' in HB_GTSELF_GETUC() method
* harbour/src/rtl/cdpapi.c
% use HB_CDP_ISUTF8( cdp ) macro instead of cdp == &s_utf8_codepage
It should eliminate unnecessary translations and speedup some
operations.
* harbour/include/hbstack.h
* harbour/src/vm/codebloc.c
* harbour/src/vm/estack.c
* harbour/src/vm/hvm.c
% split hb_stackLocalVariable( int * ) macro and function into
two different actions:
hb_stackLocalVariable( int ) // access/assign local var
hb_stackLocalVariableAt( int * ) // create reference to local var
* contrib/hbqt/qtcore/hbqt.h
* contrib/hbqt/qtcore/hbqt_pointer.cpp
- Removed: residual contructs pointing to "HB_U32 type" member of
all the important structure of HBQT plus the functions associated
with it. Strange point is that the bug was not showing up on Windows.
Thanks Francessco for dig-up.
* harbour/src/vm/classes.c
% small optimization in __CLSGetProperties() function
* harbour/src/rtl/tpersist.prg
! force linkin ARRAY() function when HBPersistent class is used
! use hb_ValToExp() instead of local ValToText() function which
didn't work correctly for memos and some other types
! fixed infinite loop in HBPersistent:LoadFromText() used with
empty text. The problem was also exploited by :LoadFromFile()
method if file does not exists or it's empty()
! fixed deserialization of strings containing "=" char inside
! fixed deserialization of strings containing "::"
! added support for decoding nested objects - the code was not
finished and this part was not implemented at all
+ added support for serialized text using ":=" assign operator
instead of "="
* use ":=" instead of "=" as assign operator in new serialized
text
+ ignore lines starting with "//" and added support for files
which do not start with OBJECT directive
* ignore pointer and codeblock items stored in instance variables
during serialization
; now HBPersistent class in Harbour should read serialized files
created in xHarbour with few exceptions:
- Harbour does not allow to serialize codeblocks
See "CODEBLOCK SERIALIZATION / DESERIALIZATION" in
doc/xhb-diff.txt for the reasons.
If Harbour application restores xHarbour HBPersistent files
with serialized codeblocks then RTE
Undefined function: HB_RESTOREBLOCK
is generated.
- xHarbour serialize pointer items as numeric items
saved in hexadecimal notation. Then restore them as numbers.
- HBPersistent does not support hash arrays - they are
serialized by default serialization code used by both
compilers to generate expressions.
In Harbour it's done by hb_valToExp() function and
in xHarbour it's ValToPrg() is used.
ValToPrg() does not create valid macrocompiler expressions
for arrays and objects so HBPersistent files created
by xHarbour are broken and cannot be correctly deserialized.
It happens if objects has hash arrays in instance variables
and these hash arrays contain normal arrays or object
If Harbour application restores such xHarbour HBPersistent
file then RTE "Syntax error: &" is generated.
; xHarbour encapsulates deserialization code inside TRY/CATCH/END
statement saving errors to trace.log file. Harbour generates RTE.
If programmer needs similar behavior then he should
call :LoadFromText() and :LoadFromFile() methods inside
BEGIN SEQUENCE [ / RECOVER ... ] / END SEQUENCE
statement.
; xHarbour reinitialize all or properties instance variables to
default state inside :LoadFromText() and :LoadFromFile() methods.
The 3-rd parameter in above method <lPropertiesOnly> allows to
chose which install variables should be reinitialized:
all (default) or properties only.
Harbour does not have such functionality.
If programmer needs it then he should reinitialize them himself.
It can be easy done be simple function.
Alternatively we can implement this functionality but in such
case I'd suggest to define three actions for such switch:
none (default), all, properties only.
; Harbour does not support 2-nd parameter <lIgnoreBadIVars> which
exist in xHarbour versions of HBPersistent:LoadFromText() and
HBPersistent:LoadFromFile():
If necessary we can implement it though it's usable only if we
want to ignore some wrong lines and process others.
; Warning: Neither Harbour nor xHarbour supports arrays and objects
with cyclic references in HBPersistent code - infinite
loop appears in such case.
; I've never used HBPersistent and the state of the previous
HBPersistent code in Harbour suggests that no one used it for
some serious jobs so I'm open for any opinions and suggestions
about it from xHarbour users.
* harbour/src/compiler/harbour.y
* generate line numbers before extended codeblocks - it gives
more debugger friendly code.
* harbour/src/compiler/harbour.yyh
* harbour/src/compiler/harbour.yyc
* regenerated (with bison 2.4.1)
* contrib/hbqt/qtwebkit/hbqtwebkit.hbm
* contrib/hbqt/hbqt_common.hbm
* INSTALL
+ added support for QT from Homebrew package manager. Probably
a better option than the official installer which is a) not
compatible with latest Xcode changes b) copies millions of
files into the system file structure with no easy uninstall
or upgrade option.
* contrib/hbqt/hbmk2_qt.hb
* contrib/hbqt/qtcore/hbqtcore.h
* contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp
* contrib/hbqt/qtgui/hbqtgui.h
- Removed: the usage of HBQT_TYPE_xxxx constants.
It was a hack to identify a few type of objects Qt had
not provided the mechanism to retrieve.
NOTE: there should be improvement in build speed of hbQT.
* contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp
- Added: deletion of child widget of HBQPlainTextEdit.
* contrib/hbqt/qtgui/hbqt_hbqsyntaxhighlighter.h
* contrib/hbqt/qtgui/qth/HBQSyntaxHighlighter.qth
+ Added: method hbSetEditor( QPlainTextEdit edit ).
This fixes issues where some of the components of hbIDE were
not working properly due to strict object inheritance checking.
* contrib/hbqt/qtcore/hbqt_hbqevents.cpp
* contrib/hbqt/qtcore/hbqt_hbqslots.cpp
* contrib/hbqt/qtcore/hbqt_misc.prg
* Optimizations.
* More VM protections.
* contrib/hbxbp/xbplistbox.prg
! Fixed: a nasty construct in :clear() method where slots were
being disconnected and connected again increasing the unnecessary
object destruction/creation.
* contrib/hbqt/tests/demoqt.prg
* contrib/hbqt/tests/testbrow.prg
! Minor guards.
; NOTE: all the hbQT related test programmes are working flawlessly.
hbIDE still reports "reference to freed block" error but
this is not due to hbQT, instead, the complex object
relationship of hbXBP/hbQT/hbIDE classes. This is only
visible when hbIDE is linked without :destroy() mechanism.
BUT no GPF whatsoever. With :destroy() calls hbIDE EXITS
normally.
* contrib/hbqt/qtcore/qth/*.qth
* contrib/hbqt/qtgui/qth/*.qth
* contrib/hbqt/qtnetwork/qth/*.qth
! Copyright year bump.
+ Formatting.
- Long coptyright notice to short one.
* contrib/hbqt/hbmk2_qt.hb
* Fixed: the objects derived from QObject but without a constructor
were conflickting somehow with the use of shared pointer.
Now any demo in hbqt/tests and hbxbp/tests does not through
error messages at EXIT. TESTBROW.PRG with #if 0 / #if 1
works flawlessly. However, in hbIDE these error messages still
exist if :destroy() is not employed, otherwise, neither error
messages nor GPF.
* contrib/hbide/idefunctions.prg
* contrib/hbide/ideharbourhelp.prg
* contrib/hbide/idemain.prg
* contrib/hbide/idemisc.prg
* contrib/hbide/ideshortcuts.prg
* Optimized: to avoid repeated QApplication() object creation
and destruction.
* contrib/hbqt/qtcore/hbqt_hbqslots.cpp
* contrib/hbqt/qtcore/hbqt_misc.prg
* contrib/hbqt/qtcore/hbqt_pointer.cpp
* Changed: the way :connect()/disConnect() could been
applied to an object. Now programmer cannot make
a mistake, controlling one more pitfall.
* contrib/hbqt/qtcore/qth/QUrl.qth
* contrib/hbqt/qtgui/qth/QListWidgetItem.qth
- Inherits = QObject
* contrib/hbqt/qtgui/qth/QWidget.qth
- PainEvent = YES
; NOTE: still "Reference to freed block" messages at EXIT
are unresolved and very much reproducable.