News for hackers. Stuff that matters.
Re:Verdigris: Qt Without Moc by yellow_lead on Tuesday December 31, 2019 @01:35AM (#21919378)
From my experience using Qt, the MOC wasn't a pain point for me. All the generations that I saw were very straightforward and I never had to mess with it.

That's just my experience though, so I'd love to hear where people have found shortcomings.

Also, I am happy to see this project and may try it out nonetheless. Always happy to see work around Qt.

Re:Verdigris: Qt Without Moc by arketyp on Tuesday December 31, 2019 @01:53AM (#21919429)
The convenience of the MOC is its raison d'être. The minor pain point for me is practically being forced to use the Qt Creator IDE. I'm happy to see a possible best of both worlds solution like this.
Re:Verdigris: Qt Without Moc by slavik81 on Tuesday December 31, 2019 @02:21AM (#21919513)
Why do you feel forced to use Qt Creator? I used Visual Studio for years, and these days I just use Vim. While Qt Creator is a great IDE, it has never felt necessary to me.
Re:Verdigris: Qt Without Moc by tjoff on Tuesday December 31, 2019 @04:50AM (#21919977)
I've coded QT for a few years. Have never even opened the QT Creator IDE.
Re:Verdigris: Qt Without Moc by cheez on Tuesday December 31, 2019 @01:31PM (#21923221)
I used to do this too but I started using the form designer and uic + uiloader and it was a nice boost to productivity for creating lame but necessary dialogs.
Re:Verdigris: Qt Without Moc by berkut on Tuesday December 31, 2019 @03:21AM (#21919679)
Most C++ build systems have support for moc generation - CMake even has CMAKE_AUTOMOC which can automatically do it for you with no further intervention with some caveats.
Re:Verdigris: Qt Without Moc by likeliv on Tuesday December 31, 2019 @02:24AM (#21919524)
No need to use Qt creator. Most C++ build systems support moc out of the box, or with minor adjustments.
Re:Verdigris: Qt Without Moc by ahartmetz on Tuesday December 31, 2019 @06:17AM (#21920273)
Qt Creator doesn't even get involved in the build once it has started qmake - a qmake .pro[ject] file is nothing like a Visual Studio project file. You are supposed to make edits other than adding or removing source files by hand. So you really don't need Qt Creator for moc.

Note that qmake is generally easiest for tiny programs such as bug reproducers. For anything nontrivial, it's better to use CMake. Most advanced functionality in qmake is undocumented and weird. Qt itself is moving to CMake with Qt 6.

Re:Verdigris: Qt Without Moc by ailideex on Tuesday December 31, 2019 @02:45AM (#21919578)
I was trying to figure out how to do MOC from gnu make when I came across this, the only other option I saw was to run qmake and then run that generated makefile from my makefile. Of those two options verdigris seemed to be the better choice to me.
Re:Verdigris: Qt Without Moc by marmaduke on Tuesday December 31, 2019 @03:41AM (#21919753)
Re:Verdigris: Qt Without Moc by ailideex on Tuesday December 31, 2019 @03:44AM (#21919761)
Thanks, I guess I should have kept on looking.
Re:Verdigris: Qt Without Moc by ahartmetz on Tuesday December 31, 2019 @06:08AM (#21920235)
CMake also has automoc built-in. You need to do next to nothing for moc support with CMake.
Re:Verdigris: Qt Without Moc by bfrog on Tuesday December 31, 2019 @10:02AM (#21921379)
Yeah, I've never personally used creator... with a decade of Qt usage
Re:Verdigris: Qt Without Moc by ahartmetz on Tuesday December 31, 2019 @06:11AM (#21920251)
I know the author. The project is part tech demo for fun, part shut up the people who complain about moc. And no, moc isn't a pain point in practice.
Re:Verdigris: Qt Without Moc by ailideex on Tuesday December 31, 2019 @09:35AM (#21921214)
Re:Verdigris: Qt Without Moc by ahartmetz on Tuesday December 31, 2019 @10:48AM (#21921762)
I never said that it doesn't work. Okay, maybe tech demo sounds like it doesn't. It does work.
Re:Verdigris: Qt Without Moc by ailideex on Tuesday December 31, 2019 @11:22AM (#21922127)
https://en.wikipedia.org/wiki/Technology_demonstration

> A technology demonstration or demonstrator model, informally known as a tech demo, is a prototype, rough example or an otherwise incomplete version of a conceivable product or future system, put together as proof of concept with the primary purpose of showcasing the possible applications, feasibility, performance and method of an idea for a new technology.

Verdigris has been developed and maintained now for over 4 years. Not only does it work - it has unit tests, CI and issues are addressed by the maintainers.

While verdigris does demonstrate that something is technically possible, so does Apache httpd - does not make Apache httpd a tech demo.

Re:Verdigris: Qt Without Moc by ogoffart on Tuesday December 31, 2019 @12:14PM (#21922592)
It started out as a tech demo. Then people started using it and reported bugs and features request. So support for MSVC was added, and version 1.0 was released. It is relatively low maintenance given that Qt maintain binary compatibility anyway (Qt 6 will be another story).
Re:Verdigris: Qt Without Moc by ailideex on Tuesday December 31, 2019 @12:18PM (#21922626)
> It started out as a tech demo

So anything that starts out as a tech demo should forever be called a tech demo?

> It is relatively low maintenance given that Qt maintain binary compatibility anyway (Qt 6 will be another story).

It is a header only library ... not sure what binary compatibility has to do with it ...

Re:Verdigris: Qt Without Moc by ogoffart on Tuesday December 31, 2019 @12:55PM (#21922945)
No, it is no longer a tech demo.

> not sure what binary compatibility has to do with it ...

Because the meta object generated by the verdigris macro will continue to work with newer version of Qt. But in Qt6, the binary format will change so some adaptations will be required.

Re:Verdigris: Qt Without Moc by ailideex on Tuesday December 31, 2019 @02:03PM (#21923540)
> No, it is no longer a tech demo.

And the only reason I discussed that is because earlier in this thread someone claimed "The project is part tech demo for fun, part shut up the people who complain about moc."

> Because the meta object generated by the verdigris macro will continue to work with newer version of Qt. But in Qt6, the binary format will change so some adaptations will be required.

If it Qt6 retains backwards source code compatibility then verdigris should still keep working I guess. If not then yes verdigris will need to change but in neither of these cases do I see binary compatibility as being relevant - if you compiled something for Qt5 and the binary compatibility breaks to Qt6 then this will affect you regardless of having used verdigris or not no?