Fraxinus
22.09
An IGT application
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
cxViewUtilities.cpp
Go to the documentation of this file.
1
/*=========================================================================
2
This file is part of CustusX, an Image Guided Therapy Application.
3
4
Copyright (c) SINTEF Department of Medical Technology.
5
All rights reserved.
6
7
CustusX is released under a BSD 3-Clause license.
8
9
See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10
=========================================================================*/
11
12
#include "
cxViewUtilities.h
"
13
#include <QGridLayout>
14
15
namespace
cx
16
{
17
namespace
view_utils
18
{
19
20
void
setStretchFactors
(QGridLayout* layout,
LayoutRegion
region,
int
stretchFactor)
21
{
22
// set stretch factors for the affected cols to 1 in order to get even distribution
23
for
(
int
i = region.
pos
.
col
; i < region.
pos
.
col
+ region.
span
.
col
; ++i)
24
{
25
if
(i>=0)
26
layout->setColumnStretch(i, stretchFactor);
27
}
28
// set stretch factors for the affected rows to 1 in order to get even distribution
29
for
(
int
i = region.
pos
.
row
; i < region.
pos
.
row
+ region.
span
.
row
; ++i)
30
{
31
if
(i>=0)
32
layout->setRowStretch(i, stretchFactor);
33
}
34
}
35
36
}
// namespace view_utils
37
}
/* namespace cx */
cx::LayoutRegion::span
LayoutPosition span
size of region
Definition:
cxLayoutData.h:46
cx::LayoutPosition::col
int col
column
Definition:
cxLayoutData.h:37
cx::LayoutRegion
Definition:
cxLayoutData.h:40
cx::view_utils::setStretchFactors
void setStretchFactors(QGridLayout *layout, LayoutRegion region, int stretchFactor)
Definition:
cxViewUtilities.cpp:20
cxViewUtilities.h
cx::LayoutPosition::row
int row
row
Definition:
cxLayoutData.h:36
cx::LayoutRegion::pos
LayoutPosition pos
start position of region
Definition:
cxLayoutData.h:45
cx
Namespace for all CustusX production code.
Definition:
cx_dev_group_definitions.h:13
CX
source
resource
view
View
internal
cxViewUtilities.cpp
Generated on Mon Sep 12 2022 13:19:36 for Fraxinus by
1.8.11