Friday, March 11, 2016

Vim Tips (2016 Edition)

This entry is all about my favorite text editor: vim. Every year it seems I'm learning something new about it and I wanted to put all of my top vim features into one place so they are easily located.

Number 3: Replace ^M's in GVim

I don't much care for GVim's weird combination of mouse interaction and vim editing. It really complicates the simplicity of vim. However I prefer GVim to Notepad++, notepad, or any other text editors because it is still more simple and memory efficient. In a pinch I'll open it up to modify a file quickly.

One of my big items in years past has been getting rid of ^M's in files (see the following article):

http://www.tech-recipes.com/rx/150/remove-m-characters-at-end-of-lines-in-vi/

However, this method doesn't work out of the box in GVim for some reason. Therefore there is another solution: use # to select ^M characters.

1) Find a ^M in your file that is easily navigated to.
2) Press the # key while in command mode.
3) At this point the ^M's in the file should be highlighted.
4) Press the colon key to type in a command.
5) The command entered should look like this:

              :1,$ s//

6) At this point all of your selected items should be gone.

Number 2: VsVim is Your Ticket to Great Vim Editing in Visual Studio

Most of my day is spent editing in Visual Studio. Visual Studio has the best debugger of any IDE (in my opinion). It feels like the industry standard. It's got awesome tools for viewing threads, breaking on exceptions, etc. It's so smooth. The only thing it was lacking was Vim- until a coworker recommended a plugin called VsVim:

https://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329

This is as close to real Vim as it gets! All of the key bindings I've tried work. The only thing I found that didn't work was the regular expression find/replace. That is easily accomplished through the Find/Replace dialog so it's no big deal. This is a great plugin that doesn't hurt Visual Studio's performance.

Number 1: Insert the Current File Name

When it comes to bulk editing headers it's nice to be able to just come up with a macro and run it. With Vim it's easy:

1) Go into edit mode.
2) Hold Ctrl, press the "r" key. (at this point a quote shows up)
3) Release Ctrl key.
4) Press the % key.

At this point the name of your file is inserted. It's that easy!

Zombie Port Blocks

Recently I had the privilege of trying to debug a highly distributed system- there were two client processes that end up spawning other processes. Let's call the two client's Process A and Process B. While debugging in Visual Studio each of the processes crashed.

Subsequent times debugging the server/clients would outright fail! It was pretty bad. After some quick googling around, I found this stack overflow question:

http://stackoverflow.com/questions/8688949/how-to-close-tcp-and-udp-ports-via-windows-command-line

Yeah, the accepted answer isn't the right one. Check the steps listed on the most popular answer. Here's what you do:

> netstat -a -n -o

That will print out all of the processes that have opened ports. For me it showed that port 9001 (Process A) and 9002 (Process B) were open. Here is the caveat: the PID for each of those processes listed from netstat did not exist! The task manager did not show them.

What happened was that Process A and Process B both launched more processes before they crashed- this caused Windows to hold onto the ports until the processes completed. The way I solved my issue was finding the spawned processes and killing those. That ended up finishing Process A and Process B.

See this stack overflow question for more info:

http://stackoverflow.com/questions/15216881/pid-exists-in-netstat-but-does-not-exist-in-task-manager


Saturday, May 2, 2015

C# Building a Dictionary in Attributes

Introduction

The last blog I did about .NET attributes was to add a simple attribute to an existing method. This entry is about building a "Dictionary" of data into a set of attributes on a method. For example, I want the attributes to document each parameter of a method. So what I want is something that looks like this:


[Method(Description="This is the fibonacci sequence"
       ,Parameters={ {"in", "The input parameter" } })]
int Fibonacci(int in)
{
    if (in == 0 || in == 1) return 1;
    return Fibonacci(in - 2) + Fibonacci(in - 1);
}

