Beispiel #1
0
TrigBar::TrigBar(SigSession &session, QWidget *parent) :
    QToolBar("Trig Bar", parent),
    _session(session),
    _enable(true),
    _trig_button(this),
    _protocol_button(this),
    _measure_button(this),
    _search_button(this),
    _math_button(this)
{
    setMovable(false);
    setContentsMargins(0,0,0,0);

    connect(&_trig_button, SIGNAL(clicked()),
        this, SLOT(trigger_clicked()));
    connect(&_protocol_button, SIGNAL(clicked()),
        this, SLOT(protocol_clicked()));
    connect(&_measure_button, SIGNAL(clicked()),
            this, SLOT(measure_clicked()));
    connect(&_search_button, SIGNAL(clicked()),
            this, SLOT(search_clicked()));

    _trig_button.setIcon(QIcon::fromTheme("trig",
        QIcon(":/icons/trigger.png")));
    _trig_button.setCheckable(true);
    _protocol_button.setIcon(QIcon::fromTheme("trig",
        QIcon(":/icons/protocol.png")));
#ifdef ENABLE_DECODE
    _protocol_button.setCheckable(true);
#endif
    _measure_button.setIcon(QIcon::fromTheme("trig",
        QIcon(":/icons/measure.png")));
    _measure_button.setCheckable(true);
    _search_button.setIcon(QIcon::fromTheme("trig",
        QIcon(":/icons/search-bar.png")));
    _search_button.setCheckable(true);
    _math_button.setIcon(QIcon::fromTheme("trig",
        QIcon(":/icons/math.png")));

    _action_fft = new QAction(this);
    _action_fft->setText(QApplication::translate(
        "Math", "&FFT", 0));
    _action_fft->setIcon(QIcon::fromTheme("Math",
        QIcon(":/icons/fft.png")));
    _action_fft->setObjectName(QString::fromUtf8("actionFft"));
    connect(_action_fft, SIGNAL(triggered()), this, SLOT(on_actionFft_triggered()));

    _math_menu = new QMenu(this);
    _math_menu->setContentsMargins(0,0,0,0);
    _math_menu->addAction(_action_fft);
    _math_button.setPopupMode(QToolButton::InstantPopup);
    _math_button.setMenu(_math_menu);

    _trig_action = addWidget(&_trig_button);
    _protocol_action = addWidget(&_protocol_button);
    _measure_action = addWidget(&_measure_button);
    _search_action = addWidget(&_search_button);
    _math_action = addWidget(&_math_button);
}
Beispiel #2
0
TrigBar::TrigBar(QWidget *parent) :
    QToolBar("Trig Bar", parent),
    _enable(true),
    _trig_button(this),
    _protocol_button(this),
    _measure_button(this),
    _search_button(this)
{
    setMovable(false);

    connect(&_trig_button, SIGNAL(clicked()),
        this, SLOT(trigger_clicked()));
    connect(&_protocol_button, SIGNAL(clicked()),
        this, SLOT(protocol_clicked()));
    connect(&_measure_button, SIGNAL(clicked()),
            this, SLOT(measure_clicked()));
    connect(&_search_button, SIGNAL(clicked()),
            this, SLOT(search_clicked()));

    _trig_button.setIcon(QIcon::fromTheme("trig",
        QIcon(":/icons/trigger.png")));
    _trig_button.setCheckable(true);
    _protocol_button.setIcon(QIcon::fromTheme("trig",
        QIcon(":/icons/protocol.png")));
    _protocol_button.setCheckable(true);
    _measure_button.setIcon(QIcon::fromTheme("trig",
        QIcon(":/icons/measure.png")));
    _measure_button.setCheckable(true);
    _search_button.setIcon(QIcon::fromTheme("trig",
        QIcon(":/icons/search-bar.png")));
    _search_button.setCheckable(true);

    addWidget(&_trig_button);
    addWidget(&_protocol_button);
    addWidget(&_measure_button);
    addWidget(&_search_button);
}