3 #include "qui/seqbrowser/SequenceDescription.hpp"
7 SequenceDescription::SequenceDescription(QWidget *parent)
9 pos(-1) // set pos to an invalid value so the setPos function will call
15 SequenceDescription::SequenceDescription(string name, int length,
18 pos(-1) // set pos to an invalid value so the setPos function will call
26 void SequenceDescription::createWidget()
28 setFrameStyle(QFrame::Panel | QFrame::Sunken);
30 QLayout *layout = new QVBoxLayout;
31 layout->addWidget(&name_label);
32 layout->addWidget(&length_label);
33 layout->addWidget(&position_label);
37 void SequenceDescription::setName(std::string name)
39 if (name != name_label.text().toStdString()) {
40 name_label.setText(name.c_str());
41 emit nameChanged(name);
45 void SequenceDescription::setLength(int length_)
48 float short_length = length_;
49 if (length_ != length) {
50 if (short_length > 1000000) {
51 short_length /= 1000000;
52 s.setNum(short_length, 'f', 2);
54 } if (short_length > 1000) {
56 s.setNum(short_length, 'f', 2);
59 s.setNum(short_length);
62 length_label.setText(s);
64 emit lengthChanged(length);
68 void SequenceDescription::setPosition(int pos_)
73 position_label.setText(s.setNum(pos_));
74 emit positionChanged(pos);