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
aa7d450d
Commit
aa7d450d
authored
Mar 10, 2010
by
Alexander Wiebel
Browse files
[ADD
#256
] draft of new widget for sorting the etxtures
parent
597c50d8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
172 additions
and
26 deletions
+172
-26
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp
+5
-16
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.h
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.h
+3
-10
src/gui/qt4/datasetbrowser/WQtTextureSorter.cpp
src/gui/qt4/datasetbrowser/WQtTextureSorter.cpp
+93
-0
src/gui/qt4/datasetbrowser/WQtTextureSorter.h
src/gui/qt4/datasetbrowser/WQtTextureSorter.h
+71
-0
No files found.
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp
View file @
aa7d450d
...
...
@@ -43,6 +43,7 @@
#include "../events/WEventTypes.h"
#include "WQtNumberEdit.h"
#include "WQtNumberEditDouble.h"
#include "WQtTextureSorter.h"
#include "../../../kernel/WModuleFactory.h"
#include "../WMainWindow.h"
...
...
@@ -64,25 +65,15 @@ WQtDatasetBrowser::WQtDatasetBrowser( WMainWindow* parent )
m_treeWidget
->
setDropIndicatorShown
(
true
);
m_treeWidget
->
setDragDropMode
(
QAbstractItemView
::
InternalMove
);
m_textureSorter
=
new
WQtTextureSorter
(
m_panel
);
m_textureSorter
->
setToolTip
(
"Reorder the textures."
);
m_tabWidget
=
new
QTabWidget
(
m_panel
);
m_layout
=
new
QVBoxLayout
();
QHBoxLayout
*
buttonLayout
=
new
QHBoxLayout
();
m_downButton
=
new
QPushButton
();
m_downButton
->
setText
(
QString
(
"down"
)
);
m_upButton
=
new
QPushButton
();
m_upButton
->
setText
(
QString
(
"up"
)
);
// TODO(all): reenable these buttons if sorting works again
m_downButton
->
setDisabled
(
true
);
m_upButton
->
setDisabled
(
true
);
buttonLayout
->
addWidget
(
m_downButton
);
buttonLayout
->
addWidget
(
m_upButton
);
m_layout
->
addWidget
(
m_treeWidget
);
m_layout
->
add
Layout
(
buttonLayout
);
m_layout
->
add
Widget
(
m_textureSorter
);
m_layout
->
addWidget
(
m_tabWidget
);
m_panel
->
setLayout
(
m_layout
);
...
...
@@ -112,8 +103,6 @@ void WQtDatasetBrowser::connectSlots()
{
connect
(
m_treeWidget
,
SIGNAL
(
itemSelectionChanged
()
),
this
,
SLOT
(
selectTreeItem
()
)
);
connect
(
m_treeWidget
,
SIGNAL
(
itemClicked
(
QTreeWidgetItem
*
,
int
)
),
this
,
SLOT
(
changeTreeItem
()
)
);
connect
(
m_upButton
,
SIGNAL
(
pressed
()
),
this
,
SLOT
(
moveTreeItemUp
()
)
);
connect
(
m_downButton
,
SIGNAL
(
pressed
()
),
this
,
SLOT
(
moveTreeItemDown
()
)
);
}
...
...
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.h
View file @
aa7d450d
...
...
@@ -32,6 +32,7 @@
#include <QtGui/QTabWidget>
#include <QtGui/QVBoxLayout>
#include <QtGui/QWidget>
#include <QtGui/QListWidget>
#include "../../../dataHandler/WDataSet.h"
#include "../../../graphicsEngine/WROI.h"
...
...
@@ -42,6 +43,7 @@
#include "WQtRoiHeaderTreeItem.h"
#include "WQtSubjectTreeItem.h"
#include "WQtTreeWidget.h"
#include "WQtTextureSorter.h"
class
WMainWindow
;
...
...
@@ -159,19 +161,10 @@ protected:
private:
WQtTreeWidget
*
m_treeWidget
;
//!< pointer to the tree widget
WQtTextureSorter
*
m_textureSorter
;
//!< pointer to the tree widget
QTabWidget
*
m_tabWidget
;
//!< pointer to the tab widget
QPushButton
*
m_downButton
;
//!< button down
QPushButton
*
m_upButton
;
//!< button up
QWidget
*
m_tab1
;
//!< tab 1
QWidget
*
m_tab2
;
//!< tab 2
QWidget
*
m_tab3
;
//!< tab 3
QWidget
*
m_panel
;
//!< panel
QVBoxLayout
*
m_layout
;
//!< layout
...
...
src/gui/qt4/datasetbrowser/WQtTextureSorter.cpp
0 → 100644
View file @
aa7d450d
//---------------------------------------------------------------------------
//
// 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 <map>
#include <set>
#include <string>
#include <vector>
#include <QtCore/QList>
#include <QtGui/QScrollArea>
#include <QtGui/QVBoxLayout>
#include "../../../common/WLogger.h"
#include "../../../common/WPreferences.h"
#include "../../../dataHandler/WDataSet.h"
#include "WQtTextureSorter.h"
#include "../events/WModuleAssocEvent.h"
#include "../events/WRoiAssocEvent.h"
#include "../events/WModuleReadyEvent.h"
#include "../events/WEventTypes.h"
#include "WQtNumberEdit.h"
#include "WQtNumberEditDouble.h"
#include "../../../kernel/WModuleFactory.h"
#include "../WMainWindow.h"
#include "../../../modules/data/WMData.h"
WQtTextureSorter
::
WQtTextureSorter
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
m_textureListWidget
=
new
QListWidget
(
this
);
m_textureListWidget
->
setToolTip
(
"List of available textures."
);
m_layout
=
new
QVBoxLayout
();
QHBoxLayout
*
buttonLayout
=
new
QHBoxLayout
();
m_downButton
=
new
QPushButton
();
m_downButton
->
setText
(
QString
(
"down"
)
);
m_upButton
=
new
QPushButton
();
m_upButton
->
setText
(
QString
(
"up"
)
);
// TODO(all): reenable these buttons if sorting works again
m_downButton
->
setDisabled
(
true
);
m_upButton
->
setDisabled
(
true
);
buttonLayout
->
addWidget
(
m_downButton
);
buttonLayout
->
addWidget
(
m_upButton
);
m_layout
->
addWidget
(
m_textureListWidget
);
m_layout
->
addLayout
(
buttonLayout
);
setLayout
(
m_layout
);
}
WQtTextureSorter
::~
WQtTextureSorter
()
{
}
void
WQtTextureSorter
::
moveItemDown
()
{
// m_treeWidget->moveTreeItemDown();
}
void
WQtTextureSorter
::
moveItemUp
()
{
// m_treeWidget->moveTreeItemUp();
}
src/gui/qt4/datasetbrowser/WQtTextureSorter.h
0 → 100644
View file @
aa7d450d
//---------------------------------------------------------------------------
//
// 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 WQTTEXTURESORTER_H
#define WQTTEXTURESORTER_H
#include <QtGui/QWidget>
#include <QtGui/QListWidget>
#include <QtGui/QPushButton>
/**
* container widget for a tree widget with context menu and some control widgets
*/
class
WQtTextureSorter
:
public
QWidget
{
public:
/**
* Default constructor.
*
* \param parent Parent widget.
*
* \return
*/
explicit
WQtTextureSorter
(
QWidget
*
parent
=
0
);
/**
* Destructor.
*/
virtual
~
WQtTextureSorter
();
private:
QListWidget
*
m_textureListWidget
;
//!< pointer to the tree widget
QVBoxLayout
*
m_layout
;
//!< Layout of the widget
QPushButton
*
m_downButton
;
//!< button down
QPushButton
*
m_upButton
;
//!< button up
private
slots
:
/**
* change order of items, move currently selected item down
*/
void
moveItemDown
();
/**
* change order of items, move currently selected item up
*/
void
moveItemUp
();
};
#endif // WQTTEXTURESORTER_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