fhackenberger / ktikz

KtikZ provides a nice user interface for making pictures using TikZ.
Other
348 stars 34 forks source link

Port to new style signal slot syntax #77

Closed alexfikl closed 1 month ago

alexfikl commented 1 month ago

As described in https://wiki.qt.io/New_Signal_Slot_Syntax.

There are still a few places that use the old syntax that I was planning to leave for a future PR. They are:

  1. common/utils/standardaction.cpp: This forwards some slots as a const char * and requires some more refactoring to make it work with the new style.
  2. ~common/utils/zoomaction.cpp: There's a disconnect in there that isn't ported because I couldn't make it work when compiled with KF5. The signal is deprecated and it doesn't like something..~ Oops, this was just a misunderstanding on my side.. apparently disconnect doesn't work for lambas!
  3. app/mainwindow.cpp: The new syntax is confused by TikzEditorViewAbstract not having a contentsChanged signal. This also seems like it requires some refactoring.

Otherwise, the porting is pretty straightforward. Some places are a bit less pretty because the new syntax requires explicit casting for overloaded functions, but it's not too bad.

jfmcarreira commented 1 month ago

Thanks for the contribution. Modern code is better code :) I hope.