Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
a1a6a383
Commit
a1a6a383
authored
Mar 27, 2015
by
Sylvain Thery
Committed by
Pierre Kraemer
Apr 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smaller growing dialogList
parent
de65e00f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
9 deletions
+29
-9
SCHNApps/include/dialogList.h
SCHNApps/include/dialogList.h
+2
-0
SCHNApps/src/controlDock_cameraTab.cpp
SCHNApps/src/controlDock_cameraTab.cpp
+1
-1
SCHNApps/src/dialogList.cpp
SCHNApps/src/dialogList.cpp
+26
-8
No files found.
SCHNApps/include/dialogList.h
View file @
a1a6a383
...
...
@@ -26,6 +26,8 @@ public:
virtual
~
ListPopUp
();
virtual
void
show
();
QListWidget
*
list
();
QListWidgetItem
*
addItem
(
const
QString
&
str
,
Qt
::
CheckState
checked
=
Qt
::
Unchecked
);
...
...
SCHNApps/src/controlDock_cameraTab.cpp
View file @
a1a6a383
...
...
@@ -67,7 +67,7 @@ void ControlDock_CameraTab::selectedCameraChanged()
void
ControlDock_CameraTab
::
cameraProjectionChanged
(
QAbstractButton
*
b
)
{
if
(
!
b_updatingUI
)
if
(
!
b_updatingUI
&&
m_selectedCamera
)
{
if
(
radio_orthographicProjection
->
isChecked
())
m_selectedCamera
->
setProjectionType
(
qglviewer
::
Camera
::
ORTHOGRAPHIC
);
...
...
SCHNApps/src/dialogList.cpp
View file @
a1a6a383
...
...
@@ -8,20 +8,15 @@ namespace CGoGN
namespace
SCHNApps
{
ListPopUp
::
ListPopUp
(
const
QString
&
name
,
QWidget
*
parent
)
:
ListPopUp
::
ListPopUp
(
const
QString
&
name
,
QWidget
*
parent
)
:
QDialog
(
parent
)
{
setWindowTitle
(
name
);
setWindowFlags
(
windowFlags
()
|
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
);
setWindowFlags
(
windowFlags
()
|
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
|
Qt
::
CustomizeWindowHint
);
m_layout
=
new
QVBoxLayout
(
this
);
setLayout
(
m_layout
);
m_layout
->
setContentsMargins
(
1
,
1
,
1
,
1
);
m_list_items
=
new
QListWidget
();
QSizePolicy
test
;
test
.
setHorizontalPolicy
(
QSizePolicy
::
Preferred
);
m_list_items
->
setSizePolicy
(
test
);
m_list_items
->
setSelectionMode
(
QAbstractItemView
::
NoSelection
);
m_layout
->
addWidget
(
m_list_items
);
}
...
...
@@ -32,7 +27,7 @@ ListPopUp::~ListPopUp()
QSize
ListPopUp
::
sizeHint
()
const
{
return
QSize
(
1
50
,
15
0
);
return
QSize
(
1
70
,
10
0
);
}
QListWidget
*
ListPopUp
::
list
()
...
...
@@ -40,11 +35,33 @@ QListWidget* ListPopUp::list()
return
m_list_items
;
}
void
ListPopUp
::
show
()
{
int
rows
=
m_list_items
->
model
()
->
rowCount
();
int
rowSize
=
m_list_items
->
sizeHintForRow
(
0
);
int
height
=
rows
*
rowSize
+
6
;
if
(
height
<
96
)
height
=
96
;
m_list_items
->
setFixedHeight
(
height
);
QDialog
::
show
();
}
QListWidgetItem
*
ListPopUp
::
addItem
(
const
QString
&
str
,
Qt
::
CheckState
checked
)
{
QListWidgetItem
*
item
=
new
QListWidgetItem
(
str
,
m_list_items
);
item
->
setCheckState
(
checked
);
int
rows
=
m_list_items
->
model
()
->
rowCount
();
int
rowSize
=
m_list_items
->
sizeHintForRow
(
0
);
int
height
=
rows
*
rowSize
;
if
(
height
>=
m_list_items
->
size
().
height
())
m_list_items
->
setFixedHeight
(
height
+
6
);
//QFontMetrics fm(m_list_items->font());
//int maxTextWidth = fm.width(item->text());
//if (maxTextWidth < 140)
// maxTextWidth = 140;
//m_list_items->setFixedWidth(maxTextWidth + 40);
return
item
;
}
...
...
@@ -72,6 +89,7 @@ bool ListPopUp::removeItem(const QString& str)
if
(
items
.
empty
())
return
false
;
m_list_items
->
takeItem
(
m_list_items
->
row
(
items
[
0
]));
return
true
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment