Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95102115
valuevisual.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Dec 12, 21:16
Size
764 B
Mime Type
text/x-c
Expires
Sat, Dec 14, 21:16 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22930172
Attached To
rSYMKIT symkit
valuevisual.cpp
View Options
#include "valuevisual.h"
#include <QLabel>
#include <QHBoxLayout>
Valuevisual::Valuevisual(const QString& name, double init, QWidget *parent)
: QWidget(parent)
{
this->name = new QLabel(name, this);
visual = new QLabel(QString::number(init, 'g', 4), this);
this->name->setBuddy(visual);
layout = new QHBoxLayout;
layout->addWidget(this->name);
layout->addWidget(visual);
setLayout(layout);
}
Valuevisual::~Valuevisual()
{
delete name;
delete visual;
delete layout;
}
QString Valuevisual::getName() const
{
return name->text();
}
void Valuevisual::setValue(double value)
{
visual->setText(QString::number(value, 'g', 4));
}
double Valuevisual::getValue() const
{
return visual->text().toDouble();
}
Event Timeline
Log In to Comment