-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix building on Qt 5.15 #15
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
CommandPanel::CommandPanel(QSerialPort* port, QWidget *parent) : | ||
QWidget(parent), | ||
ui(new Ui::CommandPanel), | ||
_menu(trUtf8("&Commands")), _newCommandAction(trUtf8("&New Command"), this) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand that |
||
_menu("&Commands"), _newCommandAction("&New Command", this) | ||
{ | ||
serialPort = port; | ||
|
||
|
@@ -55,7 +55,7 @@ CommandWidget* CommandPanel::newCommand() | |
{ | ||
auto command = new CommandWidget(); | ||
command_name_counter++; | ||
command->setName(trUtf8("Command ") + QString::number(command_name_counter)); | ||
command->setName("Command " + QString::number(command_name_counter)); | ||
ui->scrollAreaWidgetContents->layout()->addWidget(command); | ||
command->setFocusToEdit(); | ||
connect(command, &CommandWidget::sendCommand, this, &CommandPanel::sendCommand); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ FramedReaderSettings::FramedReaderSettings(QWidget *parent) : | |
fbGroup.addButton(ui->rbSize1Byte, (int) SizeFieldType::Field1Byte); | ||
fbGroup.addButton(ui->rbSize2Byte, (int) SizeFieldType::Field2Byte); | ||
|
||
connect(&fbGroup, static_cast<void(QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems (int,bool) overload of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the reason was that Qt5.9 is the version that comes with the Ubuntu 18.04. I try to support the oldest LTS version of the Ubuntu that I can. I know that it is not difficult to install any Qt version on Ubuntu, but when things works out of the box, it is very helpful for new comers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the record; latest ubuntu LTS 20.04 comes with the Qt 5.12. |
||
connect(&fbGroup, static_cast<void(QButtonGroup::*)(int, bool)>(&QButtonGroup::idToggled), | ||
[this](int id, bool enabled) | ||
{ | ||
if (!enabled) return; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,10 +79,10 @@ PortControl::PortControl(QSerialPort* port, QWidget* parent) : | |
SELECT<int>::OVERLOAD_OF(&QComboBox::activated), | ||
this, &PortControl::onTbPortListActivated); | ||
QObject::connect(ui->cbPortList, | ||
SELECT<const QString&>::OVERLOAD_OF(&QComboBox::activated), | ||
SELECT<const QString&>::OVERLOAD_OF(&QComboBox::textActivated), | ||
this, &PortControl::selectListedPort); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no point of using |
||
QObject::connect(&tbPortList, | ||
SELECT<const QString&>::OVERLOAD_OF(&QComboBox::activated), | ||
SELECT<const QString&>::OVERLOAD_OF(&QComboBox::textActivated), | ||
this, &PortControl::selectListedPort); | ||
|
||
// setup buttons | ||
|
@@ -91,7 +91,7 @@ PortControl::PortControl(QSerialPort* port, QWidget* parent) : | |
|
||
// setup baud rate selection widget | ||
QObject::connect(ui->cbBaudRate, | ||
SELECT<const QString&>::OVERLOAD_OF(&QComboBox::activated), | ||
SELECT<const QString&>::OVERLOAD_OF(&QComboBox::textActivated), | ||
this, &PortControl::_selectBaudRate); | ||
|
||
// setup parity selection buttons | ||
|
@@ -100,7 +100,7 @@ PortControl::PortControl(QSerialPort* port, QWidget* parent) : | |
parityButtons.addButton(ui->rbOddParity, (int) QSerialPort::OddParity); | ||
|
||
QObject::connect(&parityButtons, | ||
SELECT<int>::OVERLOAD_OF(&QButtonGroup::buttonClicked), | ||
SELECT<int>::OVERLOAD_OF(&QButtonGroup::idClicked), | ||
this, &PortControl::selectParity); | ||
|
||
// setup data bits selection buttons | ||
|
@@ -110,15 +110,15 @@ PortControl::PortControl(QSerialPort* port, QWidget* parent) : | |
dataBitsButtons.addButton(ui->rb5Bits, (int) QSerialPort::Data5); | ||
|
||
QObject::connect(&dataBitsButtons, | ||
SELECT<int>::OVERLOAD_OF(&QButtonGroup::buttonClicked), | ||
SELECT<int>::OVERLOAD_OF(&QButtonGroup::idClicked), | ||
this, &PortControl::selectDataBits); | ||
|
||
// setup stop bits selection buttons | ||
stopBitsButtons.addButton(ui->rb1StopBit, (int) QSerialPort::OneStop); | ||
stopBitsButtons.addButton(ui->rb2StopBit, (int) QSerialPort::TwoStop); | ||
|
||
QObject::connect(&stopBitsButtons, | ||
SELECT<int>::OVERLOAD_OF(&QButtonGroup::buttonClicked), | ||
SELECT<int>::OVERLOAD_OF(&QButtonGroup::idClicked), | ||
this, &PortControl::selectStopBits); | ||
|
||
// setup flow control selection buttons | ||
|
@@ -130,7 +130,7 @@ PortControl::PortControl(QSerialPort* port, QWidget* parent) : | |
(int) QSerialPort::SoftwareControl); | ||
|
||
QObject::connect(&flowControlButtons, | ||
SELECT<int>::OVERLOAD_OF(&QButtonGroup::buttonClicked), | ||
SELECT<int>::OVERLOAD_OF(&QButtonGroup::idClicked), | ||
this, &PortControl::selectFlowControl); | ||
|
||
// initialize signal leds | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,8 +85,9 @@ RecordPanel::RecordPanel(Stream* stream, QWidget *parent) : | |
connect(&recordAction, &QAction::toggled, ui->pbBrowse, &QWidget::setDisabled); | ||
|
||
QCompleter *completer = new QCompleter(this); | ||
// TODO: QDirModel is deprecated, use QFileSystemModel (but it doesn't work) | ||
completer->setModel(new QDirModel(completer)); | ||
// TODO: QDirModel is deprecated, use QFileSystemModel (but it doesn't work) | ||
// Works for me | ||
completer->setModel(new QFileSystemModel(completer)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't work on 5.9 though. But change shouldn't include the comments in case we decide to merge this as is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tried this with Qt 5.15, and it still doesn't work. What is your OS and version if I may ask? My exact Qt version is |
||
completer->setCaseSensitivity(Qt::CaseInsensitive); | ||
ui->leFileName->setCompleter(completer); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ SneakyLineEdit::SneakyLineEdit(QWidget *parent) : | |
{ | ||
setFrame(false); | ||
setStyleSheet("QLineEdit{background-color: rgba(0,0,0,0);}"); | ||
setToolTip(trUtf8("Click to edit")); | ||
setToolTip("Click to edit"); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again why not use |
||
setBold(true); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about this one? This include fails when compiling with Qt5.15 and Qwt 6.1.6 (built by project).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <qwt_text.h>
works.