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: dictserver reimplemented with signal #1313

Closed
wants to merge 6 commits into from

Conversation

xiaoyifang
Copy link
Owner

No description provided.

@shenlebantongying
Copy link
Collaborator

This reminds me that there are some old code that moves some class declarations to the header files to deal with the Q_OBJECT in .cc file.

https://github.com/search?q=repo%3Axiaoyifang%2Fgoldendict-ng%20%20%2F%2F%2F%20Exposed%20here%20for%20moc%20&type=code

However, this PR's approach is used by Qt itself and KDE aggressively.

https://github.com/search?q=repo%3Aqt%2Fqtbase+%22.moc%22+language%3AC%2B%2B&type=code&l=C%2B%2B

https://planet.kde.org/friedrich-kossebau-2023-06-28-include-also-moc-files-of-headers/

Maybe we can move the declarations under /// Exposed here for moc into their .cc and #include xxxx.moc too. All related .hh under /sr/dict will consistently only have makeDictionaries.

@xiaoyifang
Copy link
Owner Author

This reminds me that there are some old code that moves some class declarations to the header files to deal with the Q_OBJECT in .cc file.

https://github.com/search?q=repo%3Axiaoyifang%2Fgoldendict-ng%20%20%2F%2F%2F%20Exposed%20here%20for%20moc%20&type=code

However, this PR's approach is used by Qt itself and KDE aggressively.

https://github.com/search?q=repo%3Aqt%2Fqtbase+%22.moc%22+language%3AC%2B%2B&type=code&l=C%2B%2B

https://planet.kde.org/friedrich-kossebau-2023-06-28-include-also-moc-files-of-headers/

Maybe we can move the declarations under /// Exposed here for moc into their .cc and #include xxxx.moc too. All related .hh under /sr/dict will consistently only have makeDictionaries.

Can you start a new PR?

@shenlebantongying
Copy link
Collaborator

Yes, I want to do it this weekend.

shenlebantongying added a commit to shenlebantongying/goldendict-ng that referenced this pull request Dec 12, 2023
we can define class with Q_OBJECT in a .cpp file by include .moc
 explicitly

inspired by xiaoyifang#1313
@xiaoyifang xiaoyifang linked an issue Dec 13, 2023 that may be closed by this pull request
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

0.0% Coverage on New Code (required ≥ 80%)
8.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@xiaoyifang xiaoyifang changed the title fix: dictserver add moc to the source file fix: dictserver reimplemented with signal Dec 19, 2023
@xiaoyifang xiaoyifang closed this Dec 25, 2023
@xiaoyifang
Copy link
Owner Author

in #1338

@xiaoyifang xiaoyifang deleted the opt/moc-dictserver branch December 28, 2023 01:43
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.

QTcpSocket cause the GUI freeze
2 participants