Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
David Cazier
CGoGN
Commits
f6a1f2bf
Commit
f6a1f2bf
authored
Mar 31, 2015
by
Sylvain Thery
Browse files
some improvement in SCHNApps
parent
f6dc3b6f
Changes
5
Hide whitespace changes
Inline
Side-by-side
SCHNApps/include/dialogList.h
View file @
f6a1f2bf
...
...
@@ -44,8 +44,6 @@ public:
bool
isChecked
(
const
QString
&
str
);
virtual
QSize
sizeHint
()
const
;
};
...
...
SCHNApps/include/schnapps.h
View file @
f6a1f2bf
...
...
@@ -129,6 +129,8 @@ public:
void
addMenuAction
(
Plugin
*
plugin
,
const
QString
&
menuPath
,
QAction
*
action
);
void
removeMenuAction
(
Plugin
*
plugin
,
QAction
*
action
);
void
statusBarMessage
(
const
QString
&
msg
,
int
msec
);
public
slots
:
void
aboutSCHNApps
();
void
aboutCGoGN
();
...
...
SCHNApps/src/dialogList.cpp
View file @
f6a1f2bf
...
...
@@ -12,7 +12,7 @@ ListPopUp::ListPopUp(const QString& name, QWidget* parent) :
QDialog
(
parent
)
{
setWindowTitle
(
name
);
setWindowFlags
(
windowFlags
()
|
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
|
Qt
::
CustomizeWindowHint
);
setWindowFlags
(
windowFlags
()
/*
| Qt::FramelessWindowHint
*/
|
Qt
::
SplashScreen
|
Qt
::
WindowStaysOnTopHint
|
Qt
::
CustomizeWindowHint
);
m_layout
=
new
QVBoxLayout
(
this
);
setLayout
(
m_layout
);
m_layout
->
setContentsMargins
(
1
,
1
,
1
,
1
);
...
...
@@ -25,11 +25,6 @@ ListPopUp::~ListPopUp()
{
}
QSize
ListPopUp
::
sizeHint
()
const
{
return
QSize
(
170
,
100
);
}
QListWidget
*
ListPopUp
::
list
()
{
return
m_list_items
;
...
...
@@ -40,7 +35,7 @@ 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
)
if
(
height
<
96
)
// 96??
height
=
96
;
m_list_items
->
setFixedHeight
(
height
);
QDialog
::
show
();
...
...
SCHNApps/src/schnapps.cpp
View file @
f6a1f2bf
...
...
@@ -923,6 +923,10 @@ void SCHNApps::closeEvent(QCloseEvent *event)
QMainWindow
::
closeEvent
(
event
);
}
void
SCHNApps
::
statusBarMessage
(
const
QString
&
msg
,
int
msec
)
{
statusbar
->
showMessage
(
msg
,
msec
);
}
}
// namespace SCHNApps
...
...
SCHNApps/src/view.cpp
View file @
f6a1f2bf
...
...
@@ -502,10 +502,30 @@ void View::keyPressEvent(QKeyEvent* event)
if
(
event
->
key
()
==
Qt
::
Key_S
)
{
b_saveSnapshots
=
!
b_saveSnapshots
;
if
(
b_saveSnapshots
)
connect
(
this
,
SIGNAL
(
drawFinished
(
bool
)),
this
,
SLOT
(
saveSnapshot
(
bool
)));
{
QMessageBox
msgBox
;
msgBox
.
setText
(
"Snapshot every frame?"
);
msgBox
.
setStandardButtons
(
QMessageBox
::
Ok
|
QMessageBox
::
Cancel
);
msgBox
.
setDefaultButton
(
QMessageBox
::
Ok
);
if
(
msgBox
.
exec
()
==
QMessageBox
::
Ok
)
{
m_schnapps
->
statusBarMessage
(
"frame snapshot !!"
,
2000
);
connect
(
this
,
SIGNAL
(
drawFinished
(
bool
)),
this
,
SLOT
(
saveSnapshot
(
bool
)));
}
else
{
m_schnapps
->
statusBarMessage
(
"cancel frame snapshot"
,
2000
);
b_saveSnapshots
=
false
;
}
}
else
{
disconnect
(
this
,
SIGNAL
(
drawFinished
(
bool
)),
this
,
SLOT
(
saveSnapshot
(
bool
)));
m_schnapps
->
statusBarMessage
(
"Stop frame snapshot"
,
2000
);
}
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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