{"id":484,"date":"2012-11-27T14:09:37","date_gmt":"2012-11-27T13:09:37","guid":{"rendered":"http:\/\/www.thelins.se\/johan\/blog\/?p=484"},"modified":"2012-11-28T15:00:27","modified_gmt":"2012-11-28T14:00:27","slug":"changed-behaviour-in-qt-5-beta-2","status":"publish","type":"post","link":"https:\/\/www.thelins.se\/johan\/blog\/2012\/11\/changed-behaviour-in-qt-5-beta-2\/","title":{"rendered":"Changed behaviour in Qt 5 beta 2"},"content":{"rendered":"<p>So, I&#8217;ve taken the time to shift my development target at work to Qt 5 beta 2 (from beta 1). Most things work perfectly, however, qmake has changed its behaviour slightly &#8211; in a subtle evil way.<\/p>\n<p>First, some background. I&#8217;m building a QML plugin. When building it with beta 2, it no longer loads as it could no longer resolve the <tt>vtable<\/tt> for one of my classes.<\/p>\n<pre>$ readelf -sW \/home\/e8johan\/work\/prf\/lamprey\/lamprey\/lib\/liblampreyqml.so | grep UND | grep QmlAudioHardware | c++filt \r\n    45: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND vtable for QmlAudioHardware\r\n    47: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND QmlAudioHardware::nameChanged()\r\n    50: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND QmlAudioHardware::volumeChanged()\r\n   288: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND vtable for QmlAudioHardware\r\n   301: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND QmlAudioHardware::nameChanged()\r\n   308: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND QmlAudioHardware::volumeChanged()<\/pre>\n<p>What was this all about? I looked at the source, commit logs, everything &#8211; nothing had changed and everything was in place. Inheritance &#8211; check, <tt>Q_OBJECT<\/tt> macro &#8211; check, file listed in <tt>HEADERS<\/tt> in the <tt>pro<\/tt>-file &#8211; check&#8230;<\/p>\n<p>Then I started to look at what was actually built. Apparently not the <tt>moc<\/tt>&#8230;<\/p>\n<pre>$ find | grep moc | grep qml\r\n.\/qml-plugin\/build\/moc\r\n.\/qml-plugin\/build\/moc\/moc_qml-plugin.cpp\r\n.\/qml-plugin\/build\/obj\/moc_qml-plugin.o\r\n.\/qml-bindings\/src\/build\/moc\r\n.\/qml-bindings\/src\/build\/moc\/moc_http_downloader.cpp\r\n.\/qml-bindings\/src\/build\/obj\/moc_http_downloader.o<\/pre>\n<p>Since the software I build worked, I simply built it using <tt>qmake &amp;&amp; make -j5<\/tt> and then went for a coffee. When doing <tt>qmake -recursive<\/tt> I notices a long list of header files that weren&#8217;t found:<\/p>\n<pre>$ qmake-qt5 -recursive\r\n...\r\nReading \/home\/e8johan\/work\/prf\/lamprey\/lamprey\/qml-bindings\/qml-bindings.pro\r\n Reading \/home\/e8johan\/work\/prf\/lamprey\/lamprey\/qml-bindings\/src\/src.pro\r\nWARNING: Failure to find: qml_audiohw.h\r\n...<\/pre>\n<p>Why?! Apparently, a colleague of mine has already <a href=\"https:\/\/bugreports.qt-project.org\/browse\/QTBUG-28011\">reported a bug<\/a>, and this is the way that it is supposed to be. I&#8217;m not sure that I agree. This totally breaks the point of <a href=\"http:\/\/lists.trolltech.com\/qt-interest\/2006-03\/thread00323-0.html\">DEPENDPATH<\/a> to me.<\/p>\n<p>The fix is easy, so now it works, but I&#8217;m not happy with loads of ..\/include in my pro-files due to the way my codebase is structured. <span style=\"text-decoration: line-through;\">I just wonder if this is what we really want&#8230;<\/span><\/p>\n<p><em>Update!<\/em> and it turns out that, yes, that is really what we do want. Apparently this feature has broken code (VPATH causing the wrong files to be picked up). So this is by design.<\/p>\n<p><em>Update again!<\/em> running <tt>qmake -Wall -r<\/tt> treats the missing header warning as an error. Highly recommended!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, I&#8217;ve taken the time to shift my development target at work to Qt 5 beta 2 (from beta 1). Most things work perfectly, however, qmake has changed its behaviour slightly &#8211; in a subtle evil way. First, some background. I&#8217;m building a QML plugin. When building it with beta 2, it no longer loads &hellip; <a href=\"https:\/\/www.thelins.se\/johan\/blog\/2012\/11\/changed-behaviour-in-qt-5-beta-2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Changed behaviour in Qt 5 beta 2<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6,4],"tags":[],"class_list":["post-484","post","type-post","status-publish","format-standard","hentry","category-kde4","category-linux","category-qt"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/comments?post=484"}],"version-history":[{"count":4,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/484\/revisions"}],"predecessor-version":[{"id":486,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/484\/revisions\/486"}],"wp:attachment":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/media?parent=484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/categories?post=484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/tags?post=484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}