+ fix build error, fix memory leaks

This commit is contained in:
wmayer 2013-11-09 18:57:34 +01:00
parent b6a9d7973d
commit b035e9cb0c
2 changed files with 18 additions and 12 deletions

View File

@ -22,6 +22,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <sstream>
#endif
#include <cmath>

View File

@ -22,6 +22,10 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <QContextMenuEvent>
# include <QMenu>
#endif
#include <Base/Console.h>
#include <Base/Quantity.h>
@ -29,6 +33,7 @@
#include <App/Application.h>
#include "InputField.h"
using namespace Gui;
using namespace Base;
@ -64,15 +69,15 @@ void InputField::newInput(const QString & text)
}catch(Base::Exception &e){
ErrorText = e.what();
this->setToolTip(QString::fromAscii(ErrorText.c_str()));
QPalette *palette = new QPalette();
palette->setColor(QPalette::Base,QColor(255,200,200));
setPalette(*palette);
QPalette palette;
palette.setColor(QPalette::Base,QColor(255,200,200));
setPalette(palette);
parseError(QString::fromAscii(ErrorText.c_str()));
return;
}
QPalette *palette = new QPalette();
palette->setColor(QPalette::Base,QColor(200,255,200));
setPalette(*palette);
QPalette palette;
palette.setColor(QPalette::Base,QColor(200,255,200));
setPalette(palette);
ErrorText = "";
this->setToolTip(QString::fromAscii(ErrorText.c_str()));
// signaling
@ -112,9 +117,8 @@ void InputField::setParamGrpPath( const QByteArray& path )
{
_handle = App::GetApplication().GetParameterGroupByPath( path);
if(_handle.isValid())
sGroupString = path;
if (_handle.isValid())
sGroupString = (const char*)path;
}
/** Returns the widget's preferences path. */
@ -122,6 +126,7 @@ QByteArray InputField::paramGrpPath() const
{
if(_handle.isValid())
return sGroupString.c_str();
return QByteArray();
}
/// sets the field with a quantity