Keep in mind this is NOT valid syntax in .NET (at least I don't think it is).

Attribute Definition

The above description won't work- only because I don't think that C# allows parameter definitions with complex objects as values. However, I found a solution that is pretty good at [1]. The partial solution is to separate each element that would be in the dictionary into a unique attribute. The attribute I put together looks like this:
                                                                                                        
[AttributeUsage(AttributeTargets.All,AllowMultiple=true)]
public class SomeParameter : Attribute
{
     private string m_name;
     private string m_description;

     public string Name 
     {
         get
         {
             return m_name;
         }
         set
         {
             m_name = value;
         }
     }


     public string Description
     {
         get
         {
             return m_description;
         }
         set
         {
             m_description = value;
         }
     }
}

I put one of the critical sections in bold. The trick is to set the AllowMultiple flag to true, which lets us actually add more than one of these attributes to the method [2]. To use this:

[SomeParameter(Name="input1",Description="The input to fib.")]
public int Fibonacci(int input1)
{
}

Note: Remember to put the public in front of the method! If it is not listed as public, it will not show up when using the reflection method I'm going to show below. This isn't a very good example since fibonacci only takes one parameter. However if I add a new method:


[SomeParameter(Name="parm1",Description="The first input to Calculate2.")]
[SomeParameter(Name="parm2",Description="The second input to Calculate2.")]
public int Calculate2(int parm1, int parm2)
{
}

Why do this? The reason I want to do this is to add a way to query more information about parameters and functions. Here is my complete program to illustrate how the multiple parameters can also be queried:

using System;


[AttributeUsage(AttributeTargets.All)]
public class SomeMethod : Attribute
{
    private string m_description;

    public string Description
    {

        get
        {
            return m_description;
        }

        set
        {
            m_description = value;
        }
    }
}


[AttributeUsage(AttributeTargets.All,AllowMultiple=true)]
public class SomeParameter : Attribute
{
    private string m_name;
    private string m_description;

    public string Name
    {
        get
        {
            return m_name;
        }

        set
        {
            m_name = value;
        }
    }


    public string Description
    {
        get
        {
            return m_description;
        }

        set
        {
            m_description = value;
        }
    }


}


public class HelloWorld
{
    HelloWorld()
    {
    }


    [SomeMethod(Description="Sample calculation")]
    [SomeParameter(Name="parm1", Description="Parameter #1")]
    [SomeParameter(Name="parm2", Description="Parameter #2")]
    public int Calculate2(int parm1, int parm2)

    {
        return parm1 + parm2;
    }


    static public void Main()
    {
        HelloWorld h = new HelloWorld();

        int output = h.Calculate2(4, 5);


        Type hwInfo = typeof(HelloWorld);

        System.Reflection.MemberInfo[] memberInfo = hwInfo.GetMembers();
        foreach(System.Reflection.MemberInfo mInfo in memberInfo)
        {
            Console.WriteLine(mInfo.ToString());

            object[] attributes = mInfo.GetCustomAttributes(true);
            Console.WriteLine("\tNumber of attributes: " + attributes.Length);
            for(int i=0; i<attributes.Length; i++)
            {
                System.Console.WriteLine("\t\t" + attributes[i]);
            }
        }
    }
}

This program goes through and prints out all of the methods available in the C# class.


REFERENCES

[1] - http://stackoverflow.com/questions/21265431/how-can-i-accept-a-dictionary-of-data-as-a-custom-net-attribute-parameter

[2] - https://msdn.microsoft.com/en-us/library/tw5zxet9.aspx


Wednesday, April 29, 2015

Building a Custom Debian Kernel

Introduction

This entry is about building a custom Debian kernel. I've never done this before and I have some need for it. The instructions I'm basing this on are found at:

https://www.debian.org/releases/stable/i386/ch08s06.html.en

I'm not sure if this is a good place to start; it's what this article is based upon. You must have root privileges

What Kernel am I using?

The current kernel can be found simply by querying:

> uname -r

This returned back:

3.2.0-4-amd64

There are several ways to query the version of the kernel. I found them at the following website:

http://www.linfo.org/find_kernel_version.html

Command Line

> sudo apt-get install fakeroot
> sudo apt-get install  kernel-package
> sudo apt-get install linux-source-2.6
> sudo apt-get install ncurses-dev
> cd ~
> mkdir kernel
> cp /usr/src/linux-source-*.tar.bz2 .
> cd kernel
> make menuconfig
> make-kpkg clean
> fakeroot make-kpkg --initrd --revision=1.0 kernel_image
> sudo dpkg -i ../linux-image-3.2.65_1.0_amd64.deb
> sudo shutdown -r now


After a reboot, if you do the following you should now see the updated kernel version:


> uname -r

Now it returned back:

3.2.65

Interesting that it did not return back the architecture.

fakeroot

From what I can gather about fakeroot, its primary purpose is to allow non-root users a way to produce files that have "root permissions/ownership" [3]. Essentially it gets rid of the requirement that the developer building the kernel needs to be root to build files with root ownership.

kernel-package

If make-kpkg is missing then kernel-package has not been installed.

linux-source-2.6

This is the source code for the kernel. When installing this package, it will pull down the source code into /usr/src/linux-source-X.X.tar.bz2. The sequence of commands above shows that we copy the tarball into a local directory called "kernel".

make menuconfig

This step is pretty cool because it allows the developer to customize what features to enable/disable and which files should be built in versus built into modules. Doing it this way requires that ncurses be installed (see the installation lines for details). It's a pretty self-explanatory user interface.


REFERENCES

[1] https://www.debian.org/releases/stable/i386/ch08s06.html.en

[2] http://www.linfo.org/find_kernel_version.html

[3] http://unix.stackexchange.com/questions/9714/what-is-the-need-for-fakeroot-command-in-linux


Sunday, March 8, 2015

C# .NET Attributes Data (Beginner's Guide)

Introduction

This guide is all about how to add metadata to a C# program. This entry is aimed at the beginning C# developer who has experience with other programming languages. Metadata has a variety of uses- at the company I work for we're going to use it to provide more verbose information to consumers of some given code. It's a very .NET-y solution to a problem we've already solved in C++ using parsers. The advantage to metadata is that it's a solution that is already supported by the .NET framework.

Please note that all of the code that I'm writing is compiled using Mono. Mono is a cross-platform tool that can compile C# code into an intermediate form which can then be run.

The Initial Program

For the initial program I decided to use the "Hello World" program provided by the Mono project [1]. This had the duel purpose of testing out my Mono installation. The original HW program was kind of simple for the type of meta-information I wanted to provide. So it was modified. Here is the original code (once again, credit to the mono project):

using System;

public class HelloWorld
{
    static public void Main()
    {
        Console.WriteLine("Hello Mono World!");
    }
}

Let's change the program to instantiate a HelloWorld object and use a method to print a message out.

using System;

public class HelloWorld
{
    public void PrintMsg(String msg)
    {
        Console.WriteLine(msg);
    }

    static public void Main()
    {
        HelloWorld hw = new HelloWorld();
        hw.PrintMsg("Hello World!");
    }
}

Adding an Attribute Class

The example class now has a basic method (PrintMsg). I want to start inserting special meta data to the class and some of its functions. Let's start with a simple description field. To achieve this a custom Attribute class must be written. I'm going to call the attribute class "SomeMethod":

using System;

[AttributeUsage(AttributeTargets.All)]
public class SomeMethod : Attribute
{
    private string m_description;

    public string Description
    {
        get
        {
            return m_description;
        }
        set 
        {
            m_description = value;
        }
    }
}

This is a really simple attributes class that has one property called "Description". The Description property is implemented with the get/set methods. These are just shorthand ways to implement these basic accessors. It's also much more formal than most other languages.

The top line contains [AttributeUsage(AttributeTargets.All)] seems to help declare this class as an attribute that can be applied using metadata calls [2].

Applying the Custom Attribute

To apply the custom attribute, all that is necessary is to apply some metadata before the method and it automatically gets attached:

using System;

[AttributeUsage(AttributeTargets.All)]
public class SomeMethod : Attribute
{
    private string m_description;

    public string Description
    {
        get
        {
            return m_description;
        }
        set 
        {
            m_description = value;
        }
    }
}


public class HelloWorld
{
    [SomeMethod(Description="This is a description of PrintMsg")]
    public void PrintMsg(String msg)
    {
        Console.WriteLine(msg);
    }

    static public void Main()
    {
        HelloWorld hw = new HelloWorld();
        hw.PrintMsg("Hello World!");
    }
}

I put the introduced attribute in bold.

Using Reflection to Query Attributes

The only step left is now querying the attributes placed on members/methods. This is pretty simple using a language feature called Reflection. So I modified the main part of the program to contain the following lines:

public class HelloWorld
{
    [SomeMethod(Description="This is a description of PrintMsg")]
    public void PrintMsg(String msg)
    {
        Console.WriteLine(msg);
    }

    static public void Main()
    {
        HelloWorld hw = new HelloWorld();
        hw.PrintMsg("Hello World!");

        Type hwInfo = typeof(HelloWorld);

        System.Reflection.MemberInfo[] memberInfo = hwInfo.GetMembers();
        foreach(System.Reflection.MemberInfo mInfo in memberInfo)
        {
            Console.WriteLine(mInfo.ToString());
       
            object[] attributes = mInfo.GetCustomAttributes(true);
            Console.WriteLine("\tNumber of attributes: " + attributes.Length);
            for(int i=0; i<attributes.Length; i++)
            {
                System.Console.WriteLine("\t\t" + attributes[i]);
            }
        }
    }
}

This program is now modified to print out all of the methods inside of HelloWorld and whether or not there were custom attributes applied. The point of this step is to partially explore what can be queried with Reflection.

Learning Note: When I ran this program in Mono it was observed that my one simple class had more than one method. Being a veteran C++ developer I am familiar with methods (constructors, assignment operators, etc) being added to classes. It appears as though C# also does something similar adding: 

  • Boolean Equals(System.String)
  • Int32 GetHashCode()
  • System.Type GetType()
  • System.String ToString()
  • Void .ctor()
I must admit that these methods all look really useful! As a C# beginner I think another entry might be useful to describe what these methods do. 


If we want to detect when a method has an attribute, it's as simple as:

public class HelloWorld
{
    [SomeMethod(Description="This is a description of PrintMsg")]
    public void PrintMsg(String msg)
    {
        Console.WriteLine(msg);
    }

    static public void Main()
    {
        HelloWorld hw = new HelloWorld();
        hw.PrintMsg("Hello World!");

        Type hwInfo = typeof(HelloWorld);

        System.Reflection.MemberInfo[] memberInfo = hwInfo.GetMembers();
        foreach(System.Reflection.MemberInfo mInfo in memberInfo)
        {
            Console.WriteLine(mInfo.ToString());

            SomeMethod sm = 
               (SomeMethod) Attribute.GetCustomAttribute( mInfo
                                                        , typeof(SomeMethod));
            if (sm != null)
            {
                Console.WriteLine("\tHAS IT!\n");
            }
        }
    }
}

This program will now print out a message when the SomeMethod is obtained!

Conclusion

I really hate to admit this- C# looks awesome! I really enjoyed using Mono to run these examples. I know the examples were simple but I'm impressed with how the language defines its own custom attributes. In my next entry on this feature I'll explore how to add lists of things to attributes.


REFERENCES

[1] - http://www.mono-project.com/docs/getting-started/mono-basics/

[2] - https://msdn.microsoft.com/en-us/library/aa288454%28v=vs.71%29.aspx

[3] -https://msdn.microsoft.com/en-us/library/aa288454%28v=vs.71%29.aspx#vcwlkattributestutorialanchor3


Sunday, March 1, 2015

Where to find Qt Configure Flags

Introduction

It's Sunday afternoon and I'm about to re-setup a development virtual machine. In the creation of it I'm going to be building Qt5 from source on Linux. Building from source can be troublesome at times because it's hard to find good information about the configure "script". This small entry is about where to find information (from source code) about Qt's configure "script".

If I do a quick google search with "Qt configure documentation", the first good link I get is for Qt4:

http://qt-project.org/doc/qt-4.8/configure-options.html

Not bad. The link below it is for Qt 5.4:

http://doc.qt.io/qt-5/configure-options.html

In the tradition of ever obtrusive documentation, it's very wordy and hard to find what you are looking for. In my opinion the documentation style for Qt5 is inferior to Qt4 (opinions are subject to change).

This entry is all about the actual mechanism behind the configure "script". I am putting script in quotation marks because it's not actually a script- it's an executable. The first step after pulling Qt down from source is to run "configure" in the root directory. Obviously if using Visual Studio you must have run this from the VS Command Prompt.

QT/configure [.bat]

There are two scripts in two languages named "configure" in the root directory. The regular old configure script is a shell script that simply executes qtbase/configure. The configure.bat does the same in its own way executing qtbase/configure.bat.

QT/qtbase/configure.bat

This script begins the "bootstrapping configure". Essentially it runs a perl script called syncqt.pl and then tries to build the configure tool in QT/tools/configure. The configure executable tool takes the place of the QT/qtbase/configure. When I built Qt 5.3 it looks as if this tool was never built- looks as if this is a Windows only step.

QT/qtbase/configure

This is a shell script that does the actual setup for the build. When using Visual Studio, this won't be utilized. Instead the configure application listed above is used. The reason why it exists this way is probably due to batch files being rotten but I could be wrong.

Where are the build options for configure?

In conclusion, to find the base options for the configure step in Qt the developer could look in QT/qtbase/configure (which is the script used for Linux) OR look qt QT/qtbase/tools/configureapp.cpp in the method Configure::parseCmdLine().

 - Visual Studio     - SOURCE : $QTDIR/qtbase/tools/configure/configureapp.cpp
   - TYPE   : Binary Application
   - METHOD : Configure::parseCmdLine()
 - Linux (Other)
   - SOURCE : $QTDIR/qtbase/configure
   - TYPE   : Shell Script
   - METHOD : Line 828? Look for "parse command line arguments"

Using the source code the developer can get definitive information about the configure arguments that can be passed into building Qt.




Saturday, January 31, 2015

QQuickItem (Cannot assign object to list)

Introduction

I find myself with a problem that the Qt forums can't solve. The only way to fix it is to dive into the Qt source code and figure it out myself. This blog post is all about the internals of QtQuick2 and is meant for an intermediate audience. I apologize about this blogpost as it's mainly about how I'm fixing this one issue; but I assure the reader that once finished they'll have more intimate knowledge of QtQuick2.

Prerequisites for this entry include basic knowledge about QQuickItem and customization using C++. Before writing this article I was familiar with the class predecessor, QDeclarativeItem. The two are very similar yet very very different. That might be the subject of another post.

The first section is all about detailing the crime scene or in other words describing the problem. The second section documents some useful information about import's in Qt5/QtQuick2 (including some really general information about qmldir). The third section after that documents the "default property" in QML and what it is all about.The fourth section is all about where and how the definitions of QQuickItems are stored.

Problem Description

During a port of QtQuick1 to QtQuick2 code I got the error:

types.qml: 48:1: Cannot assign object to list

We've all been there- a problem we're seeing in a third party library. This is a kind of problem that no one else sees. We didn't want to deal with branching our code for the two distributions. Using some typedefs along with a hand rolled preprocessor the whole thing works great. Except when I saw the following error when loading some QML:

types.qml: 48:1: Cannot assign object to list

This was a strange error indeed. My QML program looked like this:

import QtQuick 2.0
import blah 1.0

TypesCreator {
    id: root
    ...

    Connections { // Line 48
        target: __start__ // __start__ is an object I bound a QObject to.
        onStart: {
            // Do something.
        }
    }
}

The TypesCreator element is part of the blah import that is custom to the application. In the interest of treating this article as a "whodunnit" type of story you can assume that TypesCreator's object looks like this in C++:

class TypesCreator : public QQuickItem
{
    Q_OBJECT
    public:

    private:
};

This obviously does nothing except acts as a container for other objects. In any crime scene you have to know the area. In this case I needed to know what was imported and what wasn't.

Where/What Modules Are/Exist?

The first theory I had was that the Connections object wasn't registered. Eventually it was read that Connections was technically not part of QtQuick 2 but rather was part of QtQml [1]. Upon further reading, QtQml components are automatically included as part of QtQuick. This theory is a dead end- however it led me to trying to solve the riddle of "what objects belong to what import"?

The answer is:

http://doc.qt.io/qt-5/modules-qml.html

As a sidenote to this section: the Qt5 documentation is quite irritating. While being much more comprehensible it fails to be searchable. It took me over 5 minutes to find the module list.

The module source code for the imports is organized under:

qtdeclarative/src/imports/

The easiest way to decipher the imports is to go under a directory and read the qmldir file. The qmldir file has all of the information about what types of classes for QML the module contains. For example I'm looking at:

qtdeclarative/src/imports/qtquick2/qmldir

This is what it reads:

module QtQuick
plugin qtquick2plugin
classname QtQuick2Plugin
typeinfo plugins.qmltypes
designersupported

Essentially it is a hacked together file format that attaches some extra information onto a module. In this case the first line defines what the module name is. The second line tells me that this is a collection of C++ objects that make up this module. The rest I'll skip for now- I just want to know where the basic information is at this point.

Default QML Properties

One of the biggest questions I had when trying to solve this problem was what property could this not assign an object to? I put that in bold mainly to get back to the original error message:

types.qml: 48:1: Cannot assign object to list

So what was this property? The only way I could actually solve this was to get a breakpoint into the code that was printing the error message and then work backwards. To achieve this purpose I:
  1. Performed a grep to find the string "Cannot assign object to list" in the Qt Source code. It turned up in qtdeclarative/src/qml/compiler/qqmltypecompiler.cpp.
  2. When I found the message I noticed that it passed in a propertyName as a parameter to the function, I outputted this using qDebug(). 
  3. Finally to really throw a wrench into things I throw a standard exception. This allows Visual Studio to trip up each time it encounters this error.
When running I discovered the property name being set was "data". This was confusing since no where in my code did a "data" object exist. That's not true though! Inside of the source code for QQuickItem it defines the property "data" as:

Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QQmlListProperty<QObject> data READ data DESIGNABLE false)

