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
81530060
Commit
81530060
authored
May 11, 2012
by
Sebastian Eichelbaum
Browse files
[FIX] - older Qt versions do not seem to provide a default parent for QIntValidator
parent
ffa68db5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
2 additions
and
356 deletions
+2
-356
src/qt4gui/qt4/WMainWindow.cpp
src/qt4gui/qt4/WMainWindow.cpp
+0
-6
src/qt4gui/qt4/WMainWindow.h
src/qt4gui/qt4/WMainWindow.h
+0
-3
src/qt4gui/qt4/WQtGLScreenCapture.cpp
src/qt4gui/qt4/WQtGLScreenCapture.cpp
+2
-2
src/qt4gui/qt4/commandPrompt/WQtCommandPrompt.cpp
src/qt4gui/qt4/commandPrompt/WQtCommandPrompt.cpp
+0
-93
src/qt4gui/qt4/commandPrompt/WQtCommandPrompt.h
src/qt4gui/qt4/commandPrompt/WQtCommandPrompt.h
+0
-87
src/qt4gui/qt4/commandPrompt/WQtCommandPromptToolbar.cpp
src/qt4gui/qt4/commandPrompt/WQtCommandPromptToolbar.cpp
+0
-88
src/qt4gui/qt4/commandPrompt/WQtCommandPromptToolbar.h
src/qt4gui/qt4/commandPrompt/WQtCommandPromptToolbar.h
+0
-77
No files found.
src/qt4gui/qt4/WMainWindow.cpp
View file @
81530060
...
...
@@ -452,12 +452,6 @@ void WMainWindow::setupGUI()
showSagittal
->
setText
(
"Toggle Sagittal Slice"
);
showSagittal
->
setIcon
(
m_iconManager
.
getIcon
(
"sagittal icon"
)
);
// Temporarily disabled. We need a proper command prompt implementation first.
// create command prompt toolbar
// m_commandPrompt = new WQtCommandPromptToolbar( "Command Prompt", this );
// addToolBar( Qt::TopToolBarArea, m_commandPrompt );
// this->addAction( m_commandPrompt->toggleViewAction() ); // this enables the action even if the menu bar is invisible
// setup permanent toolbar
m_permanentToolBar
->
addAction
(
m_loadButton
);
m_permanentToolBar
->
addAction
(
projectSaveButton
);
...
...
src/qt4gui/qt4/WMainWindow.h
View file @
81530060
...
...
@@ -41,7 +41,6 @@
#include "WQtGLWidget.h"
#include "WSettingAction.h"
#include "networkEditor/WQtNetworkEditor.h"
#include "commandPrompt/WQtCommandPromptToolbar.h"
// forward declarations
class
QMenuBar
;
...
...
@@ -349,8 +348,6 @@ private:
WQtNetworkEditor
*
m_networkEditor
;
//!< network editor
WQtCommandPromptToolbar
*
m_commandPrompt
;
//!< command prompt
boost
::
shared_ptr
<
WQtGLWidget
>
m_mainGLWidget
;
//!< the main GL widget of the GUI
WQtGLScreenCapture
*
m_mainGLWidgetScreenCapture
;
//!< screen recorder in m_mainGLWidget
...
...
src/qt4gui/qt4/WQtGLScreenCapture.cpp
View file @
81530060
...
...
@@ -90,8 +90,8 @@ WQtGLScreenCapture::WQtGLScreenCapture( WGEViewer::SPtr viewer, WMainWindow* par
m_customWidth
=
new
QLineEdit
(
"1980"
,
this
);
m_customHeight
=
new
QLineEdit
(
"1080"
,
this
);
m_customWidth
->
setValidator
(
new
QIntValidator
(
0
,
4096
)
);
m_customHeight
->
setValidator
(
new
QIntValidator
(
0
,
4096
)
);
m_customWidth
->
setValidator
(
new
QIntValidator
(
0
,
4096
,
m_customWidth
)
);
m_customHeight
->
setValidator
(
new
QIntValidator
(
0
,
4096
,
m_customHeight
)
);
QPushButton
*
resolutionButton
=
new
QPushButton
(
"Set"
);
resolutionButton
->
setCheckable
(
true
);
...
...
src/qt4gui/qt4/commandPrompt/WQtCommandPrompt.cpp
deleted
100644 → 0
View file @
ffa68db5
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#include <iostream>
#include <QtGui/QAction>
#include <QtGui/QLineEdit>
#include <QtGui/QKeyEvent>
#include "../WMainWindow.h"
#include "WQtCommandPrompt.h"
#include "WQtCommandPrompt.moc"
WQtCommandPrompt
::
WQtCommandPrompt
(
QWidget
*
parent
)
:
QLineEdit
(
parent
)
{
// some nice style
// TODO(ebaum): make this configurable
setStyleSheet
(
"color: white;"
"border: 0px solid gray;"
"border-radius: 0px;"
"border-color: #080808;"
"padding: 0 0px;"
"background: #080808;"
"selection-background-color: gray;"
);
setText
(
"Not yet implemented. But as you tried the command prompt I assume you are a cool VIM user ;-)."
);
connect
(
this
,
SIGNAL
(
returnPressed
()
),
this
,
SLOT
(
commit
()
)
);
}
WQtCommandPrompt
::~
WQtCommandPrompt
()
{
// cleanup
}
void
WQtCommandPrompt
::
abort
()
{
setText
(
""
);
emit
done
();
}
void
WQtCommandPrompt
::
commit
()
{
setText
(
""
);
emit
done
();
}
void
WQtCommandPrompt
::
keyPressEvent
(
QKeyEvent
*
event
)
{
QLineEdit
::
keyPressEvent
(
event
);
}
bool
WQtCommandPrompt
::
event
(
QEvent
*
event
)
{
// we need to override this to be able to grab the escape key
if
(
event
->
type
()
==
QEvent
::
KeyRelease
)
{
QKeyEvent
*
keyEvent
=
dynamic_cast
<
QKeyEvent
*
>
(
event
);
// escape quits the prompt
if
(
keyEvent
&&
(
keyEvent
->
key
()
==
Qt
::
Key_Escape
)
)
{
abort
();
event
->
accept
();
return
true
;
}
}
return
QLineEdit
::
event
(
event
);
}
src/qt4gui/qt4/commandPrompt/WQtCommandPrompt.h
deleted
100644 → 0
View file @
ffa68db5
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WQTCOMMANDPROMPT_H
#define WQTCOMMANDPROMPT_H
#include <QtGui/QLineEdit>
/**
* This is a toolbar. It provides a command prompt -like interface for adding, removing and connecting modules
*/
class
WQtCommandPrompt
:
public
QLineEdit
{
Q_OBJECT
public:
/**
* Constructs the prompt.
*
* \param parent the parent widget of this widget, i.e. the widget that manages it.
*/
explicit
WQtCommandPrompt
(
QWidget
*
parent
);
/**
* destructor
*/
virtual
~
WQtCommandPrompt
();
signals:
/**
* Emited if the prompt should quit. On ESC or after commiting a command.
*/
void
done
();
protected:
/**
* Converts the given key press event into a line edit action.
*
* \param event the key
*/
virtual
void
keyPressEvent
(
QKeyEvent
*
event
);
/**
* Event handler
*
* \param event the event
*
* \return true if event was handled.
*/
bool
event
(
QEvent
*
event
);
private
slots
:
/**
* This aborts. The typed command will not be sent.
*/
void
abort
();
/**
* Commit the current command.
*/
void
commit
();
private:
};
#endif // WQTCOMMANDPROMPT_H
src/qt4gui/qt4/commandPrompt/WQtCommandPromptToolbar.cpp
deleted
100644 → 0
View file @
ffa68db5
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#include <QtGui/QAction>
#include <QtGui/QLabel>
#include "../WMainWindow.h"
#include "WQtCommandPrompt.h"
#include "WQtCommandPromptToolbar.h"
#include "WQtCommandPromptToolbar.moc"
WQtCommandPromptToolbar
::
WQtCommandPromptToolbar
(
const
QString
&
title
,
WMainWindow
*
parent
)
:
QToolBar
(
title
,
parent
),
m_mainWindow
(
parent
)
{
setObjectName
(
title
);
this
->
setAllowedAreas
(
Qt
::
TopToolBarArea
|
Qt
::
BottomToolBarArea
);
setMinimumWidth
(
50
);
setMinimumHeight
(
20
);
setVisible
(
false
);
// toggle it using ":"
QList
<
QKeySequence
>
commandPromptShortcut
;
commandPromptShortcut
.
append
(
QKeySequence
(
Qt
::
Key_Colon
)
);
toggleViewAction
()
->
setShortcuts
(
commandPromptShortcut
);
QLabel
*
label
=
new
QLabel
(
this
);
label
->
setText
(
"<b>:</b>"
);
label
->
setStyleSheet
(
"background: #080808;"
);
addWidget
(
label
);
m_prompt
=
new
WQtCommandPrompt
(
this
);
addWidget
(
m_prompt
);
// some nice style
// TODO(ebaum): make this configurable
setStyleSheet
(
"background: #080808;"
"border: 2px solid #080808;"
"margin: 0px;"
"padding: 0px;"
"spacing: 0;"
"color: white;"
);
// if the toolbar is triggered:
connect
(
toggleViewAction
(),
SIGNAL
(
triggered
(
bool
)
),
this
,
SLOT
(
show
()
)
);
connect
(
m_prompt
,
SIGNAL
(
done
()
),
this
,
SLOT
(
exit
()
)
);
}
WQtCommandPromptToolbar
::~
WQtCommandPromptToolbar
()
{
// cleanup
}
void
WQtCommandPromptToolbar
::
show
()
{
setVisible
(
true
);
m_prompt
->
setFocus
();
}
void
WQtCommandPromptToolbar
::
exit
()
{
setVisible
(
false
);
}
src/qt4gui/qt4/commandPrompt/WQtCommandPromptToolbar.h
deleted
100644 → 0
View file @
ffa68db5
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WQTCOMMANDPROMPTTOOLBAR_H
#define WQTCOMMANDPROMPTTOOLBAR_H
#include <QtGui/QToolBar>
class
WQtCommandPrompt
;
class
WMainWindow
;
/**
* This is a toolbar. It provides a command prompt -like interface for adding, removing and connecting modules
*/
class
WQtCommandPromptToolbar
:
public
QToolBar
{
Q_OBJECT
public:
/**
* Constructs the toolbar.
* \param title name of the toolbar.
* \param parent the parent widget of this widget, i.e. the widget that manages it.
*/
explicit
WQtCommandPromptToolbar
(
const
QString
&
title
,
WMainWindow
*
parent
);
/**
* destructor
*/
virtual
~
WQtCommandPromptToolbar
();
protected:
private
slots
:
/**
* Toggles the prompt toolbar
*/
void
show
();
/**
* Exit prompt
*/
void
exit
();
private:
/**
* The main window parent.
*/
WMainWindow
*
m_mainWindow
;
/**
* The actual prompt edit.
*/
WQtCommandPrompt
*
m_prompt
;
};
#endif // WQTCOMMANDPROMPTTOOLBAR_H
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