当前位置: 首页>>代码示例>>C++>>正文


C++ QTimeEdit::setRange方法代码示例

本文整理汇总了C++中QTimeEdit::setRange方法的典型用法代码示例。如果您正苦于以下问题:C++ QTimeEdit::setRange方法的具体用法?C++ QTimeEdit::setRange怎么用?C++ QTimeEdit::setRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QTimeEdit的用法示例。


在下文中一共展示了QTimeEdit::setRange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: throw

// -------------------------------------------------------------------------------------------------
ParameterBox::ParameterBox(QWidget* parent, const char* name)
    throw () 
    : QFrame(parent, name), m_leftValue(-1.0), m_rightValue(-1.0)
{
    QGridLayout* layout = new QGridLayout(this, 5 /* row */, 9 /* col */, 0 /* margin */, 5);
    
    // - create ------------------------------------------------------------------------------------
    
    // settings
    Settings& set = Settings::set();
    
    // widgets
    QLabel* timeLabel = new QLabel(tr("&Measuring Time:"), this);
    QLabel* sampleLabel = new QLabel(tr("&Sampling Rate:"), this);
    QLabel* triggerLabel = new QLabel(tr("&Triggering:"), this);
    
    QTimeEdit* timeedit = new QTimeEdit(this);
    timeedit->setRange(QTime(0, 0), QTime(0, 1));
    QSlider* sampleSlider = new QSlider(0, MAX_SLIDER_VALUE, 1, 0, Qt::Horizontal, this);
    TriggerWidget* triggering = new TriggerWidget(this);
    
    // labels for the markers
    QLabel* leftMarkerLabel = new QLabel(tr("Left Button Marker:"), this);
    QLabel* rightMarkerLabel = new QLabel(tr("Right Button Marker:"), this);
    QLabel* diffLabel = new QLabel(tr("Difference:"), this);
    m_leftMarker = new QLabel(this);
    m_rightMarker = new QLabel(this);
    m_diff = new QLabel("zdddd", this);
    
    // set the font for the labels
    QFont font = qApp->font(this);
    font.setPixelSize(15);
    font.setBold(true);
    m_leftMarker->setFont(font);
    m_rightMarker->setFont(font);
    m_diff->setFont(font);
    
    // buddys
    timeLabel->setBuddy(timeedit);
    triggerLabel->setBuddy(triggering);
    sampleLabel->setBuddy(sampleSlider);
    
    // load value
    triggering->setValue(set.readNumEntry("Measuring/Triggering/Value"),
                         set.readNumEntry("Measuring/Triggering/Mask"));
    timeedit->setTime(QTime(0, set.readNumEntry("Measuring/Triggering/Minutes"),
                               set.readNumEntry("Measuring/Triggering/Seconds"))); 
    sampleSlider->setValue(MAX_SLIDER_VALUE - set.readNumEntry("Measuring/Number_Of_Skips"));
    
    // - layout the stuff --------------------------------------------------------------------------
                                   // row, col
    layout->addWidget(timeLabel,           0,    1);
    layout->addWidget(sampleLabel,         1,    1);
    layout->addWidget(triggerLabel,        2,    1,    Qt::AlignTop);
    layout->addWidget(timeedit,            0,    3);
    layout->addWidget(sampleSlider,        1,    3);
    layout->addMultiCellWidget(triggering, 2, 3, 3, 3);
    layout->addWidget(leftMarkerLabel,     0,    5);
    layout->addWidget(rightMarkerLabel,    1,    5);
    layout->addWidget(diffLabel,           2,    5);
    layout->addWidget(m_leftMarker,        0,    7,    Qt::AlignRight);
    layout->addWidget(m_rightMarker,       1,    7,    Qt::AlignRight);
    layout->addWidget(m_diff,              2,    7,    Qt::AlignRight);
    layout->setColStretch(0, 2);
    layout->setColSpacing(2, 20);
    layout->setColStretch(4, 4);
    layout->setColSpacing(6, 20);
    layout->setColSpacing(7, 150);
    layout->setColStretch(8, 2);
    
    connect(timeedit,                   SIGNAL(valueChanged(const QTime&)), 
            this,                       SLOT(timeValueChanged(const QTime&)));
    connect(triggering,                 SIGNAL(valueChanged(byte, byte)), 
            this,                       SLOT(triggerValueChanged(byte, byte)));
    connect(sampleSlider,               SIGNAL(valueChanged(int)),
            this,                       SLOT(sliderValueChanged(int)));
    
    // - initial values ----------------------------------------------------------------------------
    updateValues();
}
开发者ID:BackupTheBerlios,项目名称:tfla-01-svn,代码行数:81,代码来源:parameterbox.cpp


注:本文中的QTimeEdit::setRange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。