{"action":"created","issue":{"url":"https://api.github.com/repos/LibrePCB/LibrePCB/issues/230","repository_url":"https://api.github.com/repos/LibrePCB/LibrePCB","labels_url":"https://api.github.com/repos/LibrePCB/LibrePCB/issues/230/labels{/name}","comments_url":"https://api.github.com/repos/LibrePCB/LibrePCB/issues/230/comments","events_url":"https://api.github.com/repos/LibrePCB/LibrePCB/issues/230/events","html_url":"https://github.com/LibrePCB/LibrePCB/issues/230","id":295150643,"number":230,"title":"Support for compiling for Qt > 5.9 ","user":{"login":"NZSmartie","id":1032029,"avatar_url":"https://avatars1.githubusercontent.com/u/1032029?v=4","gravatar_id":"","url":"https://api.github.com/users/NZSmartie","html_url":"https://github.com/NZSmartie","followers_url":"https://api.github.com/users/NZSmartie/followers","following_url":"https://api.github.com/users/NZSmartie/following{/other_user}","gists_url":"https://api.github.com/users/NZSmartie/gists{/gist_id}","starred_url":"https://api.github.com/users/NZSmartie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NZSmartie/subscriptions","organizations_url":"https://api.github.com/users/NZSmartie/orgs","repos_url":"https://api.github.com/users/NZSmartie/repos","events_url":"https://api.github.com/users/NZSmartie/events{/privacy}","received_events_url":"https://api.github.com/users/NZSmartie/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-07T14:08:52Z","updated_at":"2018-02-08T20:23:16Z","closed_at":"2018-02-08T20:23:16Z","author_association":"CONTRIBUTOR","body":"I've successfully compiled LibrePCB using Qt 5.7. But, as of writing this; Qt 5.10 is available which is the toolchain I installed initially on Windows. \r\n\r\nWhen building for Qt 5.10 Mingw, the build fails with the following error:\r\n```\r\nerror: specialization of 'template<class T>QtPrivate::QForeachContainer' class in different namespace [-fpermissive]\r\n```\r\n\r\nThe source of the issue is https://github.com/LibrePCB/LibrePCB/blob/3de6686162b204ce7296847a8d29447ce35705d4/libs/librepcb/common/fileio/serializableobjectlist.h#L376-L394\r\n\r\nThere isn't much information about `QForeachContainer`  but the issue was about the namespace being different. \r\n\r\nMy my proposed fix was to surround the block with the new `QtPrivte` namespace instead of prefixing QForeachContainer:\r\n\r\n```c++\r\n/*****************************************************************************************\r\n * Prevent from using SerializableObjectList in a foreach loop because it always would\r\n * create a deep copy of the list! You should use C++11 range based for loops instead.\r\n ****************************************************************************************/\r\n\r\n#if (QT_VERSION > QT_VERSION_CHECK(5, 9, 0))\r\nnamespace QtPrivate {\r\n#endif\r\n\r\ntemplate <typename T, typename P>\r\nclass QForeachContainer<librepcb::SerializableObjectList<T, P>> { public:\r\n    ~QForeachContainer() = delete;\r\n};\r\ntemplate <typename T, typename P>\r\nclass QForeachContainer<const librepcb::SerializableObjectList<T, P>> { public:\r\n    ~QForeachContainer() = delete;\r\n};\r\n\r\n\r\n#if (QT_VERSION > QT_VERSION_CHECK(5, 9, 0))\r\n} // namespace QtPrivate\r\n#endif\r\n```\r\n\r\nSince i'm new to LibrePCB, and not sure of the scope of this change, can someone else verify this compiles with Qt > 5.9 and functionality isn't broken?"},"comment":{"url":"https://api.github.com/repos/LibrePCB/LibrePCB/issues/comments/364236945","html_url":"https://github.com/LibrePCB/LibrePCB/issues/230#issuecomment-364236945","issue_url":"https://api.github.com/repos/LibrePCB/LibrePCB/issues/230","id":364236945,"user":{"login":"NZSmartie","id":1032029,"avatar_url":"https://avatars1.githubusercontent.com/u/1032029?v=4","gravatar_id":"","url":"https://api.github.com/users/NZSmartie","html_url":"https://github.com/NZSmartie","followers_url":"https://api.github.com/users/NZSmartie/followers","following_url":"https://api.github.com/users/NZSmartie/following{/other_user}","gists_url":"https://api.github.com/users/NZSmartie/gists{/gist_id}","starred_url":"https://api.github.com/users/NZSmartie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NZSmartie/subscriptions","organizations_url":"https://api.github.com/users/NZSmartie/orgs","repos_url":"https://api.github.com/users/NZSmartie/repos","events_url":"https://api.github.com/users/NZSmartie/events{/privacy}","received_events_url":"https://api.github.com/users/NZSmartie/received_events","type":"User","site_admin":false},"created_at":"2018-02-08T20:23:16Z","updated_at":"2018-02-08T20:23:16Z","author_association":"CONTRIBUTOR","body":"Fixed in #231 "}}
{"actor":{"display_login":"NZSmartie"}}