summaryrefslogtreecommitdiffstats
path: root/examples/serialbus/can/bitratebox.h
blob: a897b70d12bdb43d706ab7540c1c4f57bb4e3942 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (C) 2017 Andre Hartmann <aha_1980@gmx.de>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#ifndef BITRATEBOX_H
#define BITRATEBOX_H

#include <QComboBox>

QT_BEGIN_NAMESPACE
class QIntValidator;
QT_END_NAMESPACE

class BitRateBox : public QComboBox
{
public:
    explicit BitRateBox(QWidget *parent = nullptr);
    ~BitRateBox();

    int bitRate() const;

    bool isFlexibleDataRateEnabled() const;
    void setFlexibleDateRateEnabled(bool enabled);

private slots:
    void checkCustomSpeedPolicy(int idx);

private:
    void fillBitRates();

    bool m_isFlexibleDataRateEnabled = false;
    QIntValidator *m_customSpeedValidator = nullptr;
};

#endif // BITRATEBOX_H