-
Notifications
You must be signed in to change notification settings - Fork 10
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
QoL Feature Request: "Copy Kanji" / "Append Kanji" bahaviour #37
Comments
Hm... I'm not sure if this is a feature of zkanji or rather a bug. I made this so long ago. As a workaround, you can copy parts of words by selecting only the letters you need. This works in most word lists, including the dictionary. When you select a part, a popup context menu appears that only applies to what you selected. I would need more time to consider what to do with the current "copy kanji" option. It's different from the "copy written form" in the clipboard sub-menu as that would copy the kana too, and both seem to be needed, but a separate kanji copy too. I assume I originally thought that selecting a part is for that, but it might not be the best design choice. |
oh yeah, I had tried that before, I left click dragged/highlighted 小 in 小説, did a "Copy Kanji" and nothing gets put into the clipboard, same for "Append Kanji" - did I do something wrong or misunderstood your explanation? I was also downloading the source code and installing VSCommunity and QT just in case the only option was for me to try and fix it, but all I have in the programming department is a year of hobby/self-study of C++ (partially forgotten), therefore it will already be a daunting task (if not impossible) for me to get the code to compile... :) |
That's clearly a bug then. It works for me so not sure how I will fix this. The code should compile (if you install the QT add-on in VS Community) unlike other projects, I tried to limit my use of external stuff, so you don't need any special build systems and makes that make it so annoying to compile most other OSS out there. You might have to change some paths in the QT add-on at best. If you decide to go this way I can give pointers where to debug in the code. |
OXvCVa16P5.mp4I've made a quick video (above) to show how smooth my standard look up method used to be with the old zkanji, maybe by seeying it some good ideas might come to mind. |
Yes this is how it looks in VS2019 (Just checked. The screenshot was from VS2015 that I used for zkani.) You installed the MinGW version which is for the MinGW compiler. The folder compatible with VS should have msvc in the path. unnecessary edit: actually the new version of the add-on looks the same in VS2015, I just reverted to an old version because it worked better for me. |
Before I forget, you'll also need to copy the zkanji data folder next to the newly compiled zkanji executable because it can't run without data files. Compile first, check where the executable is placed, then copy it in there. |
I see Go4FcT0pN3.mp4I suspect the add-on for VS 2019 might be bugged, should I downgrade to VS 2015? (unless I'm doing something else wrong) |
Strange. I can't get that Qt Project Settings window to appear in VS2019. It looks like the old add-on I have in VS2015. The VS2019 one is a page in the normal project settings. Did you install it from within Visual Studio, or downloaded it separately? Mine was installed with the VS interface from the "extensions/manage extensions" menu. The add-on version is 2.7.1.8 there. |
A lot of people seem to have this exact same bug. Look: https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019&ssr=false#review-details |
oh wait, I think I got it, the includes from the project must be wrong, need to check all the paths :) |
Thank you |
tried some more today, apparently zkanjigridview.cpp, zkanjiwidget.cpp, zlistview.cpp and kanjistroke.cpp where all giving build error because QPainterPath wasn't declared or something, maybe it was being brought in through some other Qt header that doesn't include it anymore in the more recent release? Anyway I solved those by including QPainterPath in those 4 files. And so I'm left with these errors: I looked up the first one, this comes up: |
I don't understand this error, but if it fixes compilation then it's fine. Removing those consts before the QStrings should have no negative effect. |
Found the same bug report about the first one. You shouldn't have downgraded, it's a bug in VS that doesn't affect compilation. It only shows up as error while VS is checking your currently edited source for would-be bugs, and it falsely reports this. The compiler is independent of this editor thing though. I'm still confused about the others. |
well even if it diminished the errors report to 9 is not even the correct way because it generated another error in the process xD
The "thus, Type1 & is not allowed" is the cause of the new error. |
I'm currently installing the latest version of Qt, because my old one doesn't work with VS2019. It'll take a little time as it's over 10Gb (I like to get Qt sources and debug info too just in case) but hopefully I'll get the same problems here and then will be able to fix them. |
( oh btw, don't know if it matters, but because of VS 2019, the lower my C++ version can go is ISO 14 :\ ) |
I got everything installed and getting the same errors as you. Stay tuned! The C++ version shouldn't matter. The newer the better! ...Unless it broke something, but then it should be fixed. |
Additional note - that line I had identified is not even the one where the problem is at... somehow messing it up decreased the error count to 9, but if I comment out the function completely and then rebuild, the errors are still 12... |
I found the source of the issue. It's a templated class of mine, which is way over the level of a beginner, so don't worry if you couldn't find it. I will try to fix it now but it might take hours, or might be done in 10 seconds. The const you saw at the reported line is a red herring. I think the error refers to a missing const in my template class' source. |
Nice! Looking forward to being able to build the program :D |
I fixed it and pushed the correct code to GitHub. I'll also post the solution here too, but right now it still doesn't finish, as the linker settings are forgotten when you bring a project to a new version of Visual Studio... I'm trying to fix it now. |
My fix was to place a const version of functions in smartvector.h at about line 66.
Almost the exact same code is found there but without the consts. My other issue was trying to link 64 bit Qt to a 32 bit zkanji. I set this up correctly in VS2015 but when importing to VS2019 it conveniently forgot about this little detail... Zkanji will only run if you place the data folder next to the executable (edit: with all data files inside), so make sure you do this once you generated a zkanji.exe. Now zkanji starts up... and crashes immediately, with an issue regarding translations... I have no idea how this works within Qt, so another debug session coming up... |
Fixed that error too, and zkanji is now running. You'll have to fetch zcolorcombobox.cpp again, because this fix touches over a hundred lines. Edit1: There are still errors popping up when I close zkanji, all possibly due to change in compiler (the above error was thanks to this too,) but it seems to work somewhat. I'll be fixing all those issues too with time. Edit2: Now that I think about it, I will have to update the compiling instructions as well, since others might try a newer version of VS, and they might fall into the trap of a faulty IDE too... |
Fixed this last crash too, or rather worked around it, which was another non-bug, just picky VS. You should fetch anything new with Git or just download the changed files "groups.h" "groups.cpp" and "groupslegacy.cpp" IIRC. |
So now I'm missing only zcolorcombobox.cpp fix and those 3 files mentioned above :) |
I fixed the missing updated files on the master branch just now. Since the time I last pushed changes to GitHub they changed the Git add-on in VS, and now there is one extra step in doing everything... |
The Qt add-on in VS must be lost in where to find the DLLs, if it doesn't work right away. If you try to debug zkanji, make sure to copy the debug version of Qt's DLLs, the ones ending with a |
I manually copied the version without the "d", but I wasn't trying to debug when I got that error, I was running zkanji.exe (built with Debug x64 settings) |
I compiled zkanji with VS2019 and the latest Qt5 successfully, there was nothing much else to it.
I'll post screenshots of my VS2019 project settings just in case. (Note the Active keyword at the top and x64 set. If you compile for Win32 or Release, those have their own separate settings) |
One thing to note, every time I changed something, I did a "Clean Solution" (found in the build menu) so VS doesn't accidentally use wrong files it compiled before. |
Thanks for all all the screens, I was missing Debugging->Environment path :P |
VS does interesting stuff. I checked my linker settings' additional dependencies, and it's empty beside the default value. But I remember changing it... So it must have shuffled around what I entered randomly... 🗡️ 🗡️ 🗡️ |
Have you seen the paragraph on the main page (if you scroll down to below the source code) about deploying zkanji?
edit: I'm not sure if this will work with the debug build, but if not, you can replace the DLLs in the subfolders with the debug variants. |
err... I doubleclick windeployqt.exe and it appears and disapper immediately (it essentially flashes into and out of existence), I don't even have the time to write anything into it... :( |
Sorry, I should have mentioned that this is done in the command prompt. windows-button+R, enter I really have to update the explanation about this... edit: The official deployment page of Qt also says this:
I don't know if this is relevant to you or not, but I leave it here just in case. (edit2: if it is needed, you can start that batch file from the command prompt before using windeployqt.) |
Yep, it worked, no problems left :D |
Great! I'll close this discussion tomorrow evening unless the situation changes. If anything new comes up that's unrelated, please open another issue for it. I might update the instructions on the main page for building zkanji, though I won't do this before the weekend for sure. |
No problems at all, I've managed to compile for release, took only the necessary files and moved them to a "zkanji beta 1.01" folder, everything works as expected :) |
Not sure if this is helpful, but I opened the Discussions board for the project. Feel free to write there. I hope GitHub won't slack off notifying me this time though, as it never does regarding bug reports for years now. |
This is a feature from the old zkanji: lets say there is a word like 小言 (just came up in a game) for which I know the kanjis but not the word itself, the way I would go about looking it up was this:
assuming I couldn't guess the reading, I would write a word containing the fist kanji, like 小説, right click the first kanji, copy it, then look up 言う and append the kanji.
My clipboard would contain 小言, so I would paste it into the search.
With the newer zkanji, I look up 小説, I right click on 小 and choose "Copy Kanji", rather than copying only 小 it copy both kanjis, then I do the same step for 言う by choosing "Append Kanji", and the う get left out since it is not a kanji, but if I had used a word like 言語, then the second kanji would have been picked as well.
So now my clipboard contains 小説言, so I paste it and then need to delete 説 - so this makes the lookup of unknown words more clunky compared to the old zkanji
Would be possible to modify the "Copy Kanji" and "Append Kanji" functions so that they correctly do what they say, by copying and appending a single kanji rather than copy/append all the kanjis in the word? ^_^'
The text was updated successfully, but these errors were encountered: