if (argc - optind > 1) {
fprintf(stderr, "Only one file can be opened.\n");
return 1;
- } else if (argc - optind == 1) {
- open_file = argv[argc - 1];
}
+ if (argc - optind == 1)
+ open_file = argv[argc - 1];
+
// Initialise libsigrok
context = sigrok::Context::create();
#ifdef ANDROID
}
}
- if (val)
- return Glib::VariantBase(val, true);
- else
- return Glib::VariantBase();
+ return (val) ? Glib::VariantBase(val, true) : Glib::VariantBase();
}
void Decoder::setter(const char *id, Glib::VariantBase value)
const int AnalogSegment::EnvelopeScalePower = 4;
const int AnalogSegment::EnvelopeScaleFactor = 1 << EnvelopeScalePower;
-const float AnalogSegment::LogEnvelopeScaleFactor =
- logf(EnvelopeScaleFactor);
+const float AnalogSegment::LogEnvelopeScaleFactor = logf(EnvelopeScaleFactor);
const uint64_t AnalogSegment::EnvelopeDataUnit = 64*1024; // bytes
AnalogSegment::AnalogSegment(Analog& owner, uint64_t samplerate) :
uint64_t prev_sample_count = sample_count_;
- for (uint32_t i=0; i < sample_count; i++) {
+ for (uint32_t i = 0; i < sample_count; i++) {
append_single_sample((void*)data);
data += stride;
}
it = begin_raw_sample_iteration(0);
for (uint64_t i = 0; i < sample_count_; i++) {
const float sample = *((float*)it->value);
- if (sample < min_value_) min_value_ = sample;
- if (sample > max_value_) max_value_ = sample;
+ if (sample < min_value_)
+ min_value_ = sample;
+ if (sample > max_value_)
+ max_value_ = sample;
continue_raw_sample_iteration(it, 1);
}
end_raw_sample_iteration(it);
// Iterate through the samples to populate the first level mipmap
uint64_t start_sample = prev_length * EnvelopeScaleFactor;
- uint64_t end_sample = e0.length * EnvelopeScaleFactor;
+ uint64_t end_sample = e0.length * EnvelopeScaleFactor;
it = begin_raw_sample_iteration(start_sample);
for (uint64_t i = start_sample; i < end_sample; i += EnvelopeScaleFactor) {
*max_element(samples, samples + EnvelopeScaleFactor),
};
- if (sub_sample.min < min_value_) min_value_ = sub_sample.min;
- if (sub_sample.max > max_value_) max_value_ = sub_sample.max;
+ if (sub_sample.min < min_value_)
+ min_value_ = sub_sample.min;
+ if (sub_sample.max > max_value_)
+ max_value_ = sub_sample.max;
continue_raw_sample_iteration(it, EnvelopeScaleFactor);
*dest_ptr++ = sub_sample;
// Compute higher level mipmaps
for (unsigned int level = 1; level < ScaleStepCount; level++) {
Envelope &e = envelope_levels_[level];
- const Envelope &el = envelope_levels_[level-1];
+ const Envelope &el = envelope_levels_[level - 1];
// Expand the data buffer to fit the new samples
prev_length = e.length;
bool have_required_channels() const;
- srd_decoder_inst* create_decoder_inst(
- srd_session *session) const;
+ srd_decoder_inst* create_decoder_inst(srd_session *session) const;
set< shared_ptr<pv::data::Logic> > get_data();
row_iter = d->rows_.find((*r).second);
else {
// Failing that, use the decoder as a key
- row_iter = d->rows_.find(Row(decc));
+ row_iter = d->rows_.find(Row(decc));
}
assert(row_iter != d->rows_.end());
void decode_proc();
- static void annotation_callback(srd_proto_data *pdata,
- void *decoder);
+ static void annotation_callback(srd_proto_data *pdata, void *decoder);
private Q_SLOTS:
void on_new_frame();
return num_channels_;
}
-void Logic::push_segment(
- shared_ptr<LogicSegment> &segment)
+void Logic::push_segment(shared_ptr<LogicSegment> &segment)
{
segments_.push_front(segment);
}
vector< shared_ptr<Segment> > Logic::segments() const
{
- return vector< shared_ptr<Segment> >(
- segments_.begin(), segments_.end());
+ return vector< shared_ptr<Segment> >(segments_.begin(), segments_.end());
}
void Logic::clear()
const int LogicSegment::MipMapScalePower = 4;
const int LogicSegment::MipMapScaleFactor = 1 << MipMapScalePower;
const float LogicSegment::LogMipMapScaleFactor = logf(MipMapScaleFactor);
-const uint64_t LogicSegment::MipMapDataUnit = 64*1024; // bytes
+const uint64_t LogicSegment::MipMapDataUnit = 64 * 1024; // bytes
LogicSegment::LogicSegment(pv::data::Logic& owner, unsigned int unit_size,
uint64_t samplerate) :
lock_guard<recursive_mutex> lock(mutex_);
- return get_raw_samples(start_sample, (end_sample-start_sample));
+ return get_raw_samples(start_sample, (end_sample - start_sample));
}
SegmentLogicDataIterator* LogicSegment::begin_sample_iteration(uint64_t start)
// Compute higher level mipmaps
for (unsigned int level = 1; level < ScaleStepCount; level++) {
MipMapLevel &m = mip_map_[level];
- const MipMapLevel &ml = mip_map_[level-1];
+ const MipMapLevel &ml = mip_map_[level - 1];
// Expand the data buffer to fit the new samples
prev_length = m.length;
private:
uint64_t unpack_sample(const uint8_t *ptr) const;
void pack_sample(uint8_t *ptr, uint64_t value);
-
+
void reallocate_mipmap_level(MipMapLevel &m);
void append_payload_to_mipmap();
// There will always be space for at least one sample in
// the current chunk, so we do not need to test for space
- memcpy(current_chunk_ + (used_samples_ * unit_size_),
- data, unit_size_);
+ memcpy(current_chunk_ + (used_samples_ * unit_size_), data, unit_size_);
used_samples_++;
unused_samples_--;
{
lock_guard<recursive_mutex> lock(mutex_);
+ // Fail gracefully if we are asked to deliver data we don't have
if (it->sample_index > sample_count_)
- {
- // Fail gracefully if we are asked to deliver data we don't have
return;
- } else {
- it->sample_index += increase;
- it->chunk_offs += (increase * unit_size_);
- }
+
+ it->sample_index += increase;
+ it->chunk_offs += (increase * unit_size_);
if (it->chunk_offs > (chunk_size_ - 1)) {
it->chunk_num++;
}
}
-
} // namespace data
} // namespace pv
namespace pv {
namespace data {
-const int SignalBase::ColourBGAlpha = 8*256/100;
+const int SignalBase::ColourBGAlpha = 8 * 256 / 100;
SignalBase::SignalBase(shared_ptr<sigrok::Channel> channel, ChannelType channel_type) :
channel_(channel),
}
}
-
} // namespace data
} // namespace pv
* @param title the title of the dialog.
* @param options the map of options to use as a template.
* @param parent the parent widget of the dialog.
- */
+ */
InputOutputOptions(const QString &title,
const map<string, shared_ptr<sigrok::Option>> &options,
QWidget *parent);
page_list->setViewMode(QListView::IconMode);
page_list->setIconSize(QSize(icon_size, icon_size));
page_list->setMovement(QListView::Static);
- page_list->setMaximumWidth(icon_size + icon_size/2);
+ page_list->setMaximumWidth(icon_size + (icon_size / 2));
page_list->setSpacing(12);
pages = new QStackedWidget;
/* Library info */
s.append("<tr><td colspan=\"2\"><b>" +
- tr("Used libraries:") +
- "</b></td></tr>");
+ tr("Used libraries:") + "</b></td></tr>");
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
.arg(QString("Qt"), qVersion()));
/* Set up the supported field */
s.append("<tr><td colspan=\"2\"><b>" +
- tr("Supported hardware drivers:") +
- "</b></td></tr>");
+ tr("Supported hardware drivers:") + "</b></td></tr>");
for (auto entry : context->drivers()) {
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
.arg(QString::fromUtf8(entry.first.c_str()),
}
s.append("<tr><td colspan=\"2\"><b>" +
- tr("Supported input formats:") +
- "</b></td></tr>");
+ tr("Supported input formats:") + "</b></td></tr>");
for (auto entry : context->input_formats()) {
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
.arg(QString::fromUtf8(entry.first.c_str()),
}
s.append("<tr><td colspan=\"2\"><b>" +
- tr("Supported output formats:") +
- "</b></td></tr>");
+ tr("Supported output formats:") + "</b></td></tr>");
for (auto entry : context->output_formats()) {
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
.arg(QString::fromUtf8(entry.first.c_str()),
#ifdef ENABLE_DECODE
s.append("<tr><td colspan=\"2\"><b>" +
- tr("Supported protocol decoders:") +
- "</b></td></tr>");
+ tr("Supported protocol decoders:") + "</b></td></tr>");
for (const GSList *l = srd_decoder_list(); l; l = l->next) {
dec = (struct srd_decoder *)l->data;
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
const shared_ptr<sigrok::OutputFormat> output_format,
const map<string, Glib::VariantBase> &options,
const pair<uint64_t, uint64_t> sample_range,
- const Session &session,
- QWidget *parent = nullptr);
+ const Session &session, QWidget *parent = nullptr);
virtual ~StoreProgress();
QDockWidget *dock = nullptr;
while (w) {
- dock = qobject_cast<QDockWidget*>(w);
- if (dock)
- break;
- w = w->parent();
+ dock = qobject_cast<QDockWidget*>(w);
+ if (dock)
+ break;
+ w = w->parent();
}
// Get the view contained in the dock widget
QString("<h3>%1</h3>").arg(group->name().c_str())));
// Create the channel group grid
- QGridLayout *const channel_grid =
- create_channel_group_grid(sigs);
+ QGridLayout *const channel_grid = create_channel_group_grid(sigs);
layout_.addRow(channel_grid);
// Create the channel group options
- if (binding)
- {
+ if (binding) {
binding->add_properties_to_form(&layout_, true);
group_bindings_.push_back(binding);
}
new_value = g_variant_new_int64(spin_box_->value());
else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT64))
new_value = g_variant_new_uint64(spin_box_->value());
- else
- {
+ else {
// Unexpected value type.
assert(false);
}
void Session::data_feed_in(shared_ptr<sigrok::Device> device,
shared_ptr<Packet> packet)
{
- static bool frame_began=false;
+ static bool frame_began = false;
(void)device;
bool has_view(shared_ptr<views::ViewBase> view);
- const unordered_set< shared_ptr<data::SignalBase> >
- signalbases() const;
+ const unordered_set< shared_ptr<data::SignalBase> > signalbases() const;
#ifdef ENABLE_DECODE
bool add_decoder(srd_decoder *const dec);
// Qt needs the progress values to fit inside an int. If they would
// not, scale the current and max values down until they do.
while ((sample_count_ >> progress_scale) > INT_MAX)
- progress_scale ++;
+ progress_scale++;
unit_count_ = sample_count_ >> progress_scale;
min_sample_count = min(max(min_sample_count, MinSampleCount),
max_sample_count);
- sample_count_.show_125_list(
- min_sample_count, max_sample_count);
+ sample_count_.show_125_list(min_sample_count, max_sample_count);
if (sr_dev->config_check(ConfigKey::LIMIT_SAMPLES, Capability::GET)) {
auto gvar = sr_dev->config_get(ConfigKey::LIMIT_SAMPLES);
#endif
}
-void MainBar::export_file(shared_ptr<OutputFormat> format,
- bool selection_only)
+void MainBar::export_file(shared_ptr<OutputFormat> format, bool selection_only)
{
using pv::dialogs::StoreProgress;
void MainBar::on_config_changed()
{
commit_sample_count();
- commit_sample_rate();
+ commit_sample_rate();
}
void MainBar::on_actionNewView_triggered()
return stream << QString::fromStdString(str);
}
-QString format_time_si(
- const Timestamp& v,
- SIPrefix prefix,
- unsigned int precision,
- QString unit,
- bool sign)
+QString format_time_si(const Timestamp& v, SIPrefix prefix,
+ unsigned int precision, QString unit, bool sign)
{
if (prefix == SIPrefix::unspecified) {
// No prefix given, calculate it
QTextStream ts(&s);
if (sign && !v.is_zero())
ts << forcesign;
- ts
- << qSetRealNumberPrecision(precision)
- << (v * multiplier)
- << ' '
- << prefix
- << unit;
+ ts << qSetRealNumberPrecision(precision) << (v * multiplier) << ' '
+ << prefix << unit;
return s;
}
-QString format_time_si_adjusted(
- const Timestamp& t,
- SIPrefix prefix,
- unsigned precision,
- QString unit,
- bool sign)
+QString format_time_si_adjusted(const Timestamp& t, SIPrefix prefix,
+ unsigned precision, QString unit, bool sign)
{
// The precision is always given without taking the prefix into account
// so we need to deduct the number of decimals the prefix might imply
return format_time_si(t, prefix, relative_prec, unit, sign);
}
-
// Helper for 'format_time_minutes()'.
static QString pad_number(unsigned int number, int length)
{
*
* @return The formatted value.
*/
-QString format_time_si(
- const Timestamp& v,
- SIPrefix prefix = SIPrefix::unspecified,
- unsigned precision = 0,
- QString unit = "s",
- bool sign = true);
+QString format_time_si(const Timestamp& v,
+ SIPrefix prefix = SIPrefix::unspecified, unsigned precision = 0,
+ QString unit = "s", bool sign = true);
/**
* Wrapper around 'format_time_si()' that interprets the given 'precision'
*
* @return The formatted value.
*/
-QString format_time_si_adjusted(
- const Timestamp& t,
- SIPrefix prefix,
- unsigned precision = 0,
- QString unit = "s",
- bool sign = true);
+QString format_time_si_adjusted(const Timestamp& t, SIPrefix prefix,
+ unsigned precision = 0, QString unit = "s", bool sign = true);
/**
* Formats the given timestamp using "[+-]DD:HH:MM:SS.mmm uuu nnn ppp..." format.
*
* @return The formatted value.
*/
-QString format_time_minutes(
- const Timestamp& t,
- signed precision = 0,
+QString format_time_minutes(const Timestamp& t, signed precision = 0,
bool sign = true);
} // namespace util
QColor(0x4E, 0x9A, 0x06) // Green
};
-const QColor AnalogSignal::GridMajorColor = QColor(0, 0, 0, 40*256/100);
-const QColor AnalogSignal::GridMinorColor = QColor(0, 0, 0, 20*256/100);
+const QColor AnalogSignal::GridMajorColor = QColor(0, 0, 0, 40 * 256 / 100);
+const QColor AnalogSignal::GridMinorColor = QColor(0, 0, 0, 20 * 256 / 100);
const QColor AnalogSignal::SamplingPointColour(0x77, 0x77, 0x77);
{
const int h = (pos_vdivs_ + neg_vdivs_) * div_height_;
- return ((scale_index_drag_offset_ - scale_index_) *
- h / 4) - h / 2;
+ return ((scale_index_drag_offset_ - scale_index_) * h / 4) - h / 2;
}
void AnalogSignal::scale_handle_dragged(int offset)
{
const int h = (pos_vdivs_ + neg_vdivs_) * div_height_;
- scale_index_ = scale_index_drag_offset_ -
- (offset + h / 2) / (h / 4);
+ scale_index_ = scale_index_drag_offset_ - (offset + h / 2) / (h / 4);
update_scale();
}
QRectF *const rects = new QRectF[e.length];
QRectF *rect = rects;
- for (uint64_t sample = 0; sample < e.length-1; sample++) {
+ for (uint64_t sample = 0; sample < e.length - 1; sample++) {
const float x = ((e.scale * sample + e.start) /
samples_per_pixel - pixels_offset) + left;
const AnalogSegment::EnvelopeSample *const s =
// We overlap this sample with the next so that vertical
// gaps do not appear during steep rising or falling edges
- const float b = y - max(s->max, (s+1)->min) * scale_;
- const float t = y - min(s->min, (s+1)->max) * scale_;
+ const float b = y - max(s->max, (s + 1)->min) * scale_;
+ const float t = y - min(s->min, (s + 1)->max) * scale_;
float h = b - t;
if (h >= 0.0f && h <= 1.0f)
#include <pv/widgets/decodergroupbox.hpp>
#include <pv/widgets/decodermenu.hpp>
-
using std::all_of;
using std::list;
using std::make_pair;
const double start = a.start_sample() / samples_per_pixel -
pixels_offset;
- const double end = a.end_sample() / samples_per_pixel -
- pixels_offset;
+ const double end = a.end_sample() / samples_per_pixel - pixels_offset;
const size_t colour = (base_colour + a.format()) % countof(Colours);
p.setPen(OutlineColours[colour]);
if (a.start_sample() == a.end_sample())
draw_instant(a, p, h, start, y);
else
- draw_range(a, p, h, start, end, y, pp,
- row_title_width);
+ draw_range(a, p, h, start, end, y, pp, row_title_width);
}
void DecodeTrace::draw_annotation_block(
p.setBrush(QBrush((single_format ? Colours[colour] : Qt::gray),
Qt::Dense4Pattern));
p.drawRoundedRect(
- QRectF(start, top, end - start, bottom - top), h/4, h/4);
+ QRectF(start, top, end - start, bottom - top), h / 4, h / 4);
}
void DecodeTrace::draw_instant(const pv::data::decode::Annotation &a, QPainter &p,
if (!data || data->logic_segments().empty())
return;
- const shared_ptr<LogicSegment> segment =
- data->logic_segments().front();
+ const shared_ptr<LogicSegment> segment = data->logic_segments().front();
assert(segment);
const int64_t sample_count = (int64_t)segment->get_sample_count();
if (sample_count == 0)
samples_per_pixel - pixels_offset, left - 1.0);
const double end = min(sample_count / samples_per_pixel -
pixels_offset, right + 1.0);
- const QRectF no_decode_rect(start, y - h/2 + 0.5, end - start, h);
+ const QRectF no_decode_rect(start, y - (h / 2) + 0.5, end - start, h);
p.setPen(QPen(Qt::NoPen));
p.setBrush(Qt::white);
decoder_stack->remove(index);
// Update the popup
- create_popup_form();
+ create_popup_form();
decoder_stack->begin_decode();
}
const shared_ptr<pv::data::decode::Decoder> &dec,
const srd_channel *const pdch);
- void commit_decoder_channels(
- shared_ptr<data::decode::Decoder> &dec);
+ void commit_decoder_channels(shared_ptr<data::decode::Decoder> &dec);
void commit_channels();
// would be clipped away.
const QRect rect(0, 0, width() - BaselineOffset, height());
- vector< shared_ptr<RowItem> > items(
- view_.list_by_type<RowItem>());
+ vector< shared_ptr<RowItem> > items(view_.list_by_type<RowItem>());
stable_sort(items.begin(), items.end(),
[](const shared_ptr<RowItem> &a, const shared_ptr<RowItem> &b) {
if (segments.empty())
return;
- const shared_ptr<pv::data::LogicSegment> &segment =
- segments.front();
+ const shared_ptr<pv::data::LogicSegment> &segment = segments.front();
double samplerate = segment->samplerate();
void init_trigger_actions(QWidget *parent);
const vector<int32_t> get_trigger_types() const;
- QAction* action_from_trigger_type(
- const sigrok::TriggerMatchType *type);
+ QAction* action_from_trigger_type(const sigrok::TriggerMatchType *type);
const sigrok::TriggerMatchType* trigger_type_from_action(
QAction *action);
void populate_popup_form(QWidget *parent, QFormLayout *form);
friend struct RulerTest::tick_position_test_2;
private:
-
/// Height of the ruler in multipes of the text height
static const float RulerHeight;
namespace views {
namespace TraceView {
-const QPen Trace::AxisPen(QColor(0, 0, 0, 30*256/100));
+const QPen Trace::AxisPen(QColor(0, 0, 0, 30 * 256 / 100));
const int Trace::LabelHitPadding = 2;
-const QColor Trace::BrightGrayBGColour = QColor(0, 0, 0, 10*255/100);
-const QColor Trace::DarkGrayBGColour = QColor(0, 0, 0, 15*255/100);
+const QColor Trace::BrightGrayBGColour = QColor(0, 0, 0, 10 * 255 / 100);
+const QColor Trace::DarkGrayBGColour = QColor(0, 0, 0, 15 * 255 / 100);
Trace::Trace(shared_ptr<data::SignalBase> channel) :
base_(channel),
create_popup_form();
- connect(popup_, SIGNAL(closed()),
- this, SLOT(on_popup_closed()));
+ connect(popup_, SIGNAL(closed()), this, SLOT(on_popup_closed()));
return popup_;
}
void TraceTreeItem::set_bgcolour_state(bool state)
{
- bgcolour_state_ = state;
+ bgcolour_state_ = state;
}
} // namespace TraceView
/**
* Returns a list of row items owned by this object.
*/
- vector< shared_ptr<TraceTreeItem> >
- trace_tree_child_items() const;
+ vector< shared_ptr<TraceTreeItem> > trace_tree_child_items() const;
/**
* Clears the list of child items.
#include "decodetrace.hpp"
#endif
-
using pv::data::SignalData;
using pv::data::Segment;
using pv::util::TimeUnit;
void View::zoom(double steps, int offset)
{
- set_zoom(scale_ * pow(3.0/2.0, -steps), offset);
+ set_zoom(scale_ * pow(3.0 / 2.0, -steps), offset);
}
void View::zoom_fit(bool gui_state)
boost::optional<Timestamp> left_time, right_time;
const set< shared_ptr<SignalData> > visible_data = get_visible_data();
for (const shared_ptr<SignalData> d : visible_data) {
- const vector< shared_ptr<Segment> > segments =
- d->segments();
+ const vector< shared_ptr<Segment> > segments = d->segments();
for (const shared_ptr<Segment> &s : segments) {
double samplerate = s->samplerate();
samplerate = (samplerate <= 0.0) ? 1.0 : samplerate;
class Viewport;
class TriggerMarker;
-class CustomAbstractScrollArea : public QAbstractScrollArea {
+class CustomAbstractScrollArea : public QAbstractScrollArea
+{
Q_OBJECT
public:
bool viewportEvent(QEvent *event);
};
-class View : public ViewBase, public TraceTreeItemOwner {
+class View : public ViewBase, public TraceTreeItemOwner
+{
Q_OBJECT
private:
const ViewItemPaintParams pp(rect(), view_.scale(), view_.offset());
const vector< shared_ptr<ViewItem> > items(this->items());
for (auto i = items.rbegin(); i != items.rend(); i++)
- if ((*i)->enabled() &&
- (*i)->hit_box_rect(pp).contains(pt))
+ if ((*i)->enabled() && (*i)->hit_box_rect(pp).contains(pt))
return *i;
return nullptr;
}
public:
StandardBar(Session &session, QWidget *parent,
- TraceView::View *view, bool add_default_widgets=true);
+ TraceView::View *view, bool add_default_widgets = true);
Session &session() const;
ViewTypeTabularDecode
};
-class ViewBase : public QWidget {
+class ViewBase : public QWidget
+{
Q_OBJECT
public:
- explicit ViewBase(Session &session, bool is_main_view=false, QWidget *parent = nullptr);
+ explicit ViewBase(Session &session, bool is_main_view = false, QWidget *parent = nullptr);
Session& session();
const Session& session() const;
layout_->setContentsMargins(0, 0, 0, 0);
setLayout(layout_);
- layout_->addWidget(new QLabel(QString("<h3>%1</h3>").arg(title)),
- 0, 0);
+ layout_->addWidget(new QLabel(QString("<h3>%1</h3>").arg(title)), 0, 0);
layout_->setColumnStretch(0, 1);
QHBoxLayout *const toolbar = new QHBoxLayout;
(srd_decoder*)((QAction*)action)->data().value<void*>();
assert(dec);
- decoder_selected(dec);
+ decoder_selected(dec);
}
} // widgets
private:
static int decoder_name_cmp(const void *a, const void *b);
-
private Q_SLOTS:
void on_action(QObject *action);
case Bottom:
if (point_.y() > y())
return false;
- return true;
+ return true;
case Left:
if (point_.x() < (x() + width()))
case Left:
poly << QPoint(p.x() - l, p.y() + l);
break;
-
+
case Top:
poly << QPoint(p.x() + l, p.y() - l);
break;
list_.clear();
for (size_t i = 0; i < count; i++) {
char *const s = sr_si_string_u64(vals[i], suffix_);
- list_.addItem(QString::fromUtf8(s),
- qVariantFromValue(vals[i]));
+ list_.addItem(QString::fromUtf8(s), qVariantFromValue(vals[i]));
g_free(s);
}
uint64_t SweepTimingWidget::value() const
{
- switch(value_type_) {
+ switch (value_type_) {
case None:
return 0;
-
case MinMaxStep:
return (uint64_t)value_.value();
-
case List:
{
const int index = list_.currentIndex();
return (index >= 0) ? list_.itemData(
index).value<uint64_t>() : 0;
}
-
default:
// Unexpected value type
assert(false);
*/
void WellArray::keyPressEvent(QKeyEvent* event)
{
- switch(event->key()) { // Look at the key code
+ switch (event->key()) { // Look at the key code
case Qt::Key_Left: // If 'left arrow'-key,
if (curCol > 0) // and cr't not in leftmost col
setCurrent(curRow, curCol - 1); // set cr't to next left column
abort();
}
- switch(sig_number)
- {
+ switch (sig_number) {
case SIGINT:
Q_EMIT int_received();
break;