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
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
a65a3063
Commit
a65a3063
authored
Feb 10, 2013
by
Sebastian Eichelbaum
Browse files
[CHANGE
#239
] the screen recorder setup dialog is now also available via the views title bar.
parent
afd0294d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
33 deletions
+39
-33
src/qt4gui/WMainWindow.cpp
src/qt4gui/WMainWindow.cpp
+0
-6
src/qt4gui/WMainWindow.h
src/qt4gui/WMainWindow.h
+0
-3
src/qt4gui/WQtGLDockWidget.cpp
src/qt4gui/WQtGLDockWidget.cpp
+24
-15
src/qt4gui/WQtGLDockWidget.h
src/qt4gui/WQtGLDockWidget.h
+5
-0
src/qt4gui/WQtGLScreenCapture.cpp
src/qt4gui/WQtGLScreenCapture.cpp
+8
-7
src/qt4gui/WQtGLScreenCapture.h
src/qt4gui/WQtGLScreenCapture.h
+2
-2
No files found.
src/qt4gui/WMainWindow.cpp
View file @
a65a3063
...
...
@@ -244,10 +244,7 @@ void WMainWindow::setupGUI()
WQtGLDockWidget
*
mainGLDock
=
new
WQtGLDockWidget
(
"Main View"
,
"3D View"
,
m_glDock
);
mainGLDock
->
getGLWidget
()
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
m_mainGLWidget
=
mainGLDock
->
getGLWidget
();
// m_mainGLWidgetScreenCapture = mainGLDock->getScreenCapture();
m_glDock
->
addDockWidget
(
Qt
::
RightDockWidgetArea
,
mainGLDock
);
// addDockWidget( Qt::RightDockWidgetArea, m_mainGLWidgetScreenCapture );
// tabifyDockWidget( m_controlPanel->getRoiDock(), m_mainGLWidgetScreenCapture );
connect
(
m_mainGLWidget
.
get
(),
SIGNAL
(
renderedFirstFrame
()
),
this
,
SLOT
(
handleGLVendor
()
)
);
addDockWidget
(
Qt
::
RightDockWidgetArea
,
m_controlPanel
);
...
...
@@ -415,8 +412,6 @@ void WMainWindow::setupGUI()
m_permanentToolBar
->
addAction
(
m_loadButton
);
m_permanentToolBar
->
addAction
(
m_saveAction
);
m_permanentToolBar
->
addSeparator
();
// m_permanentToolBar->addAction( m_mainGLWidgetScreenCapture->getScreenshotTrigger() );
m_permanentToolBar
->
addSeparator
();
m_permanentToolBar
->
addAction
(
roiButton
);
m_permanentToolBar
->
addSeparator
();
m_permanentToolBar
->
addAction
(
showAxial
);
...
...
@@ -1290,7 +1285,6 @@ void WMainWindow::addGlobalMenu( QWidget* widget )
widget
->
addAction
(
m_saveAction
);
widget
->
addAction
(
createSeperator
(
this
)
);
widget
->
addAction
(
m_viewAction
);
widget
->
addAction
(
m_cameraAction
);
widget
->
addAction
(
m_settingsAction
);
widget
->
addAction
(
createSeperator
(
this
)
);
widget
->
addAction
(
m_helpAction
);
...
...
src/qt4gui/WMainWindow.h
View file @
a65a3063
...
...
@@ -391,9 +391,6 @@ private:
QAction
*
m_viewAction
;
//!< the view controls
QMenu
*
m_viewMenu
;
//!< view and camera control menu
QAction
*
m_cameraAction
;
//!< the camera controls
QMenu
*
m_cameraMenu
;
//!< the camera menu
QAction
*
m_settingsAction
;
//!< the settings
QMenu
*
m_settingsMenu
;
//!< the settings
...
...
src/qt4gui/WQtGLDockWidget.cpp
View file @
a65a3063
...
...
@@ -23,6 +23,7 @@
//---------------------------------------------------------------------------
#include <QtGui/QAction>
#include <QtGui/QWidgetAction>
#include <QtGui/QDockWidget>
#include <QtGui/QVBoxLayout>
#include <QtGui/QHBoxLayout>
...
...
@@ -70,7 +71,7 @@ WQtGLDockWidget::WQtGLDockWidget( QString viewTitle, QString dockTitle, QWidget*
// all view docks have a screen capture object
m_screenCapture
=
new
WQtGLScreenCapture
(
this
);
// hide the screen capture object by default
m_screenCapture
->
setHidden
(
true
);
//
m_screenCapture->setHidden( true );
// set custom title
setTitleBarWidget
(
new
WQtGLDockWidgetTitle
(
this
,
dockTitle
)
);
...
...
@@ -113,24 +114,34 @@ void setupButton( QToolButton* btn )
{
btn
->
setToolButtonStyle
(
Qt
::
ToolButtonIconOnly
);
btn
->
setContentsMargins
(
0
,
0
,
0
,
0
);
btn
->
setFixedWidth
(
24
);
//
btn->setFixedWidth( 24 );
btn
->
setFixedHeight
(
24
);
btn
->
setAutoRaise
(
true
);
}
WQtGLDockWidgetTitle
::
WQtGLDockWidgetTitle
(
WQtGLDockWidget
*
parent
,
const
QString
&
dockTitle
)
:
QWidget
(
parent
)
{
QFrame
*
line
=
new
QFrame
();
line
->
setFrameShape
(
QFrame
::
VLine
);
line
->
setFrameShadow
(
QFrame
::
Sunken
);
// screen capture trigger
QToolButton
*
screenShotBtn
=
new
QToolButton
(
this
);
screenShotBtn
->
setDefaultAction
(
parent
->
getScreenCapture
()
->
getScreenshotTrigger
()
);
setupButton
(
screenShotBtn
);
QMenu
*
m
=
new
QMenu
();
QWidgetAction
*
a
=
new
QWidgetAction
(
this
);
a
->
setDefaultWidget
(
parent
->
getScreenCapture
()
);
m
->
addAction
(
a
);
screenShotBtn
->
setMenu
(
m
);
screenShotBtn
->
setPopupMode
(
QToolButton
::
MenuButtonPopup
);
// camera presets
QAction
*
camPresets
=
new
QAction
(
WQt4Gui
::
getIconManager
()
->
getIcon
(
"view"
),
"Camera Presets"
,
this
);
camPresets
->
setMenu
(
parent
->
getGLWidget
()
->
getCameraPresetsAndResetMenu
()
);
QToolButton
*
presetBtn
=
new
QToolButton
(
this
);
presetBtn
->
setDefaultAction
(
camPresets
);
presetBtn
->
setPopupMode
(
QToolButton
::
InstantPopup
);
presetBtn
->
setDefaultAction
(
parent
->
getGLWidget
()
->
getCameraResetAction
()
);
presetBtn
->
setMenu
(
parent
->
getGLWidget
()
->
getCameraPresetsMenu
()
);
presetBtn
->
setPopupMode
(
QToolButton
::
MenuButtonPopup
);
setupButton
(
presetBtn
);
QToolButton
*
settingsBtn
=
new
QToolButton
(
this
);
...
...
@@ -166,19 +177,11 @@ WQtGLDockWidgetTitle::WQtGLDockWidgetTitle( WQtGLDockWidget* parent, const QStri
layout
->
addStretch
(
100000
);
layout
->
addWidget
(
screenShotBtn
);
layout
->
addWidget
(
presetBtn
);
layout
->
addWidget
(
line
);
layout
->
addWidget
(
settingsBtn
);
layout
->
addWidget
(
closeBtn
);
setSizePolicy
(
QSizePolicy
(
QSizePolicy
::
Minimum
,
QSizePolicy
::
Fixed
)
);
setStyleSheet
(
"QToolButton{"
"border-style: none;"
"}"
"QPushButton{"
"border-style: none;"
"}"
);
}
WQtGLScreenCapture
*
WQtGLDockWidget
::
getScreenCapture
()
...
...
@@ -203,3 +206,9 @@ const QString& WQtGLDockWidget::getDockTitle() const
{
return
m_dockTitle
;
}
void
WQtGLDockWidget
::
openScreenCaptureConfig
()
{
m_screenCapture
->
setWindowFlags
(
Qt
::
Tool
);
m_screenCapture
->
show
();
}
src/qt4gui/WQtGLDockWidget.h
View file @
a65a3063
...
...
@@ -92,6 +92,11 @@ public:
*/
const
QString
&
getDockTitle
()
const
;
public
slots
:
/**
* Open screen capture config options
*/
void
openScreenCaptureConfig
();
protected:
/**
...
...
src/qt4gui/WQtGLScreenCapture.cpp
View file @
a65a3063
...
...
@@ -43,18 +43,19 @@
#include "WQtGLScreenCapture.moc"
WQtGLScreenCapture
::
WQtGLScreenCapture
(
WQtGLDockWidget
*
parent
)
:
Q
Dock
Widget
(
"Recorder"
,
parent
),
QWidget
(
parent
),
m_glDockWidget
(
parent
),
m_viewer
(
m_glDockWidget
->
getGLWidget
()
->
getViewer
()
)
{
// initialize
setObjectName
(
"Recorder Dock"
);
setAllowedAreas
(
Qt
::
AllDockWidgetAreas
);
setFeatures
(
QDockWidget
::
AllDockWidgetFeatures
);
setObjectName
(
"Recorder Dock - "
+
parent
->
getDockTitle
()
);
setWindowTitle
(
"Recorder - "
+
parent
->
getDockTitle
()
);
// create our toolbox and add it to the main layout
m_toolbox
=
new
QToolBox
(
this
);
setWidget
(
m_toolbox
);
QHBoxLayout
*
layout
=
new
QHBoxLayout
(
this
);
layout
->
addWidget
(
m_toolbox
);
connect
(
m_toolbox
,
SIGNAL
(
currentChanged
(
int
)
),
this
,
SLOT
(
toolBoxChanged
(
int
)
)
);
/////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -331,7 +332,7 @@ bool WQtGLScreenCapture::event( QEvent* event )
}
}
return
Q
Dock
Widget
::
event
(
event
);
return
QWidget
::
event
(
event
);
}
void
WQtGLScreenCapture
::
screenShot
()
...
...
src/qt4gui/WQtGLScreenCapture.h
View file @
a65a3063
...
...
@@ -29,7 +29,7 @@
#include <boost/signals2.hpp>
#include <QtGui/Q
Dock
Widget>
#include <QtGui/QWidget>
#include <QtGui/QToolBox>
#include <QtGui/QPushButton>
#include <QtGui/QLabel>
...
...
@@ -49,7 +49,7 @@ class WQtGLDockWidget;
/**
* This class is a screen recorder adapter in QT. It uses WGEScreenCapture and provides a nice widget around it.
*/
class
WQtGLScreenCapture
:
public
Q
Dock
Widget
class
WQtGLScreenCapture
:
public
QWidget
{
Q_OBJECT
public:
...
...
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