Skip to content

Commit

Permalink
Merge pull request #52 from AlizaMedicalImaging/sf
Browse files Browse the repository at this point in the history
Improve Multi-view
  • Loading branch information
issakomi committed Apr 22, 2024
2 parents 9fc46d7 + 22fdab1 commit e64ca3c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
16 changes: 8 additions & 8 deletions GUI/studyviewwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ StudyViewWidget::StudyViewWidget(bool vertical, bool tab, float si)
l2->setContentsMargins(0, 0, 0, 0);
l2->setSpacing(0);
l2->addWidget(lutwidget);
QGridLayout * gridLayout = new QGridLayout(frame);
QGridLayout * gridLayout = new QGridLayout(scrollAreaWidgetContents);
(void)gridLayout;
//
if (in_tab)
Expand Down Expand Up @@ -110,7 +110,7 @@ StudyViewWidget::StudyViewWidget(bool vertical, bool tab, float si)

StudyViewWidget::~StudyViewWidget()
{
QGridLayout * layout = static_cast<QGridLayout*>(frame->layout());
QGridLayout * layout = static_cast<QGridLayout*>(scrollAreaWidgetContents->layout());
if (layout)
{
const int r = layout->rowCount();
Expand Down Expand Up @@ -219,7 +219,7 @@ void StudyViewWidget::clear_()
}
}
}
QGridLayout * layout = static_cast<QGridLayout*>(frame->layout());
QGridLayout * layout = static_cast<QGridLayout*>(scrollAreaWidgetContents->layout());
if (!layout) return;
const int r = layout->rowCount();
const int c = layout->columnCount();
Expand All @@ -240,7 +240,7 @@ void StudyViewWidget::clear_()
}
}
delete layout;
layout = new QGridLayout(frame);
layout = new QGridLayout(scrollAreaWidgetContents);
}

bool StudyViewWidget::get_in_tab() const
Expand Down Expand Up @@ -457,7 +457,7 @@ void StudyViewWidget::update_grid(int r, int c)
}
}
}
QGridLayout * layout = static_cast<QGridLayout*>(frame->layout());
QGridLayout * layout = static_cast<QGridLayout*>(scrollAreaWidgetContents->layout());
if (layout)
{
const int ar = layout->rowCount();
Expand All @@ -481,7 +481,7 @@ void StudyViewWidget::update_grid(int r, int c)
delete layout;
layout = nullptr;
}
QGridLayout * gridLayout = new QGridLayout(frame);
QGridLayout * gridLayout = new QGridLayout(scrollAreaWidgetContents);
int j = 0;
for (int x = 0; x < r; ++x)
{
Expand Down Expand Up @@ -1086,7 +1086,7 @@ void StudyViewWidget::update_all_sliders(int wid, int x, int dimz)

void StudyViewWidget::set_single(int wid)
{
QGridLayout * layout = static_cast<QGridLayout*>(frame->layout());
QGridLayout * layout = static_cast<QGridLayout*>(scrollAreaWidgetContents->layout());
if (!layout)
{
// should never happen
Expand Down Expand Up @@ -1139,7 +1139,7 @@ void StudyViewWidget::set_single(int wid)
active_id = -1;
if (selected)
{
QGridLayout * gridLayout = new QGridLayout(frame);
QGridLayout * gridLayout = new QGridLayout(scrollAreaWidgetContents);
gridLayout->addWidget(selected, 0, 0);
selected->show();
if (selected->graphicswidget)
Expand Down
22 changes: 15 additions & 7 deletions GUI/studyviewwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,26 @@
</widget>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>992</width>
<height>636</height>
</rect>
</property>
</widget>
</widget>
</item>
<item>
Expand Down Expand Up @@ -522,6 +529,7 @@
</layout>
</widget>
<tabstops>
<tabstop>scrollArea</tabstop>
<tabstop>lock_pushButton</tabstop>
<tabstop>center_doubleSpinBox</tabstop>
<tabstop>width_doubleSpinBox</tabstop>
Expand Down

0 comments on commit e64ca3c

Please sign in to comment.