Commit 3e654cec authored by schultezub's avatar schultezub
Browse files

* Added title labels to property widgets

 * some minor fixes/improvements

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@209 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 65217c3a
......@@ -23,6 +23,7 @@ namespace TUMVis {
void MainWindow::setup() {
_centralWidget = new QWidget(this);
QHBoxLayout* boxLayout = new QHBoxLayout();
boxLayout->setSpacing(4);
_pipelineWidget = new PipelineTreeWidget(_centralWidget);
boxLayout->addWidget(_pipelineWidget);
......@@ -54,12 +55,7 @@ namespace TUMVis {
// Yak, this is so ugly - another reason why GUI programming sucks...
QVariant item = index.data(Qt::UserRole);
HasPropertyCollection* ptr = static_cast<HasPropertyCollection*>(item.value<void*>());
if (ptr != 0) {
emit updatePropCollectionWidget(ptr);
}
else {
emit updatePropCollectionWidget(0);
}
emit updatePropCollectionWidget(ptr);
}
else {
emit updatePropCollectionWidget(0);
......
......@@ -9,7 +9,11 @@ namespace TUMVis {
, _ignorePropertyUpdates(false)
, _layout(0)
{
_titleLabel = new QLabel(QString::fromStdString(_property->getTitle() + ":"), this);
_layout = new QBoxLayout(QBoxLayout::LeftToRight, this);
_layout->setSpacing(16);
_layout->addWidget(_titleLabel, 0);
_property->s_changed.connect(this, &AbstractPropertyWidget::onPropertyChanged);
}
......
......@@ -2,8 +2,9 @@
#define ABSTRACTPROPERTYWIDGET_H__
#include "sigslot/sigslot.h"
#include <QWidget>
#include <QBoxLayout>
#include <QLabel>
#include <QWidget>
namespace TUMVis {
class AbstractProperty;
......@@ -51,6 +52,7 @@ namespace TUMVis {
virtual void onPropertyChanged(const AbstractProperty* property);
QBoxLayout* _layout;
QLabel* _titleLabel;
};
}
......
......@@ -23,14 +23,14 @@ namespace TUMVis {
}
void PropertyCollectionWidget::updatePropCollection(HasPropertyCollection* propertyCollection) {
// just some dummy implementation for property widget listing:
// remove and delete all widgets of the previous PropertyCollection
for (QList<QWidget*>::iterator it = _widgetList.begin(); it != _widgetList.end(); ++it) {
_layout->removeWidget(*it);
}
qDeleteAll(_widgetList);
_widgetList.clear();
// create widgets for the new PropertyCollection
for (std::vector<AbstractProperty*>::const_iterator it = propertyCollection->getProperties().begin(); it != propertyCollection->getProperties().end(); ++it) {
QWidget* propWidget = PropertyWidgetFactory::createWidget(*it);
if (propWidget == 0)
......
......@@ -3,6 +3,7 @@
#include "tgt/assert.h"
#include "tgt/logmanager.h"
#include "tgt/shadermanager.h"
#include "tgt/texture.h"
#include "tgt/textureunit.h"
namespace TUMVis {
......@@ -19,7 +20,7 @@ namespace TUMVis {
AbstractTransferFunction::~AbstractTransferFunction() {
if (_texture != 0)
LWARNING("Called TranfserFunction dtor without proper deinitialization - you just wasted resources!");
LWARNING("Called AbstractTransferFunction dtor without proper deinitialization - you just wasted resources!");
}
void AbstractTransferFunction::deinit() {
......
......@@ -2,7 +2,6 @@
#define ABSTRACTTRANSFERFUNCTION_H__
#include "sigslot/sigslot.h"
#include "tgt/texture.h"
#include "tgt/vector.h"
#include "tbb/include/tbb/atomic.h"
#include "tbb/include/tbb/mutex.h"
......@@ -11,6 +10,7 @@
namespace tgt {
class Shader;
class Texture;
class TextureUnit;
}
......@@ -29,7 +29,7 @@ namespace TUMVis {
* context. Even though other internals might be changed meanwhile, this ensures that
* the OpenGL stuff (e.g. the texture) stays valid for this time.
*
* \todo Check thread-safety, probably the private local lock is probably not the best design.
* \todo Check thread-safety, the private local lock is probably not the best design.
*/
class AbstractTransferFunction {
public:
......
......@@ -3,6 +3,7 @@
#include "tgt/assert.h"
#include "tgt/logmanager.h"
#include "tgt/shadermanager.h"
#include "tgt/texture.h"
#include "tgt/textureunit.h"
namespace TUMVis {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment