-
Notifications
You must be signed in to change notification settings - Fork 76
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
Implement QListElement for QLine(F) #1053
Conversation
9f2477c
to
b475b38
Compare
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.
Hi @SanderVocke and thank you for the contribution!
The code it and of itself is good.
We do actually have a generate.sh
script inside cxx-qt-lib/src/core/qlist/
that we used to generate all of these files.
So instead of adding the files for QLine(F) manually, you should be able to simply add a line to that script and execute it.
Can you please change to using that?
As it would allow us to update the code far easier if we ever need to e.g. add a new function to the trait.
Regarding the licensing:
We don't have a CLA, so you shouldn't have to do anything license-wise.
As you're contributing to this repo you implicitly agree that your code will made open-source and dual-licensed as apache 2.0 and MIT.
If you edit the generate.sh script to generate these files, your name won't be in the SPDX-FileContributor list of the QLine/F files. But you could simply add yourself as a SPDX-FileContributor on the generate.sh
script itself.
Having multiple contributors is not a problem.
OK, switched to the auto-generated version and included the change to generate.sh. |
77eaa36
to
b7e1759
Compare
@SanderVocke thank you for the follow-up. I'm happy to approve this. CI is still failing due to an issue with the formatting though. |
Head branch was pushed to by a user without write access
The formatting should be fixed now. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1053 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 71 71
Lines 11928 11928
=========================================
Hits 11928 11928 ☔ View full report in Codecov by Sentry. |
So this fails with Qt 5 in CI, I think it fails due to the QVector vs QList situation ? Eg in Qt 5 QVector and QList were different, but in Qt 6 QVector is an alias of QList. QPainter::drawLines in Qt 5 used a QVector, so i think if you change the type to be a QVector it'll maybe work ? So i think what you need to do is
Then it'll work with Qt 5 and Qt 6 https://doc.qt.io/qt-5/qpainter.html#drawLines-1 |
Ah, before you approve the CI run - I still need to run this locally against Qt5. |
I tried this locally against Qt5 and it builds fine, but some tests fail. In most cases it seems to be tests that make a diff between two result files, and the differences it finds are purely whitespace. Would you mind running the CI and having a look for yourself? |
Locally it could be a difference in clang-format versions or something, but CI seems happy :-) |
@LeonMatthesKDAB Not to push, but could you have another look? |
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.
@SanderVocke sorry I missed your latest update.
Looks great now and can be merged.
Thank you for the contribution!
a603811
to
7160d7d
Compare
(Note CI is failing due to macOS changing clang-format versions, see discussion in #1083 ) |
Cheers, so if I understand correctly it is a matter of waiting for the clang-format to be fixed, then updating this branch? |
Yes, this is separate from your change, once it is fixed we'll rebase yours and it'll land :-) |
7160d7d
to
1938323
Compare
QListElement was not implemented for these types yet.
Let me know if I need to do anything in particular to be able to contribute a PR, license/copyright-wise. - right now I just copied the header from other similar files and put my name there.
This change builds for me and I am able to use the new list types.
Note that I also added two convenience methods to QPainter (which exist in Qt too), for drawing these lists of lines.