-
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?
Conversation
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.
Thank you for taking time to improve the code. But I'm not sure about merging this at the moment because I want to keep supporting Qt 5.9.
If you could create a separate PR with changes that doesn't break the Qt 5.9 build, that would be nice.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that trUtf8
is deprecated. But is there a reason to not use tr
as well?
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
It seems (int,bool) overload of buttonToggled
is deprecated. But idToggled
is only added at 5.15. I would prefer the buttonToggled(QAbstractButton *button, bool checked)
signal which is still supported in 5.15 and already exists in older versions. Sorry I can't say a reason off the top of my head, but I try to support down to 5.9.
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.
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 comment
The 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.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
There is no point of using OVERLOAD_OF
here as textActivated
is not overloaded.
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 comment
The 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 comment
The 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 5.15.2
.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Again why not use tr
here?
@@ -18,7 +18,9 @@ | |||
*/ | |||
|
|||
#include <QPalette> | |||
#include <QwtText> |
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.
No description provided.