QT | QML | Load EMF file as button image

I am building a QT Quick application using QML in which I have an tool bar and tool bar buttons.
For these tool bar buttons I want to set source as an EMF file. (http://whatis.techtarget.com/fileformat/EMF-Enhanced-Windows-Metafile) (https://msdn.microsoft.com/en-us/library/ff548726%28VS.85%29.aspx?f=255&MSPPError=-2147217396)
But it seems that QML is not able to load the EMF file. Any idea if there anyway to get EMF file to be loaded as image source in QML?
Sample source code that I am trying:
ApplicationWindow {
    title: qsTr("Hello World")
    width: 640
    height: 480
    visible: true
    toolBar:ToolBar {
             RowLayout {
               anchors.fill: parent
               ToolButton {
                   iconSource: "open.emf"

               Item { Layout.fillWidth: true }

LVL 15
Karrtik IyerSoftware ArchitectAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

any image posted to screen needs to be converted to bitmap format since finally there is a bitblt call from memory dc to screen dc which has colours for each bit, hence is a bitmap.

if you take that in account, i wonder why you prefer to make the conversion from emf to bitmap at runtime and not simply once from .emf to .bmp file what all the libraries would support without any additional efforts.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Karrtik IyerSoftware ArchitectAuthor Commented:
I agree Sara, but our UI design team who provides us icon, images, etc.. have decided to give these in EMF format and they have suggested us not to convert it, if converted, it would be very straight forward, as I already agreed with you.
our UI design team who provides us icon, images, etc.. have decided to give these in EMF format and they have suggested us not to convert it
I had the same case with a third party design team at my current project. they wanted to give us icons, images and logos in photoshop format as this was their default output. their argumentation was that the pictures would look much better this way. but, actually, when displaying the images with normal windows gdi, all the advantages were lost. worse, if we would have done the conversion at runtime or with a different tool, the results would have been not acceptable cause the images were not optimized for bitmap format when doing it this way. any text in the images would look fuzzy and the colors cannot be mapped properly. so we insisted on getting bitmaps and all was good.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.