So every item in QML has a data property and apparently it's a list of QObject's. That's something new- however I'm never using the "data" property. As I was about to find out, this is also not true.

There's a feature in QML where the developer can specify the "default property" [3]. Inside of QQuickItem it has the following macro also added in:

Q_CLASSINFO("DefaultProperty", "data")

This means that any sort of unbound object created will be added to "data". Since every QML object has the default property set to "data" all of what would appear to be the child items are added in via the data property. It is mentioned in the documentation that the data elements when added are also added to the children list.

This explains a lot; it explains why the property it cannot add Connections to is called "data", it explains why the type it is trying to add to is referenced as a list. The only thing it doesn't solve is why Connections isn't registered as a QObject. It should be; something isn't adding up. The next logical step is to observe how the Connections object is added to a QML Engine.

The How and Where QML Types Are Stored

The final bit of the puzzle for this entry is determining why the QML types cannot be found. This involved stepping into Qt. I found out the following:

1) For each type defined for QML, there is a QQmlType object. According to my notes the declaration can be found in qqmlmetatype_p.h. [4]
2) There's an object of class QQmlMetaTypeData that contains a map of all the created types. When the developer calls qmlRegisterType, the type created, its name, and version information all end up in a map here.The declaration is found in qqmlmetatype.cpp [5].
3) The map itself holds a hash of type identifier to QQmlType (line 76 in the source).

