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)
Moderator: Rathinagiri
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)
We have to ask Lord GooglePlease tell me, where can I find some samples of QT...
In meantime, I've realized it in the same wayrathinagiri wrote:Yes. We have to set the same fontname, fontsize and fontbold properties to the oFont before creating the oFontMetrics object.
I think this should work.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)
Code: Select all
oImage = QPixmap():new()
oImage:load(cValue)
Self:setPixmap(oImage)
I've reached the same problem with compiling my image\demo_1.prgrathinagiri 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.