mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-19 21:33:40 +00:00
Merge branch 'qt6'
This commit is contained in:
commit
50dd9e6002
30 changed files with 6857 additions and 7706 deletions
|
|
@ -64,7 +64,7 @@ USBDevice::USBDevice(QString serial)
|
|||
libusb_exit(m_context);
|
||||
throw std::runtime_error(message.toStdString());
|
||||
}
|
||||
qInfo() << "USB connection established" << flush;
|
||||
qInfo() << "USB connection established" << Qt::flush;
|
||||
}
|
||||
|
||||
USBDevice::~USBDevice()
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ QWidget *CalibrationMeasurement::Base::createStandardWidget()
|
|||
{
|
||||
auto cbStandard = new QComboBox();
|
||||
for(auto s : supportedStandards()) {
|
||||
cbStandard->addItem(s->getDescription(), qVariantFromValue((void*) s));
|
||||
cbStandard->addItem(s->getDescription(), QVariant::fromValue((void*) s));
|
||||
if(standard == s) {
|
||||
cbStandard->setCurrentText(s->getDescription());
|
||||
}
|
||||
|
|
@ -232,10 +232,10 @@ QTableWidgetItem *CalibrationMeasurement::OnePort::getStatisticsItem()
|
|||
auto ret = Base::getStatisticsItem();
|
||||
if(numPoints() > 0) {
|
||||
if(!standard) {
|
||||
ret->setBackgroundColor(Qt::red);
|
||||
ret->setBackground(Qt::red);
|
||||
ret->setToolTip("No calibration standard assigned, unable to use this measurement");
|
||||
} else if(standard->minFrequency() > points.front().frequency || standard->maxFrequency() < points.back().frequency) {
|
||||
ret->setBackgroundColor(Qt::yellow);
|
||||
ret->setBackground(Qt::yellow);
|
||||
ret->setToolTip("Usable frequency range constrained by calibration standard to "+Unit::ToString(minUsableFreq(), "Hz", " kMG", 4)+" - "+Unit::ToString(maxUsableFreq(), "Hz", " kMG", 4));
|
||||
}
|
||||
}
|
||||
|
|
@ -391,10 +391,10 @@ QTableWidgetItem *CalibrationMeasurement::TwoPort::getStatisticsItem()
|
|||
auto ret = Base::getStatisticsItem();
|
||||
if(numPoints() > 0) {
|
||||
if(!standard) {
|
||||
ret->setBackgroundColor(Qt::red);
|
||||
ret->setBackground(Qt::red);
|
||||
ret->setToolTip("No calibration standard assigned, unable to use this measurement");
|
||||
} else if(standard->minFrequency() > points.front().frequency || standard->maxFrequency() < points.back().frequency) {
|
||||
ret->setBackgroundColor(Qt::yellow);
|
||||
ret->setBackground(Qt::yellow);
|
||||
ret->setToolTip("Usable frequency range constrained by calibration standard to "+Unit::ToString(minUsableFreq(), "Hz", " kMG", 4)+" - "+Unit::ToString(maxUsableFreq(), "Hz", " kMG", 4));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ bool SIUnitEdit::eventFilter(QObject *, QEvent *event)
|
|||
key = tolower(key);
|
||||
}
|
||||
if(key <= 255) {
|
||||
if (prefixes.indexOf(key) >= 0) {
|
||||
if (prefixes.indexOf(static_cast<QChar>(key)) >= 0) {
|
||||
// a valid prefix key was pressed
|
||||
parseNewValue(Unit::SIPrefixToFactor(key));
|
||||
continueEditing();
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ TouchstoneImport::TouchstoneImport(QWidget *parent, int ports) :
|
|||
ui->port2Group->setId(ui->port2_3, 2);
|
||||
ui->port2Group->setId(ui->port2_4, 3);
|
||||
// prevent selection of same port for port1 and 2
|
||||
connect(ui->port1Group, qOverload<int>(&QButtonGroup::buttonClicked), [=](int id) {
|
||||
connect(ui->port1Group, qOverload<int>(&QButtonGroup::idClicked), [=](int id) {
|
||||
preventCollisionWithGroup(ui->port2Group, id);
|
||||
});
|
||||
connect(ui->port2Group, qOverload<int>(&QButtonGroup::buttonClicked), [=](int id) {
|
||||
connect(ui->port2Group, qOverload<int>(&QButtonGroup::idClicked), [=](int id) {
|
||||
preventCollisionWithGroup(ui->port1Group, id);
|
||||
});
|
||||
connect(ui->file, &QLineEdit::textChanged, this, &TouchstoneImport::setFile);
|
||||
|
|
|
|||
|
|
@ -346,17 +346,17 @@ bool CompoundDeviceEditDialog::eventFilter(QObject *object, QEvent *event)
|
|||
insertIndicator->setMaximumSize(2, frameSize);
|
||||
insertIndicator->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
insertIndicator->setStyleSheet("background-color:red;");
|
||||
updateInsertIndicator(dragEvent->pos().x());
|
||||
updateInsertIndicator(dragEvent->position().toPoint().x());
|
||||
return true;
|
||||
}
|
||||
} else if(event->type() == QEvent::DragMove) {
|
||||
auto dragEvent = static_cast<QDragMoveEvent*>(event);
|
||||
updateInsertIndicator(dragEvent->pos().x());
|
||||
updateInsertIndicator(dragEvent->position().toPoint().x());
|
||||
return true;
|
||||
} else if(event->type() == QEvent::Drop) {
|
||||
auto dragEvent = static_cast<QDropEvent*>(event);
|
||||
delete insertIndicator;
|
||||
addFrameAtPosition(dragEvent->pos().x(), dropFrame);
|
||||
addFrameAtPosition(dragEvent->position().toPoint().x(), dropFrame);
|
||||
return true;
|
||||
} else if(event->type() == QEvent::DragLeave) {
|
||||
dropPending = false;
|
||||
|
|
|
|||
|
|
@ -437,11 +437,13 @@ QStringList CompoundDriver::availableExtRefInSettings()
|
|||
if(!connected) {
|
||||
return QStringList();
|
||||
}
|
||||
auto set = devices[0]->availableExtRefInSettings().toSet();
|
||||
auto list = devices[0]->availableExtRefInSettings();
|
||||
QSet<QString> set(list.begin(), list.end());
|
||||
for(unsigned int i=1;i<devices.size();i++) {
|
||||
set = set.intersect(devices[i]->availableExtRefInSettings().toSet());
|
||||
list = devices[i]->availableExtRefInSettings();
|
||||
set = set.intersect({list.begin(), list.end()});
|
||||
}
|
||||
return QStringList(set.toList());
|
||||
return QStringList(set.begin(), set.end());
|
||||
}
|
||||
|
||||
QStringList CompoundDriver::availableExtRefOutSettings()
|
||||
|
|
@ -449,11 +451,13 @@ QStringList CompoundDriver::availableExtRefOutSettings()
|
|||
if(!connected) {
|
||||
return QStringList();
|
||||
}
|
||||
auto set = devices[0]->availableExtRefOutSettings().toSet();
|
||||
auto list = devices[0]->availableExtRefOutSettings();
|
||||
QSet<QString> set(list.begin(), list.end());
|
||||
for(unsigned int i=1;i<devices.size();i++) {
|
||||
set = set.intersect(devices[i]->availableExtRefOutSettings().toSet());
|
||||
list = devices[i]->availableExtRefOutSettings();
|
||||
set = set.intersect({list.begin(), list.end()});
|
||||
}
|
||||
return QStringList(set.toList());
|
||||
return QStringList(set.begin(), set.end());
|
||||
}
|
||||
|
||||
bool CompoundDriver::setExtRef(QString option_in, QString option_out)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ std::set<QString> LibreVNATCPDriver::GetAvailableDevices()
|
|||
"MAN: \"ssdp:discover\"\r\n"
|
||||
"MX: 1\r\n"
|
||||
"ST: ");
|
||||
data.append(service_name);
|
||||
data.append(service_name.toUtf8());
|
||||
data.append("\r\n"
|
||||
"\r\n");
|
||||
|
||||
|
|
@ -125,10 +125,10 @@ bool LibreVNATCPDriver::connectTo(QString serial)
|
|||
// sockets are connected now
|
||||
dataBuffer.clear();
|
||||
logBuffer.clear();
|
||||
connect(&dataSocket, qOverload<QAbstractSocket::SocketError>(&QTcpSocket::error), this, &LibreVNATCPDriver::ConnectionLost, Qt::QueuedConnection);
|
||||
connect(&logSocket, qOverload<QAbstractSocket::SocketError>(&QTcpSocket::error), this, &LibreVNATCPDriver::ConnectionLost, Qt::QueuedConnection);
|
||||
connect(&dataSocket, qOverload<QAbstractSocket::SocketError>(&QTcpSocket::errorOccurred), this, &LibreVNATCPDriver::ConnectionLost, Qt::QueuedConnection);
|
||||
connect(&logSocket, qOverload<QAbstractSocket::SocketError>(&QTcpSocket::errorOccurred), this, &LibreVNATCPDriver::ConnectionLost, Qt::QueuedConnection);
|
||||
|
||||
qInfo() << "TCP connection established" << flush;
|
||||
qInfo() << "TCP connection established" << Qt::flush;
|
||||
this->serial = serial;
|
||||
connected = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ bool LibreVNAUSBDriver::connectTo(QString serial)
|
|||
libusb_exit(m_context);
|
||||
throw std::runtime_error(message.toStdString());
|
||||
}
|
||||
qInfo() << "USB connection established" << flush;
|
||||
qInfo() << "USB connection established" << Qt::flush;
|
||||
connected = true;
|
||||
m_receiveThread = new std::thread(&LibreVNAUSBDriver::USBHandleThread, this);
|
||||
dataBuffer = new USBInBuffer(m_handle, EP_Data_In_Addr, 65536);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ ManualControlDialogV1::ManualControlDialogV1(LibreVNADriver &dev, QWidget *paren
|
|||
connect(ui->LO2Frequency, &SIUnitEdit::valueChanged, [=](double) {
|
||||
UpdateLO2();
|
||||
});
|
||||
connect(ui->SourceSwitchGroup, qOverload<int, bool>(&QButtonGroup::buttonToggled), [=](int, bool) {
|
||||
connect(ui->SourceSwitchGroup, qOverload<int, bool>(&QButtonGroup::idToggled), [=](int, bool) {
|
||||
UpdateLO1();
|
||||
UpdateLO2();
|
||||
});
|
||||
|
|
@ -179,8 +179,8 @@ ManualControlDialogV1::ManualControlDialogV1(LibreVNADriver &dev, QWidget *paren
|
|||
connect(ui->LO2Frequency, &SIUnitEdit::valueChanged, [=](double) { UpdateDevice(); });
|
||||
connect(ui->IF2, &SIUnitEdit::valueChanged, [=](double) { UpdateDevice(); });
|
||||
|
||||
connect(ui->PortSwitchGroup, qOverload<int, bool>(&QButtonGroup::buttonToggled), [=](int, bool) { UpdateDevice(); });
|
||||
connect(ui->SourceSwitchGroup, qOverload<int, bool>(&QButtonGroup::buttonToggled), [=](int, bool) { UpdateDevice(); });
|
||||
connect(ui->PortSwitchGroup, qOverload<int, bool>(&QButtonGroup::idToggled), [=](int, bool) { UpdateDevice(); });
|
||||
connect(ui->SourceSwitchGroup, qOverload<int, bool>(&QButtonGroup::idToggled), [=](int, bool) { UpdateDevice(); });
|
||||
|
||||
connect(ui->Attenuator, qOverload<double>(&QDoubleSpinBox::valueChanged), [=](double) { UpdateDevice(); });
|
||||
connect(ui->Samples, qOverload<int>(&QSpinBox::valueChanged), [=](double) { UpdateDevice(); });
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ bool SSA3000XDriver::connectTo(QString serial)
|
|||
return false;
|
||||
}
|
||||
|
||||
connect(&dataSocket, qOverload<QAbstractSocket::SocketError>(&QTcpSocket::error), this, &SSA3000XDriver::ConnectionLost, Qt::QueuedConnection);
|
||||
connect(&dataSocket, qOverload<QAbstractSocket::SocketError>(&QTcpSocket::errorOccurred), this, &SSA3000XDriver::ConnectionLost, Qt::QueuedConnection);
|
||||
|
||||
// grab model information
|
||||
dataSocket.write("*IDN?\r\n");
|
||||
|
|
@ -200,6 +200,7 @@ bool SSA3000XDriver::setSA(const DeviceDriver::SASettings &s, std::function<void
|
|||
windowName = "HAMMing"; // kaiser is not available
|
||||
break;
|
||||
case SASettings::Window::None:
|
||||
case SASettings::Window::Last:
|
||||
windowName = "RECTangular";
|
||||
break;
|
||||
}
|
||||
|
|
@ -217,6 +218,7 @@ bool SSA3000XDriver::setSA(const DeviceDriver::SASettings &s, std::function<void
|
|||
detName = "NEGative";
|
||||
break;
|
||||
case SASettings::Detector::PPeak:
|
||||
case SASettings::Detector::Last:
|
||||
detName = "POSitive";
|
||||
break;
|
||||
case SASettings::Detector::Sample:
|
||||
|
|
@ -287,6 +289,8 @@ QStringList SSA3000XDriver::availableExtRefOutSettings()
|
|||
|
||||
bool SSA3000XDriver::setExtRef(QString option_in, QString option_out)
|
||||
{
|
||||
Q_UNUSED(option_in)
|
||||
Q_UNUSED(option_out)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ template<typename T, int minUnchanged>
|
|||
class TraceDifferenceGenerator {
|
||||
public:
|
||||
TraceDifferenceGenerator(std::function<void(const T&)> changeCallback) :
|
||||
nextCallbackIndex(0),
|
||||
last{},
|
||||
callback(changeCallback),
|
||||
nextCallbackIndex(0)
|
||||
callback(changeCallback)
|
||||
{}
|
||||
|
||||
void reset() {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
#include "Generator/signalgenwidget.h"
|
||||
|
||||
#include <QDockWidget>
|
||||
#include <QDesktopWidget>
|
||||
#include <QApplication>
|
||||
#include <QActionGroup>
|
||||
#include "CustomWidgets/informationbox.h"
|
||||
|
|
@ -113,7 +112,7 @@ SpectrumAnalyzer::SpectrumAnalyzer(AppWindow *window, QString name)
|
|||
|
||||
auto eStart = new SIUnitEdit("Hz", " kMG", 6);
|
||||
// calculate width required with expected string length
|
||||
auto width = QFontMetrics(eStart->font()).width("3.00000GHz") + 15;
|
||||
auto width = QFontMetrics(eStart->font()).horizontalAdvance("3.00000GHz") + 15;
|
||||
eStart->setFixedWidth(width);
|
||||
eStart->setToolTip("Start frequency");
|
||||
connect(eStart, &SIUnitEdit::valueChanged, this, &SpectrumAnalyzer::SetStartFreq);
|
||||
|
|
|
|||
|
|
@ -33,11 +33,11 @@ ImpedanceMatchDialog::ImpedanceMatchDialog(MarkerModel &model, Marker *marker, Q
|
|||
connect(ui->zFreq, &SIUnitEdit::valueChanged, this, &ImpedanceMatchDialog::calculateMatch);
|
||||
connect(ui->zImag, &SIUnitEdit::valueChanged, this, &ImpedanceMatchDialog::calculateMatch);
|
||||
connect(ui->zReal, &SIUnitEdit::valueChanged, this, &ImpedanceMatchDialog::calculateMatch);
|
||||
connect(ui->zGroup, qOverload<int>(&QButtonGroup::buttonClicked), this, &ImpedanceMatchDialog::calculateMatch);
|
||||
connect(ui->zGroup, qOverload<int>(&QButtonGroup::idClicked), this, &ImpedanceMatchDialog::calculateMatch);
|
||||
connect(ui->cMatchType, qOverload<int>(&QComboBox::currentIndexChanged), this, &ImpedanceMatchDialog::calculateMatch);
|
||||
connect(ui->lGroup, qOverload<int>(&QButtonGroup::buttonClicked), this, &ImpedanceMatchDialog::calculateMatch);
|
||||
connect(ui->cGroup, qOverload<int>(&QButtonGroup::buttonClicked), this, &ImpedanceMatchDialog::calculateMatch);
|
||||
connect(ui->zGroup, qOverload<int>(&QButtonGroup::buttonClicked), this, &ImpedanceMatchDialog::calculateMatch);
|
||||
connect(ui->lGroup, qOverload<int>(&QButtonGroup::idClicked), this, &ImpedanceMatchDialog::calculateMatch);
|
||||
connect(ui->cGroup, qOverload<int>(&QButtonGroup::idClicked), this, &ImpedanceMatchDialog::calculateMatch);
|
||||
connect(ui->zGroup, qOverload<int>(&QButtonGroup::idClicked), this, &ImpedanceMatchDialog::calculateMatch);
|
||||
|
||||
// populate marker options
|
||||
auto markers = model.getMarkers();
|
||||
|
|
|
|||
|
|
@ -1473,7 +1473,6 @@ QWidget *Marker::getTypeEditor(QAbstractItemDelegate *delegate)
|
|||
layout->addWidget(c);
|
||||
c->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
layout->setContentsMargins(0,0,0,0);
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(0);
|
||||
layout->addWidget(new QLabel("to"));
|
||||
auto deltaChooser = new QComboBox;
|
||||
|
|
|
|||
|
|
@ -413,11 +413,12 @@ void TracePlot::leaveEvent(QEvent *event)
|
|||
void TracePlot::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
auto &pref = Preferences::getInstance();
|
||||
if(pref.Graphs.enablePanAndZoom && positionWithinGraphArea(event->pos())) {
|
||||
QPoint position(event->position().x(), event->position().y());
|
||||
if(pref.Graphs.enablePanAndZoom && positionWithinGraphArea(position)) {
|
||||
bool horizontally = !(QApplication::keyboardModifiers() & Qt::ShiftModifier);
|
||||
bool vertically = !(QApplication::keyboardModifiers() & Qt::ControlModifier);
|
||||
double factor = pow(pref.Graphs.zoomFactor, (double) event->angleDelta().y() / 120.0);
|
||||
zoom(event->pos(), factor, horizontally, vertically);
|
||||
zoom(position, factor, horizontally, vertically);
|
||||
event->accept();
|
||||
}
|
||||
}
|
||||
|
|
@ -522,7 +523,7 @@ void TracePlot::dragEnterEvent(QDragEnterEvent *event)
|
|||
void TracePlot::dropEvent(QDropEvent *event)
|
||||
{
|
||||
if(dropTrace) {
|
||||
traceDropped(dropTrace, event->pos() - - QPoint(marginLeft, marginTop));
|
||||
traceDropped(dropTrace, event->position().toPoint() - - QPoint(marginLeft, marginTop));
|
||||
}
|
||||
dropPending = false;
|
||||
dropTrace = nullptr;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#include <math.h>
|
||||
#include <QDebug>
|
||||
#include <QColorDialog>
|
||||
#include <QActionGroup>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
@ -755,7 +756,7 @@ QVariant SmithChartContantLineModel::data(const QModelIndex &index, int role) co
|
|||
auto line = chart.constantLines[index.row()];
|
||||
switch(index.column()) {
|
||||
case ColIndexColor:
|
||||
if (role == Qt::BackgroundColorRole) {
|
||||
if (role == Qt::BackgroundRole) {
|
||||
return line.getColor();
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ public:
|
|||
: ptr(static_cast<void*>(ptr)),
|
||||
variant(QVariant(*ptr)){}
|
||||
void setValue(const QVariant &value) {
|
||||
auto destType = variant.type();
|
||||
auto destType = variant.metaType();
|
||||
if(!value.canConvert(destType)) {
|
||||
throw std::runtime_error("Unable to convert QVariant to requested type");
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ public:
|
|||
mt.construct(ptr, variant.constData());
|
||||
}
|
||||
QVariant value() {
|
||||
return QVariant(variant.type(), ptr);
|
||||
return QVariant(variant.metaType(), ptr);
|
||||
}
|
||||
void* getPtr(){return ptr;}
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -428,17 +428,17 @@ bool MatchingNetwork::eventFilter(QObject *object, QEvent *event)
|
|||
insertIndicator->setMaximumSize(2, imageHeight);
|
||||
insertIndicator->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
insertIndicator->setStyleSheet("background-color:red;");
|
||||
updateInsertIndicator(dragEvent->pos().x());
|
||||
updateInsertIndicator(dragEvent->position().toPoint().x());
|
||||
return true;
|
||||
}
|
||||
} else if(event->type() == QEvent::DragMove) {
|
||||
auto dragEvent = static_cast<QDragMoveEvent*>(event);
|
||||
updateInsertIndicator(dragEvent->pos().x());
|
||||
updateInsertIndicator(dragEvent->position().toPoint().x());
|
||||
return true;
|
||||
} else if(event->type() == QEvent::Drop) {
|
||||
auto dragEvent = static_cast<QDropEvent*>(event);
|
||||
delete insertIndicator;
|
||||
addComponentAtPosition(dragEvent->pos().x(), dropComponent);
|
||||
addComponentAtPosition(dragEvent->position().toPoint().x(), dropComponent);
|
||||
return true;
|
||||
} else if(event->type() == QEvent::DragLeave) {
|
||||
dropPending = false;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@
|
|||
#include <QDateTime>
|
||||
#include <QDockWidget>
|
||||
#include <queue>
|
||||
#include <QDesktopWidget>
|
||||
#include <QApplication>
|
||||
#include <QActionGroup>
|
||||
#include <QErrorMessage>
|
||||
|
|
@ -276,7 +275,7 @@ VNA::VNA(AppWindow *window, QString name)
|
|||
|
||||
auto eStart = new SIUnitEdit("Hz", " kMG", 6);
|
||||
// calculate width required with expected string length
|
||||
auto width = QFontMetrics(eStart->font()).width("3.00000GHz") + 15;
|
||||
auto width = QFontMetrics(eStart->font()).horizontalAdvance("3.00000GHz") + 15;
|
||||
eStart->setFixedWidth(width);
|
||||
eStart->setToolTip("Start frequency");
|
||||
connect(eStart, &SIUnitEdit::valueChanged, this, &VNA::SetStartFreq);
|
||||
|
|
@ -338,7 +337,7 @@ VNA::VNA(AppWindow *window, QString name)
|
|||
|
||||
// power sweep widgets
|
||||
auto sbPowerLow = new QDoubleSpinBox();
|
||||
width = QFontMetrics(sbPowerLow->font()).width("-30.00dBm") + 20;
|
||||
width = QFontMetrics(sbPowerLow->font()).horizontalAdvance("-30.00dBm") + 20;
|
||||
sbPowerLow->setFixedWidth(width);
|
||||
sbPowerLow->setRange(-100.0, 100.0);
|
||||
sbPowerLow->setSingleStep(0.25);
|
||||
|
|
@ -351,7 +350,7 @@ VNA::VNA(AppWindow *window, QString name)
|
|||
powerSweepActions.push_back(tb_sweep->addWidget(sbPowerLow));
|
||||
|
||||
auto sbPowerHigh = new QDoubleSpinBox();
|
||||
width = QFontMetrics(sbPowerHigh->font()).width("-30.00dBm") + 20;
|
||||
width = QFontMetrics(sbPowerHigh->font()).horizontalAdvance("-30.00dBm") + 20;
|
||||
sbPowerHigh->setFixedWidth(width);
|
||||
sbPowerHigh->setRange(-100.0, 100.0);
|
||||
sbPowerHigh->setSingleStep(0.25);
|
||||
|
|
@ -364,7 +363,7 @@ VNA::VNA(AppWindow *window, QString name)
|
|||
powerSweepActions.push_back(tb_sweep->addWidget(sbPowerHigh));
|
||||
|
||||
auto ePowerFreq = new SIUnitEdit("Hz", " kMG", 6);
|
||||
width = QFontMetrics(ePowerFreq->font()).width("3.00000GHz") + 15;
|
||||
width = QFontMetrics(ePowerFreq->font()).horizontalAdvance("3.00000GHz") + 15;
|
||||
ePowerFreq->setFixedWidth(width);
|
||||
ePowerFreq->setToolTip("Start frequency");
|
||||
connect(ePowerFreq, &SIUnitEdit::valueChanged, this, &VNA::SetPowerSweepFrequency);
|
||||
|
|
@ -378,7 +377,7 @@ VNA::VNA(AppWindow *window, QString name)
|
|||
// Acquisition toolbar
|
||||
auto tb_acq = new QToolBar("Acquisition");
|
||||
auto dbm = new QDoubleSpinBox();
|
||||
width = QFontMetrics(dbm->font()).width("-30.00dBm") + 20;
|
||||
width = QFontMetrics(dbm->font()).horizontalAdvance("-30.00dBm") + 20;
|
||||
dbm->setFixedWidth(width);
|
||||
dbm->setRange(-100.0, 100.0);
|
||||
dbm->setSingleStep(0.25);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
#include "Device/LibreVNA/librevnatcpdriver.h"
|
||||
|
||||
#include <QDockWidget>
|
||||
#include <QDesktopWidget>
|
||||
#include <QApplication>
|
||||
#include <QActionGroup>
|
||||
#include <QDebug>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef APPWINDOW_H
|
||||
#define APPWINDOW_H
|
||||
|
||||
#include "json.hpp"
|
||||
#include "Traces/traceplot.h"
|
||||
#include "Traces/tracemodel.h"
|
||||
#include "Traces/Marker/markermodel.h"
|
||||
|
|
@ -66,11 +67,11 @@ private slots:
|
|||
void DeviceStatusUpdated();
|
||||
void DeviceFlagsUpdated();
|
||||
void DeviceInfoUpdated();
|
||||
nlohmann::json SaveSetup();
|
||||
void SaveSetup(QString filename);
|
||||
void LoadSetup(QString filename);
|
||||
void LoadSetup(nlohmann::json j);
|
||||
private:
|
||||
nlohmann::json SaveSetup();
|
||||
void LoadSetup(nlohmann::json j);
|
||||
|
||||
enum class DeviceStatusBar {
|
||||
Connected,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -38,7 +38,6 @@ void ModeWindow::SetupUi()
|
|||
auto cornerWidget = new QWidget();
|
||||
cornerWidget->setLayout(new QHBoxLayout);
|
||||
cornerWidget->layout()->setSpacing(0);
|
||||
cornerWidget->layout()->setMargin(0);
|
||||
cornerWidget->layout()->setContentsMargins(0,0,0,0);
|
||||
cornerWidget->setMaximumHeight(aw->menuBar()->height());
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public:
|
|||
}
|
||||
// json library does not now about QVariant, handle used cases
|
||||
auto val = e.var.value();
|
||||
switch(static_cast<QMetaType::Type>(val.type())) {
|
||||
switch(val.metaType().id()) {
|
||||
case QMetaType::Double: e.var.setValue((*json_entry).get<double>()); break;
|
||||
case QMetaType::Int: e.var.setValue((*json_entry).get<int>()); break;
|
||||
case QMetaType::UInt: e.var.setValue((*json_entry).get<unsigned int>()); break;
|
||||
|
|
@ -80,7 +80,7 @@ public:
|
|||
}
|
||||
// json library does not now about QVariant, handle used cases
|
||||
auto val = e.var.value();
|
||||
switch(static_cast<QMetaType::Type>(val.type())) {
|
||||
switch(val.metaType().id()) {
|
||||
case QMetaType::Double: *json_entry = val.toDouble(); break;
|
||||
case QMetaType::Int: *json_entry = val.toInt(); break;
|
||||
case QMetaType::UInt: *json_entry = val.toUInt(); break;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@echo off
|
||||
SetLocal EnableDelayedExpansion
|
||||
(set PATH=C:\Qt\5.15.2\mingw81_64\bin;!PATH!)
|
||||
(set PATH=C:\Qt\6.2.4\mingw_64\bin;!PATH!)
|
||||
if defined QT_PLUGIN_PATH (
|
||||
set QT_PLUGIN_PATH=C:\Qt\5.15.2\mingw81_64\plugins;!QT_PLUGIN_PATH!
|
||||
set QT_PLUGIN_PATH=C:\Qt\6.2.4\mingw_64\plugins;!QT_PLUGIN_PATH!
|
||||
) else (
|
||||
set QT_PLUGIN_PATH=C:\Qt\5.15.2\mingw81_64\plugins
|
||||
set QT_PLUGIN_PATH=C:\Qt\6.2.4\mingw_64\plugins
|
||||
)
|
||||
%*
|
||||
EndLocal
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
|
||||
export LD_LIBRARY_PATH
|
||||
QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins${QT_PLUGIN_PATH:+:$QT_PLUGIN_PATH}
|
||||
QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt6/plugins${QT_PLUGIN_PATH:+:$QT_PLUGIN_PATH}
|
||||
export QT_PLUGIN_PATH
|
||||
exec "$@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue