void EditPointTool::finishEditing() { bool create_undo_step = true; bool delete_objects = false; if (text_editor) { delete text_editor; text_editor = nullptr; TextObject* text_object = reinterpret_cast<TextObject*>(*map()->selectedObjectsBegin()); if (text_object->getText().isEmpty()) { text_object->setText(old_text); text_object->setHorizontalAlignment((TextObject::HorizontalAlignment)old_horz_alignment); text_object->setVerticalAlignment((TextObject::VerticalAlignment)old_vert_alignment); create_undo_step = false; delete_objects = true; } else if (text_object->getText() == old_text && (int)text_object->getHorizontalAlignment() == old_horz_alignment && (int)text_object->getVerticalAlignment() == old_vert_alignment) create_undo_step = false; } MapEditorToolBase::finishEditing(delete_objects, create_undo_step); if (delete_objects) deleteSelectedObjects(); updateStatusText(); }
bool EditPointTool::keyPress(QKeyEvent* event) { if (text_editor) { if (event->key() == Qt::Key_Escape) { finishEditing(); return true; } return text_editor->keyPressEvent(event); } int num_selected_objects = map()->getNumSelectedObjects(); if (num_selected_objects > 0 && event->key() == delete_object_key) { deleteSelectedObjects(); } else if (num_selected_objects > 0 && event->key() == Qt::Key_Escape) { map()->clearObjectSelection(true); } else if (event->key() == Qt::Key_Control) { if (editingInProgress()) activateAngleHelperWhileEditing(); } else if (event->key() == Qt::Key_Shift && editingInProgress()) { if (hover_state == OverObjectNode && hover_object->getType() == Object::Path && hover_object->asPath()->isCurveHandle(hover_point)) { // In this case, Shift just activates deactivates // the opposite curve handle constraints return true; } activateSnapHelperWhileEditing(); } else if (event->key() == Qt::Key_Space) { space_pressed = true; } else { return false; } updateStatusText(); return true; }
void Ui_ossimQtDataManagerDialog::setupUi(QDialog *ossimQtDataManagerDialog) { if (ossimQtDataManagerDialog->objectName().isEmpty()) ossimQtDataManagerDialog->setObjectName(QString::fromUtf8("ossimQtDataManagerDialog")); ossimQtDataManagerDialog->resize(565, 360); hboxLayout = new QHBoxLayout(ossimQtDataManagerDialog); hboxLayout->setSpacing(6); hboxLayout->setMargin(11); hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); theDataManagerListBox = new ossimQtDataManagerListBox(ossimQtDataManagerDialog); theDataManagerListBox->setObjectName(QString::fromUtf8("theDataManagerListBox")); hboxLayout->addWidget(theDataManagerListBox); vboxLayout = new QVBoxLayout(); vboxLayout->setSpacing(6); vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); theDisplayButton = new QPushButton(ossimQtDataManagerDialog); theDisplayButton->setObjectName(QString::fromUtf8("theDisplayButton")); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(0), static_cast<QSizePolicy::Policy>(0)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(theDisplayButton->sizePolicy().hasHeightForWidth()); theDisplayButton->setSizePolicy(sizePolicy); vboxLayout->addWidget(theDisplayButton); theDeleteButton = new QPushButton(ossimQtDataManagerDialog); theDeleteButton->setObjectName(QString::fromUtf8("theDeleteButton")); sizePolicy.setHeightForWidth(theDeleteButton->sizePolicy().hasHeightForWidth()); theDeleteButton->setSizePolicy(sizePolicy); vboxLayout->addWidget(theDeleteButton); theDuplicatButton = new QPushButton(ossimQtDataManagerDialog); theDuplicatButton->setObjectName(QString::fromUtf8("theDuplicatButton")); sizePolicy.setHeightForWidth(theDuplicatButton->sizePolicy().hasHeightForWidth()); theDuplicatButton->setSizePolicy(sizePolicy); vboxLayout->addWidget(theDuplicatButton); theMosaicButton = new QPushButton(ossimQtDataManagerDialog); theMosaicButton->setObjectName(QString::fromUtf8("theMosaicButton")); theMosaicButton->setEnabled(true); vboxLayout->addWidget(theMosaicButton); theBlendButton = new QPushButton(ossimQtDataManagerDialog); theBlendButton->setObjectName(QString::fromUtf8("theBlendButton")); theBlendButton->setEnabled(true); vboxLayout->addWidget(theBlendButton); theFeatherButton = new QPushButton(ossimQtDataManagerDialog); theFeatherButton->setObjectName(QString::fromUtf8("theFeatherButton")); theFeatherButton->setEnabled(true); vboxLayout->addWidget(theFeatherButton); spacerItem = new QSpacerItem(20, 70, QSizePolicy::Minimum, QSizePolicy::Expanding); vboxLayout->addItem(spacerItem); theCloseButton = new QPushButton(ossimQtDataManagerDialog); theCloseButton->setObjectName(QString::fromUtf8("theCloseButton")); sizePolicy.setHeightForWidth(theCloseButton->sizePolicy().hasHeightForWidth()); theCloseButton->setSizePolicy(sizePolicy); vboxLayout->addWidget(theCloseButton); hboxLayout->addLayout(vboxLayout); retranslateUi(ossimQtDataManagerDialog); QObject::connect(theCloseButton, SIGNAL(clicked()), ossimQtDataManagerDialog, SLOT(theCloseButton_clicked())); QObject::connect(theDisplayButton, SIGNAL(clicked()), ossimQtDataManagerDialog, SLOT(theDisplayButton_clicked())); QObject::connect(theDeleteButton, SIGNAL(clicked()), theDataManagerListBox, SLOT(deleteSelectedObjects())); QObject::connect(theDuplicatButton, SIGNAL(clicked()), theDataManagerListBox, SLOT(duplicateSelectedObjects())); QObject::connect(theMosaicButton, SIGNAL(clicked()), theDataManagerListBox, SLOT(mosaicSelectedObjects())); QObject::connect(theBlendButton, SIGNAL(clicked()), theDataManagerListBox, SLOT(blendSelectedObjects())); QObject::connect(theFeatherButton, SIGNAL(clicked()), theDataManagerListBox, SLOT(featherSelectedObjects())); QMetaObject::connectSlotsByName(ossimQtDataManagerDialog); } // setupUi