#include <signalsloteditorwindow.h>
Inheritance diagram for qdesigner_internal::SignalSlotEditorWindow:


Definition at line 42 of file signalsloteditorwindow.h.
Public Slots | |
| void | setActiveFormWindow (QDesignerFormWindowInterface *form) |
Public Member Functions | |
| SignalSlotEditorWindow (QDesignerFormEditorInterface *core, QWidget *parent=0) | |
Private Slots | |
| void | updateDialogSelection (Connection *con) |
| void | updateEditorSelection (const QModelIndex &index) |
| void | addConnection () |
| void | removeConnection () |
| void | updateUi () |
Private Attributes | |
| QTreeView * | m_view |
| QPointer< SignalSlotEditor > | m_editor |
| QToolButton * | m_add_button |
| QToolButton * | m_remove_button |
| bool | m_handling_selection_change |
| qdesigner_internal::SignalSlotEditorWindow::SignalSlotEditorWindow | ( | QDesignerFormEditorInterface * | core, | |
| QWidget * | parent = 0 | |||
| ) |
Definition at line 522 of file signalsloteditorwindow.cpp.
References addConnection(), QBoxLayout::addStretch(), QLayout::addWidget(), QBoxLayout::addWidget(), QObject::connect(), qdesigner_internal::createIconSet(), QAbstractItemView::DoubleClicked, QAbstractItemView::EditKeyPressed, QDesignerFormEditorInterface::formWindowManager(), QWidget::layout(), m_add_button, m_editor, m_handling_selection_change, m_remove_button, m_view, removeConnection(), setActiveFormWindow(), QAbstractItemView::setEditTriggers(), QAbstractButton::setIcon(), QAbstractItemView::setItemDelegate(), QLayout::setMargin(), QTreeView::setRootIsDecorated(), SIGNAL, SLOT, and updateUi().
00524 : QWidget(parent) 00525 { 00526 m_handling_selection_change = false; 00527 00528 m_editor = 0; 00529 m_view = new QTreeView(this); 00530 m_view->setItemDelegate(new ConnectionDelegate(this)); 00531 m_view->setEditTriggers(QAbstractItemView::DoubleClicked 00532 | QAbstractItemView::EditKeyPressed); 00533 m_view->setRootIsDecorated(false); 00534 connect(m_view, SIGNAL(activated(QModelIndex)), this, SLOT(updateUi())); 00535 00536 QVBoxLayout *layout = new QVBoxLayout(this); 00537 layout->setMargin(0); 00538 layout->addWidget(m_view); 00539 00540 QHBoxLayout *layout2 = new QHBoxLayout; 00541 layout2->setMargin(3); 00542 layout->addLayout(layout2); 00543 layout2->addStretch(); 00544 00545 m_remove_button = new QToolButton(this); 00546 m_remove_button->setIcon(createIconSet(QLatin1String("minus.png"))); 00547 connect(m_remove_button, SIGNAL(clicked()), this, SLOT(removeConnection())); 00548 layout2->addWidget(m_remove_button); 00549 00550 m_add_button = new QToolButton(this); 00551 m_add_button->setIcon(createIconSet(QLatin1String("plus.png"))); 00552 connect(m_add_button, SIGNAL(clicked()), this, SLOT(addConnection())); 00553 layout2->addWidget(m_add_button); 00554 00555 connect(core->formWindowManager(), 00556 SIGNAL(activeFormWindowChanged(QDesignerFormWindowInterface*)), 00557 this, SLOT(setActiveFormWindow(QDesignerFormWindowInterface*))); 00558 00559 updateUi(); 00560 }
Here is the call graph for this function:

