Qt:Документация 4.3.2/designer-resources

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

[Previous: Qt Designer's Tab Order Editing Mode ] [ Contents ] [Next: Customizing Qt Designer Forms ]

[править] Editing Resources with Qt Designer

center

Qt Designer fully supports the Qt Resource System, allowing resources to be specified alongside forms as they are designed. To help designers and developers manage the resources that are needed by applications, Qt Designer's resource editor allows resources to be defined on a per-form basis.

[править] Defining a Resource File

To specify a resource file you must enable the resorce editor by opening the Tools menu, and switching on the Resource Editor option.

center Resource Files

Using the resource editor, you can either open existing resource files or create new ones. Click the Current Resource combobox to choose one or the other.

Once a resource file is loaded, you can create or remove entries in the file using the provided + and - buttons, and specify resources (for example images) using the Add Files button. Note that these resources must reside within the current resource file's directory or one of its subdirectories.

center Editing Resource Files

Press the + button to add a new resource entry to the file. Then use the Add Files button to specify the resource.

You can remove resources by selecting the corresponding entry in the resource editor, and press the - button.

[править] Using the Resources

When the resources are defined you can use them actively when composing your form. For example, you might want to create a tool button using an icon specified in the resource file.

center Using Resources

When changing properties which values might be defined within a resource file, Qt Designer presents a dialog that allows you to specify a resource in addition to the option of selecting a source file in the ordinary way.

You can open the resource editor to add new resources any time in the design process.

To quickly assign icon pixmaps to actions or pixmap properties, you may drag the pixmap from the resource editor to the action editor, or to the pixmap property in the property editor.

[Previous: Qt Designer's Tab Order Editing Mode ] [ Contents ] [Next: Customizing Qt Designer Forms ]


Copyright © 2007 Trolltech Trademarks
Qt 4.3.2