Welcome to the Project Developers' Table

Moderator: Rathinagiri

User avatar
dhaine_adp
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines
Been thanked: 2 times

Re: Welcome to the Project Developers' Table

Post by dhaine_adp » Wed Aug 18, 2010 4:31 am

I'm just learning QT step by step, basically from HBQT samples (complementing it with QT official reference).

So, sorry, I not 'master' QT

Please, take a look at HBQT demos in Harbour distribution. There are Grid and Browse implementations that can give you an idea about how to start.

There is no problem about try and error at this stage of development...
Hi Roberto,

Thanks indeed :D Looks likes it's getting more exciting. Well it's a bit confusing, that's all.... :)

Regards,

Danny
Regards,

Danny
Manila, Philippines

User avatar
Roberto Lopez
HMG Founder
Posts: 3980
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Post by Roberto Lopez » Wed Aug 18, 2010 10:27 pm

Hi Team!

Please, check the create() method of your controls for the following problems:

1. Avoid duplicated code: Do not write the code for properties, events and method again, Just invoke it as follows(ie):

if ValType (::nRow)!= 'U'; Self:Row:=::nRow;EndIf

2. Check which are the properties that your control can inherit from control class, and check it to make it work at control creation. ie, for EditBox:

if ValType (::cValue) != 'U' ; Self:Value := ::cValue ; EndIf
if ValType (::nRow) != 'U' ; Self:Row := ::nRow ; EndIf
if ValType (::nCol) != 'U' ; Self:Col := ::nCol ; EndIf
if ValType (::nWidth) != 'U' ; Self:Width := ::nWidth ; EndIf
if ValType (::nHeight) != 'U' ; Self:Height := ::nHeight ; EndIf
if ValType (::ScrollBars) != 'U' ; Self:ScrollBars := ::nScrollBars ; EndIf
if ValType (::cFontName) != 'U' ; Self:FontName := ::cFontName ; EndIf
if ValType (::nFontSize) != 'U' ; Self:FontSize := ::nFontSize ; EndIf
if ValType (::lBold) != 'U' ; Self:FontBold := ::lBold ; EndIf
if ValType (::lItalic) != 'U' ; Self:FontItalic := ::lItalic ; EndIf
if ValType (::lUnderline) != 'U' ; Self:FontUnderline := ::lUnderline ; EndIf
if ValType (::lStrikeout) != 'U' ; Self:FontStrikeOut := ::lStrikeout ; EndIf
if ValType (::cToolTip) != 'U' ; Self:ToolTip := ::cToolTip ; EndIf
if ValType (::lReadOnly) != 'U' ; Self:ReadOnly := ::lReadOnly ; EndIf
if ValType (::lTabStop) != 'U' ; Self:TabStop := ::lTabStop ; EndIf
if ValType (::bOnGotFocus) != 'U' ; Self:OnGotFocus := ::bOnGotFocus ; endif
if ValType (::bOnLostFocus) != 'U' ; Self:OnLostFocus := ::bOnLostFocus ; endif
if ValType (::aBackColor) != 'U' ; Self:backColor := ::aBackColor ; endif
if ValType (::aFontColor) != 'U' ; Self:FontColor := ::aFontColor ; endif
if ValType (::aDisabledFontColor) != 'U' ; Self:DisabledFontColor:= ::aDisabledFontColor ; endif
if ValType (::aDisabledBackColor) != 'U' ; Self:DisabledbackColor:= ::aDisabledBackColor ; endif
if ValType (::lVisible) != 'U' ; Self:Visible := ::lVisible ; else ; ::oQTObject:show() ; endif


Thanks!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3980
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Post by Roberto Lopez » Wed Aug 18, 2010 10:46 pm

Roberto Lopez wrote:Hi Team!

Please, check the create() method of your controls for the following problems:
<...>
And...

3. Do not forget to initialize font and events. They are needed for various shared properties. ie(for EditBox):

* Create QT Object and other initialization tasks

::oQTObject := QTextEdit():new( ::oParent:oQTObject )
::oFont := QFont():New()
::oQTObject:installEventFilter( ::s_events )

Thanks!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3980
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Post by Roberto Lopez » Thu Aug 19, 2010 12:52 am

Hi Team,

I've found a way to automatically create a Changelog file (using another svn client).

