Skip to content
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 inheritance of LocationDelegate #2300

Merged
merged 2 commits into from
Sep 27, 2019
Merged

Fix inheritance of LocationDelegate #2300

merged 2 commits into from
Sep 27, 2019

Conversation

uklotzde
Copy link
Contributor

...including some code cleanup in the base class TableItemDelegate.

@uklotzde uklotzde added this to the 2.3.0 milestone Sep 26, 2019
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are looking good to me.
@ronso0 does this change fix you issue?


class TableItemDelegate : public QStyledItemDelegate {
Q_OBJECT
public:
explicit TableItemDelegate(QTableView* pTableView);
virtual ~TableItemDelegate();
~TableItemDelegate() override = default;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant on one hand, but I remember that there was an issue with a clang compiler warning. Is this still the case? Do we have a number of these compiler warnings elsewhere?
If yes, we should think about a mass fix and drop a note here: https://www.mixxx.org/wiki/doku.php/coding_guidelines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not redundant! It verifies that the destructor of the base class is virtual.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes right, but is this important here?
But nevermind, it is a question if code style. We just need to state somewhere if we want that line or not.

Does this issue a compiler warning, btw?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know and don't really care. If this pattern is not desired then simply remove all lines that match the regex "~.*override = default;" in a separate commit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have read a bit what others think. While I originally was the opinion that it is unnecessary noise, this post convinced me that it is actually sensible isocpp/CppCoreGuidelines#721 (comment)

I have added a sentence to our style guides:

This applies also for default destructors even if it looks noisy.

@ronso0
Copy link
Member

ronso0 commented Sep 27, 2019

The changes are looking good to me.
@ronso0 does this change fix you issue?

somehow it does, at least the OS style can be overwritten.
the font color of selected rows is not applied though. It doesn't matter if the 'location' cell is clicked or not.
I consider this fixed. 'Location' is a cell (like play count) that's not editable so the font color somehow indicates that now.

before:
image

this PR:
image

@daschuer
Copy link
Member

Thank you @uklotzde for this PR and @ronso0 for the manual tests :-)
LGTM

@daschuer daschuer merged commit fa81c2b into mixxxdj:master Sep 27, 2019
@ronso0
Copy link
Member

ronso0 commented Sep 27, 2019

welcome! thx to @uklotzde for the quick fix.

Manual testing would be a no-brainer if there where CI build artifacts for linux..

@uklotzde
Copy link
Contributor Author

But I have no idea how to correctly propagate the highlighted text color to the delegate. This should be done in the common base class.

@uklotzde uklotzde deleted the locationdelegate branch September 28, 2019 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants