Public Types | Public Member Functions

TimestampHeaderSection Class Reference

Header section for timestamps used in BuilderView. More...

#include <builderview.h>

Inheritance diagram for TimestampHeaderSection:
Inheritance graph
[legend]
Collaboration diagram for TimestampHeaderSection:
Collaboration graph
[legend]

List of all members.

Public Types

enum  TimestampType { TypeRaw, TypeCustom }

Public Member Functions

 TimestampHeaderSection (QWidget *parent=0)
TimestampHeaderSection::TimestampType getTimestampType ()
int getCustomValue ()

Detailed Description

Header section for timestamps used in BuilderView.


Member Enumeration Documentation

Enumerator:
TypeRaw 
TypeCustom 

                      {
        TypeRaw,
        TypeCustom,
    };


Constructor & Destructor Documentation

TimestampHeaderSection::TimestampHeaderSection ( QWidget parent = 0  ) 

                                                                        : HeaderSection(parent){
    setObjectName("TimestampHeaderSection");
    sectionName = new QLabel("Timestamp", this);
    timestampType = new QComboBox(this);
    timestampType->insertItem(0, "Raw", TypeRaw);
    timestampType->insertItem(1, "Custom", TypeCustom);
    timestampType->setCurrentIndex(0);

    connect(timestampType, SIGNAL(currentIndexChanged(int)),
            this, SLOT(slot_timestampTypeAssigned(int)));
    connect(timestampType, SIGNAL(currentIndexChanged(int)),
            this, SIGNAL(signal_userSetting_changed()));

    avgInterval = new QSpinBox(this);
    avgInterval->hide();
    avgInterval->setSuffix(" sec");
    avgInterval->setRange(0, 0xFFFF);
    avgInterval->setValue(60);

    connect(avgInterval, SIGNAL(valueChanged(int)),
            this, SIGNAL(signal_userSetting_changed()), Qt::QueuedConnection);

    vLayout = new QVBoxLayout(this);
    vLayout->addWidget(sectionName);
    vLayout->addStretch();
    vLayout->addWidget(timestampType);
    vLayout->addWidget(avgInterval);
    setLayout(vLayout);
}


Member Function Documentation

int TimestampHeaderSection::getCustomValue (  ) 

{
    if (timestampType->itemData(timestampType->currentIndex(), Qt::UserRole).toInt() == TimestampHeaderSection::TypeCustom)
        return avgInterval->value();
    else
        return -1;
}

TimestampHeaderSection::TimestampType TimestampHeaderSection::getTimestampType (  ) 

{
    return (TimestampHeaderSection::TimestampType) timestampType->itemData(timestampType->currentIndex(), Qt::UserRole).toInt(); //ENUM CAST
}


The documentation for this class was generated from the following files: