Qt 4.5: Creating Custom Qt Types

|  | Home · All Namespaces · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# Creating Custom Qt Types

- Overview
- Creating a Custom Type

### Overview

When creating user interfaces with Qt, particularly those with specialized controls and features, developers sometimes need to create new data types that can be used alongside or in place of Qt's existing set of value types.

Standard types such as QSize, QColor and QString can all be stored in QVariant objects, used as the types of properties in QObject-based classes, and emitted in signal-slot communication. In this document, we take a custom type and describe how to integrate it into Qt's object model so that it can be stored in the same way as standard Qt types. We then show how to register the custom type to allow it to be used in signals and slots connections.

### Creating a Custom Type