const char *const *annotations = (char**)pda->ann_text;
while(*annotations) {
- _annotations.push_back(QString(*annotations));
+ _annotations.push_back(QString::fromUtf8(*annotations));
annotations++;
}
}
drivers = sr_driver_list();
for (int i = 0; drivers[i]; ++i) {
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
- .arg(QString(drivers[i]->name))
- .arg(QString(drivers[i]->longname)));
+ .arg(QString::fromUtf8(drivers[i]->name))
+ .arg(QString::fromUtf8(drivers[i]->longname)));
}
s.append("<tr><td colspan=\"2\"><b>" +
inputs = sr_input_list();
for (int i = 0; inputs[i]; ++i) {
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
- .arg(QString(inputs[i]->id))
- .arg(QString(inputs[i]->description)));
+ .arg(QString::fromUtf8(inputs[i]->id))
+ .arg(QString::fromUtf8(inputs[i]->description)));
}
s.append("<tr><td colspan=\"2\"><b>" +
outputs = sr_output_list();
for (int i = 0; outputs[i]; ++i) {
s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
- .arg(QString(outputs[i]->id))
- .arg(QString(outputs[i]->description)));
+ .arg(QString::fromUtf8(outputs[i]->id))
+ .arg(QString::fromUtf8(outputs[i]->description)));
}
s.append("<tr><td colspan=\"2\"><b>" +
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>")
- .arg(QString(dec->id))
- .arg(QString(dec->longname)));
+ .arg(QString::fromUtf8(dec->id))
+ .arg(QString::fromUtf8(dec->longname)));
}
s.append("</table>");
BOOST_FOREACH(sr_dev_inst *const sdi, devices)
{
const string title = DeviceManager::format_device_title(sdi);
- QString text(title.c_str());
+ QString text = QString::fromUtf8(title.c_str());
if (sdi->probes) {
text += QString(" with %1 probes").arg(
g_slist_length(sdi->probes));
if (sr_config_list(_sdi->driver, _sdi, NULL, key, &gvar_list) != SR_OK)
gvar_list = NULL;
- const QString name(info->name);
+ const QString name = QString::fromUtf8(info->name);
switch(key)
{
QString s;
if (g_variant_is_of_type(gvar, G_VARIANT_TYPE("s")))
- s = QString(g_variant_get_string(gvar, NULL));
+ s = QString::fromUtf8(g_variant_get_string(gvar, NULL));
else
{
gchar *const text = g_variant_print(gvar, FALSE);
- s = QString(text);
+ s = QString::fromUtf8(text);
g_free(text);
}
{
uint64_t p, q;
g_variant_get(gvar, "(tt)", &p, &q);
- return QString(sr_period_string(p * q));
+ return QString::fromUtf8(sr_period_string(p * q));
}
QString DeviceOptions::print_vdiv(GVariant *const gvar)
{
uint64_t p, q;
g_variant_get(gvar, "(tt)", &p, &q);
- return QString(sr_voltage_string(p, q));
+ return QString::fromUtf8(sr_voltage_string(p, q));
}
QString DeviceOptions::print_voltage_threshold(GVariant *const gvar)
char buf[64];
g_variant_get(gvar, "(dd)", &lo, &hi);
snprintf(buf, sizeof(buf), "L<%.1fV H>%.1fV", lo, hi);
- return QString(buf);
+ return QString::fromUtf8(buf);
}
} // binding
GVariant *const value = _getter ? _getter() : NULL;
if (value) {
- _line_edit->setText(QString(
+ _line_edit->setText(QString::fromUtf8(
g_variant_get_string(value, NULL)));
g_variant_unref(value);
}
{
shared_ptr<view::LogicSignal> l =
dynamic_pointer_cast<view::LogicSignal>(s);
- if (l && QString(probe->name).toLower().contains(
+ if (l && QString::fromUtf8(probe->name).
+ toLower().contains(
l->get_name().toLower()))
probes[probe] = l;
}
{
const uint64_t &l = RecordLengths[i];
char *const text = sr_si_string_u64(l, " samples");
- _record_length_selector.addItem(QString(text),
+ _record_length_selector.addItem(QString::fromUtf8(text),
qVariantFromValue(l));
g_free(text);
for (unsigned int i = 0; i < num_elements; i++)
{
char *const s = sr_samplerate_string(elements[i]);
- _sample_rate_list.addItem(QString(s),
+ _sample_rate_list.addItem(QString::fromUtf8(s),
qVariantFromValue(elements[i]));
g_free(s);
}
DecodeTrace::DecodeTrace(pv::SigSession &session,
boost::shared_ptr<pv::data::DecoderStack> decoder_stack, int index) :
- Trace(session, QString(decoder_stack->stack().front()->decoder()->name)),
+ Trace(session, QString::fromUtf8(
+ decoder_stack->stack().front()->decoder()->name)),
_decoder_stack(decoder_stack),
_delete_mapper(this)
{
assert(decoder);
pv::widgets::DecoderGroupBox *const group =
- new pv::widgets::DecoderGroupBox(decoder->name);
+ new pv::widgets::DecoderGroupBox(
+ QString::fromUtf8(decoder->name));
_delete_mapper.setMapping(group, index);
connect(group, SIGNAL(delete_decoder()), &_delete_mapper, SLOT(map()));
(GSList*)srd_decoder_list()), decoder_name_cmp);
for(; l; l = l->next)
{
- QAction *const action = addAction(QString(
+ QAction *const action = addAction(QString::fromUtf8(
((srd_decoder*)l->data)->name));
action->setData(qVariantFromValue(l->data));
_mapper.setMapping(action, action);