View click highlight.

This commit is contained in:
Krad
2022-04-02 16:06:11 +08:00
parent 059d62228e
commit 6f67e3fd78
3 changed files with 9 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
#include "view/dicomimageview.h"
#include "view/dicomimageview.h"
#include <QMessageBox>
#include <QDebug>
#include <QMimeData>
@@ -42,11 +42,12 @@ DicomImageView::DicomImageView(QWidget* parent)
controlLayout->addWidget(_glWidt, 0, 0);
//add scrollbar to container
_scrollBar = new QScrollBar(Qt::Orientation::Vertical);
_scrollBar = new ClickableScrollBar(Qt::Orientation::Vertical, this);
_scrollBar->setFocusPolicy(Qt::StrongFocus);
_scrollBar->setVisible(false);
_scrollBar->setObjectName("scrollbar");
controlLayout->addWidget(_scrollBar, 0, 1);
connect(_scrollBar, &ClickableScrollBar::clicked,this,&DicomImageView::viewerClicked);
//config container UI
controlLayout->setContentsMargins(0, 0, 0, 0);
@@ -379,6 +380,7 @@ void DicomImageView::LoadSeries(SeriesImageSet *series)
//目前 替换了一部分包括SlicedEventEndDollyEventEndWindowLevelEventEndPanEvent主要关联到sync
ActorDraggableInteractorStyle *style = _ImageViewer->GetInteractorStyle();
style->AddObserver(ActorDraggableInteractorStyle::AfterViewerClicked, this, &DicomImageView::viewerClicked);
style->AddObserver(vtkCommand::EventIds::WindowLevelEvent, this, &DicomImageView::updateWindowLevelCb);
style->AddObserver(ActorDraggableInteractorStyle::DoubleClickEvent, this, &DicomImageView::doubleclickedEventCb);
style->AddObserver(ActorDraggableInteractorStyle::ScalarOpacityEvent, this, &DicomImageView::scalarEventCb);

View File

@@ -1,7 +1,7 @@
#pragma once
#pragma once
#include <QFrame>
#include <QOpenGLWidget>
#include <QScrollBar>
#include "ClickableScrollBar.h"
#include <QGridLayout>
#include "base/SeriesImageSet.h"
@@ -147,6 +147,7 @@ public slots:
void Slot_scrollValueChanged(int);
void Slot_WindowLevelEventForFusion(double level, double width);
void Slot_UpdateOrienInfo(TransFormType);
void viewerClicked();
protected:
/**
@@ -214,7 +215,7 @@ private:
infinitiViewer* _ImageViewer = nullptr;
SeriesImageSet* _Series = nullptr;
QScrollBar* _scrollBar =nullptr;
ClickableScrollBar* _scrollBar =nullptr;
MyTitleBar *_titleBar =nullptr;
QVTKOpenGLNativeWidget* _glWidt = nullptr;
pqVCRToolbar* _vcr_toolbar = nullptr;

View File

@@ -209,6 +209,7 @@ void MyTitleBar::SetHighlight(bool yes) {
//setBackgroundColor(UnpickTitleRGB);
//setStyleSheet(QString::fromUtf8("border:10px solid red"));
}
this->update();
}
//void MyTitleBar::mouseMoveEvent(QMouseEvent *event)
//{