Welcome to the Project Developers' Table

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Welcome to the Project Developers' Table

Post by Rathinagiri »

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: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Welcome to the Project Developers' Table

Post by Rathinagiri »

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: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Welcome to the Project Developers' Table

Post by mol »

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: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Welcome to the Project Developers' Table

Post by mol »

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: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Welcome to the Project Developers' Table

Post by Rathinagiri »

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: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Welcome to the Project Developers' Table

Post by Rathinagiri »

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: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Welcome to the Project Developers' Table

Post by mol »

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

I need to take a deep breath to work further.
Marek
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Welcome to the Project Developers' Table

Post by sudip »

Today I shall get some time to work on TextBox.

Sorry for my delay :(
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Welcome to the Project Developers' Table

Post by Rathinagiri »

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: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Welcome to the Project Developers' Table

Post by mol »

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