Qt: Alternative to qgraphicsdropshadoweffect - performance

Is there a way to create shadow like qgraphicsdropshadoweffect? Because the qgraphicsdropshadoweffect have great impact on PC performance. I tried set boarder radius (stylesheet) but it doesnt look good. Im creating a multiple buttons on a stackwidget and each of it has qgraphicsdropshadoweffect like you guys see on a POS (especially on food). Im using qt 4.7.3.
Edit: Or perhaps a stylesheet that looks like it. But in qt4.7 I cannot use css3. Upgrading to qt 5.0 is not advisable in our situation.

Related

pango_cairo_layout_path method does not respect kerning

I'm using pango library to do some text layout and cairo backend for rendering. It seems to me that the pango_cairo_layout_path method does not respect kerning.
I'm using c# bindings for pango and cairo that are provided with the gtk# project. Also i'm using the pango-cairo runtimes that also provided with gtk# project.
Here is an image demonstrating the problem (Font: Arial)
First row is from Inkscape rendering and second row from pango-cairo
Is there any known bug in pango/cairo?... or i'm doing something wrong
Do you know any work around...
Thanks in advance
It seems that pango-cairo backend in Windows by default uses the Win32 font type. With this type I had problems with kerning.
When I changed font type to be freetype everything worked as should.
In order to change font type please use:
PangoCairoFontMap * pango_cairo_font_map_new_for_font_type(cairo_font_type_t fonttype);
And
pango_cairo_font_map_set_default (PangoCairoFontMap *fontmap);
More info here: https://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html

KendoUI web custom theme

I am using KendoUI web widgets in my enterprise app. I need to create/customize a Theme as our corporate branding. After reading the docs, I realized that there is a tool called ThemeBuilder for this purpose available here http://demos.kendoui.com/themebuilder/web.html
Now I need to understand the logic behind the color options this tool (ThemeBuilder) shows me. All the Themes are based on 4 primary colors as shown in the selection options. However, when i try to modify/customize any theme, I found that there are more to it? How the ThemeBuilder is calculating all other colors besides the 4 Theme colors?
If I need to create my own corporate theme with 4 primary colors, how do I pick rest of the colors as shown in ThemeBuilder?
On the second note, ThemeBuilder can generate css and less. Is there a way to generate Scss as we are using scss in our organization?
Does Telerik provide scss version of their source styles. I know they provide css and less in their source directory. But converting them to scss looks like a nightmare to me!
Appreciate your help.
Sam
I have to manually convert less into scss.
I have variablized their stuff make it compatible with org's themes and colors.

WP7 - Not picking up embedded fonts

I have been trying to use some custom fonts within my WP7 app.
I followed the example as per http://www.jeffblankenburg.com/2010/10/24/31-days-of-windows-phone-day-24-embedding-fonts/ but in my project it simply will not pick up the custom font.
I have downloaded the sample project in this example and this one does work okay.
So, I have now used the same font used in there, and included in my project. I have ensured that the properties on the file are identical (Build Action = 'Content' and Copy To Output Directory = "Always")
I have used in my XAML in exactly the same way i.e.
FontFamily="Fonts/DigitalDream.ttf#Digital Dream" FontSize="24"
But to no avail. The custom font is just ignored. Is there something that I am missing, or a setting .. anything that would allow this to work in one project, but not another?
I have discovered that it will work if my XAML page is defined at the root level, i.e. immediately under the project, but in my case I have it in a 'Views' folder.
My understanding was that
FontFamily="/Fonts/DigitalDream.ttf#Digital Dream" FontSize="24"
should start at the root folder of the project?
thanks
Custom fonts can be a little tricky. I spent several hours once trying to embed an .otf font only to find that it just didn't seem to be doable.
You're on the right track, though. A .ttf font should be embedable. It's hard to get the right combination of paths and filenames to make the font work, though.
The easiest way I've found to handle some of these more difficult "magic string" type of situations in XAML is to let Expression Blend do the heavy lifting.
Here's a blog post about using Blend to embed fonts. The nice thing about using Blend is that it gives you some visual indications that things are set up correctly--i.e. you can see the font you want in the font selection menu. This is what finally clued me in on the .otf issue. I couldn't see the font in Blend.
And here's an example of a custom font that I've used in one of my apps:
<TextBlock Name="MyTextblock"
FontFamily="/MyAppName;component/fonts/Fonts.zip#Segoe UI Mono">
That's FontFamily URI is a pain to get right. I'm pretty sure that's your problem.
I was actually having the same problem. I followed everything to the dot and still I wasn't able to embed one particular font. So I created a new project and tried embedding the font there. Still no luck. I then tried embedding some other font. And lo and behold, as soon as I typed the FontFamily attribute, I could see that it had embedded. This was particularly odd since I didn't have to change any properties of the font.
I opened the project in Blend and clicked on the font property box to the right. It took a few seconds and then it embedded the font I was having problems with in the first place.

Monodroid Custom UI controls

I want to know where I can get access to the NinePatch images specifically for Monodroid. I want to change the default coloring from blue to orange (if I was doing this in Java it would already be orange).
All I need is to change an edittext so that it's default colors are different. I have seen
http://www.androidworks.com/changing-the-android-edittext-ui-widget
which is really helpful but only as far as vanilla Android is concerned. I tried following the instructions, but I found the standard orange java images, not the Mono ones, which are blue.
Minimum framework is 2.2. I know that I am getting the java images because when I go to C:\Android\android-sdk\platforms there is no android-2.2 folder.
I'm not really sure what you are referring to. Mono for Android does not ship any NinePatch images. Mono for Android simply provides a thin binding over the Java API, it does not do anything custom.
Maybe it is triggered by changing your Android target framework?
I found my answer - and thank goodnesss it did not involve changing the 9Patches!
You can make an xml in the drawable folder which describes your button, textbox, etc. and make a selector with a solid tag, pressed event, etc. (http://developer.android.com/guide/topics/resources/drawable-resource.html)
Then you can set up the colors as a constant set in the Values folder and boom! Solution!

How to render with yafaray on mac osx

I've installed wings 3d on mac osx and I'm loving it. The problem is I can't do any fancy renderings. I've downloaded and installed YafaRay-0.1.0.305-OSXintel10.5 and I can't seem to get it to work.
The wings3d manual states that on mac os you export the xml file from wings 3d, but you make the rendering from Terminal, calling yafaray with the path to the generated xml as an argument.
I expected to find yafray or yafaray using locate, but I couldn't. I found yafaray-xml in /usr/local/bin
Just for testing I exported a cube in a file called box.xml
Initally I got a loads of scene tag related errors:
warning: expected </scene> tag!
Bus error
Then I removed the tag from the xml and tried again, and I got
?m?setting up scene...specify a camera!!
Anyone know how to render with yafaray from terminal on macosx ? Or how to setup a ray tracer for wings 3d on mac osx ?
Got it working now!
yafaray is a rewritten version of yafray and the xml structure is different, so wings3d is outputting the wrong xml.
I found an xml structure that worked here. I just adapted the mesh node to one of my own meshes and I got a render from terminal.
Also if anyone is interested in the official specs here they are.
The handy user guide can be found here.
I tried using blender and blender 248.1 keeps crashing when I select the yafaray xml script from the render menu. blender 245.15 on the other hand crashed a few times first, but now I can render without any crashes. The only glitch is that after each render the ui freezez, so I need to CMD+Tab to another app and back to get around that.
Hope this might help anyone else having similar issues.

Resources