| void qdesigner_internal::SignalSlotEditorWindow::setActiveFormWindow | ( | QDesignerFormWindowInterface * | form | ) | [slot] |
Definition at line 562 of file signalsloteditorwindow.cpp.
References QObject::connect(), QObject::disconnect(), form(), QAbstractItemView::itemDelegate(), m_editor, m_view, QAbstractItemView::selectionModel(), qdesigner_internal::ConnectionDelegate::setForm(), QTreeView::setModel(), SIGNAL, SLOT, updateDialogSelection(), updateEditorSelection(), and updateUi().
Referenced by SignalSlotEditorWindow().
00563 { 00564 m_view->setModel(0); 00565 00566 if (!m_editor.isNull()) { 00567 disconnect(m_view->selectionModel(), 00568 SIGNAL(currentChanged(QModelIndex,QModelIndex)), 00569 this, SLOT(updateEditorSelection(QModelIndex))); 00570 disconnect(m_editor, SIGNAL(connectionSelected(Connection*)), 00571 this, SLOT(updateDialogSelection(Connection*))); 00572 } 00573 00574 m_editor = qFindChild<SignalSlotEditor*>(form); 00575 00576 if (!m_editor.isNull()) { 00577 m_view->setModel(m_editor->model()); 00578 ConnectionDelegate *delegate 00579 = qobject_cast<ConnectionDelegate*>(m_view->itemDelegate()); 00580 if (delegate != 0) 00581 delegate->setForm(form); 00582 00583 connect(m_view->selectionModel(), 00584 SIGNAL(currentChanged(QModelIndex,QModelIndex)), 00585 this, SLOT(updateEditorSelection(QModelIndex))); 00586 connect(m_editor, SIGNAL(connectionSelected(Connection*)), 00587 this, SLOT(updateDialogSelection(Connection*))); 00588 } 00589 00590 updateUi(); 00591 }
| void qdesigner_internal::SignalSlotEditorWindow::updateDialogSelection | ( | Connection * | con | ) | [private, slot] |
Definition at line 593 of file signalsloteditorwindow.cpp.
References qdesigner_internal::ConnectionModel::connectionToIndex(), QAbstractItemView::currentIndex(), index, m_editor, m_handling_selection_change, m_view, QAbstractItemView::setCurrentIndex(), and updateUi().
Referenced by setActiveFormWindow().
00594 { 00595 if (m_handling_selection_change || m_editor == 0) 00596 return; 00597 00598 ConnectionModel *model = qobject_cast<ConnectionModel*>(m_editor->model()); 00599 Q_ASSERT(model != 0); 00600 QModelIndex index = model->connectionToIndex(con); 00601 if (index == m_view->currentIndex()) 00602 return; 00603 m_handling_selection_change = true; 00604 m_view->setCurrentIndex(index); 00605 m_handling_selection_change = false; 00606 00607 updateUi(); 00608 }
| void qdesigner_internal::SignalSlotEditorWindow::updateEditorSelection | ( | const QModelIndex & | index | ) | [private, slot] |
Definition at line 610 of file signalsloteditorwindow.cpp.
References index, qdesigner_internal::ConnectionModel::indexToConnection(), m_editor, m_handling_selection_change, and updateUi().
Referenced by setActiveFormWindow().
00611 { 00612 if (m_handling_selection_change || m_editor == 0) 00613 return; 00614 00615 if (m_editor == 0) 00616 return; 00617 00618 ConnectionModel *model = qobject_cast<ConnectionModel*>(m_editor->model()); 00619 Q_ASSERT(model != 0); 00620 Connection *con = model->indexToConnection(index); 00621 if (m_editor->selected(con)) 00622 return; 00623 m_handling_selection_change = true; 00624 m_editor->selectNone(); 00625 m_editor->setSelected(con, true); 00626 m_handling_selection_change = false; 00627 00628 updateUi(); 00629 }
| void qdesigner_internal::SignalSlotEditorWindow::addConnection | ( | ) | [private, slot] |
Definition at line 631 of file signalsloteditorwindow.cpp.
References m_editor, and updateUi().
Referenced by SignalSlotEditorWindow().
00632 { 00633 if (m_editor.isNull()) 00634 return; 00635 00636 m_editor->addEmptyConnection(); 00637 updateUi(); 00638 }
| void qdesigner_internal::SignalSlotEditorWindow::removeConnection | ( | ) | [private, slot] |
Definition at line 640 of file signalsloteditorwindow.cpp.
References m_editor, and updateUi().
Referenced by SignalSlotEditorWindow().
00641 { 00642 if (m_editor.isNull()) 00643 return; 00644 00645 m_editor->deleteSelected(); 00646 updateUi(); 00647 }
| void qdesigner_internal::SignalSlotEditorWindow::updateUi | ( | ) | [private, slot] |
Definition at line 649 of file signalsloteditorwindow.cpp.
References QAbstractItemView::currentIndex(), QModelIndex::isValid(), m_add_button, m_editor, m_remove_button, m_view, and QWidget::setEnabled().
Referenced by addConnection(), removeConnection(), setActiveFormWindow(), SignalSlotEditorWindow(), updateDialogSelection(), and updateEditorSelection().
00650 { 00651 m_add_button->setEnabled(!m_editor.isNull()); 00652 m_remove_button->setEnabled(!m_editor.isNull() && m_view->currentIndex().isValid()); 00653 }
Definition at line 60 of file signalsloteditorwindow.h.
Referenced by setActiveFormWindow(), SignalSlotEditorWindow(), updateDialogSelection(), and updateUi().
Definition at line 61 of file signalsloteditorwindow.h.
Referenced by addConnection(), removeConnection(), setActiveFormWindow(), SignalSlotEditorWindow(), updateDialogSelection(), updateEditorSelection(), and updateUi().
Definition at line 62 of file signalsloteditorwindow.h.
Referenced by SignalSlotEditorWindow(), and updateUi().
Definition at line 62 of file signalsloteditorwindow.h.
Referenced by SignalSlotEditorWindow(), and updateUi().
Definition at line 64 of file signalsloteditorwindow.h.
Referenced by SignalSlotEditorWindow(), updateDialogSelection(), and updateEditorSelection().
1.5.1