Page 5 of 106
Re: Welcome to the Project Developers' Table
Posted: Thu Aug 19, 2010 6:03 pm
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.
Re: Welcome to the Project Developers' Table
Posted: Thu Aug 19, 2010 6:04 pm
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
Re: Welcome to the Project Developers' Table
Posted: Thu Aug 19, 2010 6:13 pm
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
I've updated source\label.prg
THX Rathi!
Re: Welcome to the Project Developers' Table
Posted: Fri Aug 20, 2010 7:51 am
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
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...
Re: Welcome to the Project Developers' Table
Posted: Fri Aug 20, 2010 8:09 am
by Rathinagiri
Marek,
Can you show me the error log?
Re: Welcome to the Project Developers' Table
Posted: Fri Aug 20, 2010 8:14 am
by Rathinagiri
Slot function example is textbox->setText()
Re: Welcome to the Project Developers' Table
Posted: Fri Aug 20, 2010 8:39 am
by mol
I'm uploading image class - it's not working...
I need to take a deep breath to work further.
Marek
Re: Welcome to the Project Developers' Table
Posted: Fri Aug 20, 2010 9:15 am
by sudip
Today I shall get some time to work on TextBox.
Sorry for my delay
Re: Welcome to the Project Developers' Table
Posted: Fri Aug 20, 2010 9:18 am
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.
Re: Welcome to the Project Developers' Table
Posted: Fri Aug 20, 2010 10:39 am
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