I've found the way to include the changes files list in the changelog generated, so is no required anymore that you manually paste such list in your commit.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
esgici
Posts: 4514
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 389 times
Been thanked: 111 times
Contact:

Post by esgici » Thu Aug 19, 2010 1:07 am

Roberto Lopez wrote:Hi Team,

I've found a way to automatically create a Changelog file (using another svn client).

I've found the way to include the changes files list in the changelog generated, so is no required anymore that you manually paste such list in your commit.
Very good news, thanks :)

We also have a way for notify forum members about changes (like Harbour).

May be a single post to forum.

Only a thought.

Best Regards

--

Esgici
Viva INTERNATIONAL HMG :D

User avatar
dhaine_adp
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines
Been thanked: 2 times

Post by dhaine_adp » Thu Aug 19, 2010 7:24 am

Hi Roberto,

I'll be implementing GRID from QAbstractItemView to support the images in header for GRID control. I'll reuse the existing Q...View if necessary but for the time being I'll start from this point. I'll post the code in three days perhaps not a complete work but a working sample.

As I pondering about the implementation, I was planning to extend the GRID to support something like this:

MASTER->CODE, ITEM->DESCRIPTION, ITEM->UNIT and freeze the column 1 & 2. It seems it is possible with QAbstractItemView.

Anyway I will not talk much about it until I get the code up and running. I'm sticking to our goal, to provide the backward compatibility. If what I have said can be included in few lines of code I'll do it otherwise I'll put it in TODO List.

It's just now that I'd be able to run a test file on this so I am still in the experimental stage. I hope that I can post the code as soon as possible. It seems I'm the only one whose less productive. LOL!

Regards,

Danny
Regards,

Danny
Manila, Philippines

User avatar
Rathinagiri
Posts: 5263
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 169 times
Been thanked: 172 times
Contact:

Post by Rathinagiri » Thu Aug 19, 2010 7:29 am

Grid?! Great Danny! Awaiting for your code.

As I am a beginner of QT and OOP, I had updated all the properties for frame control (except enabled and transparent) and uploaded the same. :)

Regarding 'enabled' property, it was not mentioned in hmg.ch, however it was already implemented in control.prg. So, shall we include in hmg.ch and all controls?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
mol
Posts: 3220
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 224 times
Been thanked: 125 times
Contact:

Post by mol » Thu Aug 19, 2010 8:20 am

I've tried to realize AutoSize property for label, but now, I don't know how to calculate text length with given fontname and fontsize.
My idea was to create sth like that:

Code: Select all

	oTextLayout := QTextLayout():new()
	oTextLayout:setFont(::oQTObject:Font())
	oTextLayout:setText(::cValue)
	nWidth := oTextLayout:maximumWidth() 
	Self:Width := nWidth
but I always get 0 as nWidth.
So, I place AutoSize to DOTO list.
Marek

User avatar
Rathinagiri
Posts: 5263
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 169 times
Been thanked: 172 times
Contact:

Post by Rathinagiri » Thu Aug 19, 2010 8:38 am

From the QTdoc:

QTextLayout::maximumWidth()

Warning: This function only returns a valid value after the layout has been done.

Therefore, had you tried beginLayout () and endLayout()?

Code: Select all

   oTextLayout := QTextLayout():new()
   oTextLayout:beginLayout()
   oTextLayout:setFont(::oQTObject:Font())
   oTextLayout:setText(::cValue)
   oTextLayout:endLayout()
   nWidth := oTextLayout:maximumWidth()
   Self:Width := nWidth
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
mol
Posts: 3220
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 224 times
Been thanked: 125 times
Contact:

Post by mol » Thu Aug 19, 2010 11:44 am

rathinagiri wrote:From the QTdoc:

QTextLayout::maximumWidth()

Warning: This function only returns a valid value after the layout has been done.

Therefore, had you tried beginLayout () and endLayout()?

Code: Select all

   oTextLayout := QTextLayout():new()
   oTextLayout:beginLayout()
   oTextLayout:setFont(::oQTObject:Font())
   oTextLayout:setText(::cValue)
   oTextLayout:endLayout()
   nWidth := oTextLayout:maximumWidth()
   Self:Width := nWidth
Yes, I've tried, but always got 0


I think, it's blind way... :(
Last edited by mol on Thu Aug 19, 2010 12:32 pm, edited 1 time in total.

Post Reply