void LegendItem::contextMenuEvent(QContextMenuEvent* event) { QMenu menu; menu.addAction("Guarantee visibility", this, SIGNAL(GuaranteeVisibility())); menu.addSeparator(); menu.addAction("Select samples", this, SIGNAL(SelectSamples())); menu.addSeparator(); menu.addAction("Change properties", this, SIGNAL(ChangeProperties())); menu.exec(event->globalPos()); }
void ezNonUniformBoxManipulatorAdapter::GizmoEventHandler(const ezGizmoEvent& e) { switch (e.m_Type) { case ezGizmoEvent::Type::BeginInteractions: BeginTemporaryInteraction(); break; case ezGizmoEvent::Type::CancelInteractions: CancelTemporayInteraction(); break; case ezGizmoEvent::Type::EndInteractions: EndTemporaryInteraction(); break; case ezGizmoEvent::Type::Interaction: { const ezNonUniformBoxManipulatorAttribute* pAttr = static_cast<const ezNonUniformBoxManipulatorAttribute*>(m_pManipulatorAttr); const ezVec3 neg = m_Gizmo.GetNegSize(); const ezVec3 pos = m_Gizmo.GetPosSize(); if (pAttr->HasSixAxis()) { ChangeProperties(pAttr->GetNegXProperty(), neg.x, pAttr->GetPosXProperty(), pos.x, pAttr->GetNegYProperty(), neg.y, pAttr->GetPosYProperty(), pos.y, pAttr->GetNegZProperty(), neg.z, pAttr->GetPosZProperty(), pos.z); } else { ChangeProperties(pAttr->GetSizeXProperty(), pos.x * 2, pAttr->GetSizeYProperty(), pos.y * 2, pAttr->GetSizeZProperty(), pos.z * 2); } } break; } }
LegendItem::LegendItem(QWidget* parent): QWidget(parent) { QHBoxLayout* layout = new QHBoxLayout(this); layout->setAlignment(Qt::AlignVCenter); layout->setMargin(0); m_checkbox = new QCheckBox(this); m_checkbox->setChecked(true); layout->addWidget(m_checkbox); m_legendItem = new QwtLegendItem(this); layout->addWidget(m_legendItem); QObject::connect(m_legendItem, SIGNAL(clicked()), this, SIGNAL(ChangeProperties())); QObject::connect(m_checkbox, SIGNAL(stateChanged(int)), this, SIGNAL(CheckboxClicked())); }