My best guess is that the type identifier for a well known type is getting overwritten in this map. The basic type I'm trying to use was replaced with some garbage type. To understand this, I tracked down where the QML numeric type was defined. If walking up the call stack, the QML Type identifier is found to map to the QMetaTypeIdHelper<T>::qt_metatype_id() where T is the type of the class.

The summary to this section is that any time a registration occurs with the meta type system the identifier that is produced is also used in QML to map type information. The numbers are mostly guaranteed to be unique since they are using a basic atomic integer mechanism so it makes sense. Having this information in hand I could now surmise that somewhere I was doing something stupid when registering types. This guess proved to be right since I found this little gremlin in the code:

qRegisterMetaType<QObject*>("LayerItem");

Looking at it now I'm kicking myself. This was using the type id from QObject* to map to the string "LayerItem".

Conclusion

While searching for why the runtime error "Cannot assign object to list" in QML I learned a lot about how the language parses, interprets, and stores its programs:

  • Modules in QtQuick2 are very similar to QtQuick1 modules with the exception they can store more meta information in qmldir.
  • QObject based classes have the ability to store a default parameter which can be used to store "child" information in a custom way.
  • QML Types are stored in a map inside of QQmlMetaTypeData. The id's used in the map come from the Qt Meta Object System.
In the process of learning about all of these facets of the engine I found the solution to my problem which was to get rid of a call to qRegisterMetaType<QObject*>. 


REFERENCES

[1] - http://doc.qt.io/qt-5/qtqml-qmlmodule.html

[2] - http://qt-project.org/doc/qt-4.8/declarative-cppextensions-referenceexamples-default.html

[3] - http://doc.qt.io/qt-5/qtqml-syntax-objectattributes.html#property-attributes

[4] - https://qt.gitorious.org/qt/qtdeclarative/source/ccd69247eaa6289bc31115f863ba4737b14fe34e:src/qml/qml/qqmlmetatype_p.h

[5] - https://qt.gitorious.org/qt/qtdeclarative/source/e2ea0a83cc876fb54a2a8bf6f1350dbfa52f596b:src/qml/qml/qqmlmetatype.cpp