Редактирование: Qt:Документация 4.3.2/designer-connection-mode
Материал из Wiki.crossplatform.ru
Внимание: Вы не представились системе. Ваш IP-адрес будет записан в историю изменений этой страницы.
Правка может быть отменена. Пожалуйста, просмотрите сравнение версий, чтобы убедиться, что это именно те изменения, которые вас интересуют, и нажмите «Записать страницу», чтобы изменения вступили в силу.
Текущая версия | Ваш текст | ||
Строка 7: | Строка 7: | ||
''Qt Designer'''s signals and slots editing mode allows objects in a form to be connected together using Qt's signals and slots mechanism. Both widgets and layout objects can be connected via an intuitive connection interface, and ''Qt Designer'' will present a menu of compatible signals and slots to use for each connection made. When the form is saved, the connections are preserved so that they will be ready for use when your project is built. | ''Qt Designer'''s signals and slots editing mode allows objects in a form to be connected together using Qt's signals and slots mechanism. Both widgets and layout objects can be connected via an intuitive connection interface, and ''Qt Designer'' will present a menu of compatible signals and slots to use for each connection made. When the form is saved, the connections are preserved so that they will be ready for use when your project is built. | ||
+ | __TOC__ | ||
- | |||
- | |||
- | |||
==Connecting Objects== | ==Connecting Objects== | ||
To begin connecting objects, enter the signals and slots editing mode by opening the '''Edit''' menu and selecting '''Edit Сигналы/Slots''', or by pressing the '''F4''' key. All widgets and layout objects on the form can be connected together. Spacers just provide spacing hints to layouts, so they cannot be connected to other objects. | To begin connecting objects, enter the signals and slots editing mode by opening the '''Edit''' menu and selecting '''Edit Сигналы/Slots''', or by pressing the '''F4''' key. All widgets and layout objects on the form can be connected together. Spacers just provide spacing hints to layouts, so they cannot be connected to other objects. | ||
- | + | ||
{| align="center" cellpadding="2" cellspacing="1" border="0" | {| align="center" cellpadding="2" cellspacing="1" border="0" | ||
Строка 26: | Строка 24: | ||
You can abandon the connection at any point while you are dragging the connection path by pressing '''Esc'''. | You can abandon the connection at any point while you are dragging the connection path by pressing '''Esc'''. | ||
- | + | ||
{| align="center" cellpadding="2" cellspacing="1" border="0" | {| align="center" cellpadding="2" cellspacing="1" border="0" | ||
Строка 39: | Строка 37: | ||
To complete the connection, select a signal from the source object and a slot from the destination object, then click the '''OK''' button. Click '''Cancel''' if you wish to abandon the connection. | To complete the connection, select a signal from the source object and a slot from the destination object, then click the '''OK''' button. Click '''Cancel''' if you wish to abandon the connection. | ||
- | + | ||
{| align="center" cellpadding="2" cellspacing="1" border="0" | {| align="center" cellpadding="2" cellspacing="1" border="0" | ||
Строка 52: | Строка 50: | ||
You can make as many connections as you like between objects on the form, and it is possible to connect signals from objects to slots in the form itself. As a result, the signal and slot connections in many dialogs can be completely configured from within ''Qt Designer''. | You can make as many connections as you like between objects on the form, and it is possible to connect signals from objects to slots in the form itself. As a result, the signal and slot connections in many dialogs can be completely configured from within ''Qt Designer''. | ||
- | + | ||
{| align="center" cellpadding="2" cellspacing="1" border="0" | {| align="center" cellpadding="2" cellspacing="1" border="0" | ||
Строка 63: | Строка 61: | ||
|} | |} | ||
- | + | ||
==Editing and Deleting Connections== | ==Editing and Deleting Connections== | ||
By default, connection paths are created with two labels that show the signal and slot involved in the connection. These labels are usually oriented along the line of the connection, and they can be moved around inside their host widgets by dragging the red square at each end of the connection path. | By default, connection paths are created with two labels that show the signal and slot involved in the connection. These labels are usually oriented along the line of the connection, and they can be moved around inside their host widgets by dragging the red square at each end of the connection path. | ||
- | + | ||
{| align="center" cellpadding="2" cellspacing="1" border="0" | {| align="center" cellpadding="2" cellspacing="1" border="0" | ||
Строка 77: | Строка 75: | ||
In addition to using the signal and slot editor, you can edit the connection by simply double clicking on the connection path or one of its labels, and select the signal and slot to be used in the connection dialog. | In addition to using the signal and slot editor, you can edit the connection by simply double clicking on the connection path or one of its labels, and select the signal and slot to be used in the connection dialog. | ||
- | + | ||
{| align="center" cellpadding="2" cellspacing="1" border="0" | {| align="center" cellpadding="2" cellspacing="1" border="0" | ||
Строка 84: | Строка 82: | ||
|'''Deleting Connections''' | |'''Deleting Connections''' | ||
The whole connection can be selected by clicking on any of the path segments. Once selected, connections can be deleted with the '''Delete''' key, and they will not be set up in the .ui file. | The whole connection can be selected by clicking on any of the path segments. Once selected, connections can be deleted with the '''Delete''' key, and they will not be set up in the .ui file. | ||
- | |||
|} | |} | ||