Welcome to the Project Developers' Table

Moderator: Rathinagiri

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

Re: Welcome to the Project Developers' Table

Post by Rathinagiri » Thu Aug 19, 2010 6:03 pm

Yes. We have to set the same fontname, fontsize and fontbold properties to the oFont before creating the oFontMetrics object.

Code: Select all


...
local oFont := QFont():New()
local oFM := nil
local nWidth := 0

oFont:SetFamily( ::FontName )
oFont:SetFontSize(::FontSize)
oFont:SetBold(::FontBold)
oFM := QFontMetrics():New(oFont)
nWidth := oFM:width(::Value)

I think this should work.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

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

Post by Rathinagiri » Thu Aug 19, 2010 6:04 pm

Please tell me, where can I find some samples of QT...
We have to ask Lord Google ;)

I had searched in Google with "QT Text Width" and I got this.

http://stackoverflow.com/questions/1337 ... idth-in-qt
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

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

Post by mol » Thu Aug 19, 2010 6:13 pm

rathinagiri wrote:Yes. We have to set the same fontname, fontsize and fontbold properties to the oFont before creating the oFontMetrics object.

Code: Select all


...
local oFont := QFont():New()
local oFM := nil
local nWidth := 0

oFont:SetFamily( ::FontName )
oFont:SetFontSize(::FontSize)
oFont:SetBold(::FontBold)
oFM := QFontMetrics():New(oFont)
nWidth := oFM:width(::Value)

I think this should work.
In meantime, I've realized it in the same way :D
I've updated source\label.prg

THX Rathi!

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

Post by mol » Fri Aug 20, 2010 7:51 am

I hate this state of my mind, when everything I try generates runtime error :(
I think so simple operation like this:

Code: Select all

			oImage = QPixmap():new()
			oImage:load(cValue)
			Self:setPixmap(oImage)
should work. But it won't :twisted:

I have no idea.

After searchinq:

I think it's because setPixmap function is signed as SLOT in QT doc.
Please tell me, how to call slot function...

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

Post by Rathinagiri » Fri Aug 20, 2010 8:09 am

Marek,

Can you show me the error log?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

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

Post by Rathinagiri » Fri Aug 20, 2010 8:14 am

Slot function example is textbox->setText()
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

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

Post by mol » Fri Aug 20, 2010 8:39 am

I'm uploading image class - it's not working...

I need to take a deep breath to work further.
Marek

User avatar
sudip
Posts: 1446
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India
Has thanked: 5 times
Been thanked: 1 time

Post by sudip » Fri Aug 20, 2010 9:15 am

Today I shall get some time to work on TextBox.

Sorry for my delay :(
With best regards,
Sudip

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

Post by Rathinagiri » Fri Aug 20, 2010 9:18 am

I have uploaded basic functional datepicker.

I have a peculiar problem. I could not compile my sample file from c:\hmg.4\svn\samples\datepick folder. However if I compile the same file in any other existing directory it works! I don't know why. :(
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

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

Post by mol » Fri Aug 20, 2010 10:39 am

rathinagiri wrote: I have a peculiar problem. I could not compile my sample file from c:\hmg.4\svn\samples\datepick folder. However if I compile the same file in any other existing directory it works! I don't know why. :(
I've reached the same problem with compiling my image\demo_1.prg
I don't know what's going on.

after some time

It works after copying hbmk.hbc file to new working directory

Post Reply