LocationEditor::LocationEditor(QWidget *parent) : QToolButton(parent) { QPalette pal; pal.setColor(backgroundRole(), QPalette::Base); setPalette(pal); this->setFont(global.getGuiFont(font())); inactiveColor = "QToolButton {background-color: transparent; border-radius: 0px; border:none; margin 0px; padding: 4px} "; this->setCursor(Qt::PointingHandCursor); this->setStyleSheet(inactiveColor); defaultText = QString(tr("Click to set location...")); this->setText(defaultText); actionMenu = new QMenu(); editAction = actionMenu->addAction(tr("Edit...")); clearAction = actionMenu->addAction(tr("Clear")); viewAction = actionMenu->addAction(tr("View on map")); connect(editAction, SIGNAL(triggered()), this, SLOT(buttonClicked())); connect(viewAction, SIGNAL(triggered()), this, SLOT(viewClicked())); connect(clearAction, SIGNAL(triggered()), this, SLOT(clearClicked())); setAutoRaise(false); setMenu(actionMenu); this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); this->reloadIcons(); connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked())); hide(); }
QWidget* medDatabaseDataSource::mainViewWidget() { if(d->mainWidget.isNull()) { d->mainWidget = new QWidget; d->largeView = new medDatabaseView(d->mainWidget); d->largeView->setModel(d->proxy); QVBoxLayout *database_layout = new QVBoxLayout(d->mainWidget); database_layout->setContentsMargins(0, 0, 0, 0); database_layout->setSpacing(0); database_layout->addWidget(d->largeView); connect(d->largeView, SIGNAL(open(const medDataIndex&)), this, SIGNAL(open(const medDataIndex&))); connect(d->largeView, SIGNAL(exportData(const medDataIndex&)), this, SIGNAL(exportData(const medDataIndex&))); connect(d->largeView, SIGNAL(dataRemoved(const medDataIndex&)), this, SIGNAL(dataRemoved(const medDataIndex&))); if(!d->toolBoxes.isEmpty()) { connect(d->actionsToolBox, SIGNAL(removeClicked()), d->largeView, SLOT(onRemoveSelectedItemRequested())); connect(d->actionsToolBox, SIGNAL(exportClicked()), d->largeView, SLOT(onExportSelectedItemRequested())); connect(d->actionsToolBox, SIGNAL(viewClicked()), d->largeView, SLOT(onViewSelectedItemRequested())); connect(d->actionsToolBox, SIGNAL(saveClicked()), d->largeView, SLOT(onSaveSelectedItemRequested())); connect(d->actionsToolBox, SIGNAL(newPatientClicked()), d->largeView, SLOT(onCreatePatientRequested())); connect(d->actionsToolBox, SIGNAL(newStudyClicked()), d->largeView, SLOT(onCreateStudyRequested())); connect(d->actionsToolBox, SIGNAL(editClicked()), d->largeView, SLOT(onEditRequested())); connect(d->largeView, SIGNAL(patientClicked(const medDataIndex&)), d->actionsToolBox, SLOT(patientSelected(const medDataIndex&))); connect(d->largeView, SIGNAL(seriesClicked(const medDataIndex&)), d->actionsToolBox, SLOT(seriesSelected(const medDataIndex&))); connect(d->largeView, SIGNAL(noPatientOrSeriesSelected()), d->actionsToolBox, SLOT(noPatientOrSeriesSelected())); connect(d->largeView, SIGNAL(multipleEntriesSelected(const QVector<medDataIndex>&)), d->actionsToolBox, SLOT(multipleEntriesSelected(const QVector<medDataIndex>&))); }
void MonitorGraphicsView::mouseReleaseEvent(QMouseEvent *e) { emit viewClicked(e); QGraphicsView::mouseReleaseEvent(e); }
void SliceViewer::buttonClicked() { emit viewClicked(mOrientation); }