SequenceDescription::SequenceDescription(QWidget *parent)
: QFrame(parent),
- layout(new QVBoxLayout),
- name_label(new QLineEdit),
- position_label(new QLabel),
- length_label(new QLabel),
+ layout(0),
+ name_label(0),
+ position_label(0),
+ length_label(0),
pos(-1) // set pos to an invalid value so the setPos function will call
// setText
{
- createWidget();
+ setupWidgets();
}
SequenceDescription::SequenceDescription(
QWidget *parent
) : QFrame(parent)
{
+ setupWidgets();
setGlSequence(glseq);
}
-void SequenceDescription::createWidget()
+void SequenceDescription::setupWidgets()
{
+ layout = new QVBoxLayout;
+ name_label = new QLineEdit;
+ position_label = new QLabel;
+ length_label = new QLabel;
+
setFrameStyle(QFrame::Panel | QFrame::Sunken);
setLineWidth(1);
+
+ // What's this feature descriptions
+ // FIXME: The extra space is added because for some reason
+ // Qt's whatsthis feature is chopping off the last word
+ // under linux.
+ name_label->setWhatsThis("Name of sequence ");
+ position_label->setWhatsThis("Edge of viewport base pair position ");
+ length_label->setWhatsThis("Total length of sequence ");
layout->addWidget(name_label);
layout->addWidget(position_label);
{
if (glseq != glsequence_) {
glsequence_ = glseq;
- setName(glsequence_->sequence()->get_species());
- setLength(glsequence_->sequence()->length());
+ setName(glsequence_->get_species());
+ setLength(glsequence_->size());
emit glsequenceChanged(glsequence_);
}
}
{
std::string std_name_ = name_.toStdString();
- if (std_name_ != glsequence_->sequence()->get_species()) {
- glsequence_->sequence()->set_species(std_name_);
+ if (std_name_ != glsequence_->get_species()) {
+ glsequence_->set_species(std_name_);
emit nameChanged(name_);
}
std::string SequenceDescription::name() const
{
if (glsequence_)
- return glsequence_->sequence()->get_species();
+ return glsequence_->get_species();
else
return string("");
}
return 0;
if (glsequence_)
- return glsequence_->sequence()->size();
+ return glsequence_->size();
else
return 0;
}