├── .gitignore ├── 3rdparty ├── 3rdparty.pro ├── catch │ ├── catch.hpp │ └── catch.pri └── trompeloeil │ ├── trompeloeil.hpp │ ├── trompeloeil.pri │ └── trompeloeil_catch.hpp ├── LICENSE ├── README.md ├── cpp-qt-live-coding.pro ├── example ├── Page1Form.qml ├── Page2Form.ui.qml ├── example ├── example.pro ├── live.qml ├── main.cpp ├── main.qml ├── qml.qrc └── qtquickcontrols2.conf ├── lib ├── FileSelectionDialog.qml ├── LiveCodingPanel.qml ├── com_machinekoder_livecoding.qrc ├── cpp_qt_live_coding_plugin.cpp ├── cpp_qt_live_coding_plugin.h ├── filewatcher.cpp ├── filewatcher.h ├── lib.pro ├── livecoding.cpp ├── livecoding.h ├── livewindow.cpp ├── livewindow.h ├── livewindow.qrc ├── projectbrowser.cpp ├── projectbrowser.h └── qmldir └── tests ├── main.cpp ├── test_filewatcher.cpp └── tests.pro /.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | .qmake.cache 36 | .qmake.stash 37 | *.qmlc 38 | 39 | # qtcreator generated files 40 | *.pro.user* 41 | 42 | # xemacs temporary files 43 | *.flc 44 | 45 | # Vim temporary files 46 | .*.swp 47 | 48 | # Visual Studio generated files 49 | *.ib_pdb_index 50 | *.idb 51 | *.ilk 52 | *.pdb 53 | *.sln 54 | *.suo 55 | *.vcproj 56 | *vcproj.*.*.user 57 | *.ncb 58 | *.sdf 59 | *.opensdf 60 | *.vcxproj 61 | *vcxproj.* 62 | 63 | # MinGW generated files 64 | *.Debug 65 | *.Release 66 | 67 | # Python byte code 68 | *.pyc 69 | 70 | # Binaries 71 | # -------- 72 | *.dll 73 | *.exe 74 | 75 | -------------------------------------------------------------------------------- /3rdparty/3rdparty.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | CONFIG += ordered 3 | -------------------------------------------------------------------------------- /3rdparty/catch/catch.pri: -------------------------------------------------------------------------------- 1 | 2 | INCLUDEPATH += $$PWD 3 | -------------------------------------------------------------------------------- /3rdparty/trompeloeil/trompeloeil.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Trompeloeil C++ mocking framework 3 | * 4 | * Copyright Björn Fahller 2014-2019 5 | * Copyright (C) 2017, 2018 Andrew Paxie 6 | * 7 | * Use, modification and distribution is subject to the 8 | * Boost Software License, Version 1.0. (See accompanying 9 | * file LICENSE_1_0.txt or copy at 10 | * http://www.boost.org/LICENSE_1_0.txt) 11 | * 12 | * Project home: https://github.com/rollbear/trompeloeil 13 | */ 14 | 15 | #ifndef TROMPELOEIL_HPP_ 16 | #define TROMPELOEIL_HPP_ 17 | 18 | 19 | // trompe l'oeil noun (Concise Encyclopedia) 20 | // Style of representation in which a painted object is intended 21 | // to deceive the viewer into believing it is the object itself... 22 | 23 | // project home: https://github.com/rollbear/trompeloeil 24 | 25 | 26 | // Deficiencies and missing features 27 | // * Mocking function templates is not supported 28 | // * If a macro kills a kitten, this threatens extinction of all felines! 29 | 30 | #if defined(_MSC_VER) 31 | 32 | # define TROMPELOEIL_NORETURN __declspec(noreturn) 33 | 34 | # if (!defined(__cplusplus) || _MSC_VER < 1900) 35 | # error requires C++ in Visual Studio 2015 RC or later 36 | # endif 37 | 38 | #else 39 | 40 | # define TROMPELOEIL_NORETURN [[noreturn]] 41 | 42 | # if (!defined(__cplusplus) || __cplusplus < 201103L) 43 | # error requires C++11 or higher 44 | # endif 45 | 46 | #endif 47 | 48 | #if defined(__clang__) 49 | 50 | # define TROMPELOEIL_CLANG 1 51 | # define TROMPELOEIL_GCC 0 52 | # define TROMPELOEIL_MSVC 0 53 | 54 | # define TROMPELOEIL_CLANG_VERSION \ 55 | (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) 56 | 57 | # define TROMPELOEIL_GCC_VERSION 0 58 | 59 | # define TROMPELOEIL_CPLUSPLUS __cplusplus 60 | 61 | #elif defined(__GNUC__) 62 | 63 | # define TROMPELOEIL_CLANG 0 64 | # define TROMPELOEIL_GCC 1 65 | # define TROMPELOEIL_MSVC 0 66 | 67 | # define TROMPELOEIL_CLANG_VERSION 0 68 | # define TROMPELOEIL_GCC_VERSION \ 69 | (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) 70 | 71 | # define TROMPELOEIL_CPLUSPLUS __cplusplus 72 | 73 | #elif defined(_MSC_VER) 74 | 75 | # define TROMPELOEIL_CLANG 0 76 | # define TROMPELOEIL_GCC 0 77 | # define TROMPELOEIL_MSVC 1 78 | 79 | # define TROMPELOEIL_CLANG_VERSION 0 80 | # define TROMPELOEIL_GCC_VERSION 0 81 | 82 | # if defined(_MSVC_LANG) 83 | 84 | // Compiler is at least Microsoft Visual Studio 2015 Update 3. 85 | # define TROMPELOEIL_CPLUSPLUS _MSVC_LANG 86 | 87 | # else /* defined(_MSVC_LANG) */ 88 | 89 | /* 90 | * This version of Microsoft Visual C++ is released 91 | * in a version of Microsoft Visual Studio between 92 | * 2015 RC and less than 2015 Update 3. 93 | * 94 | * It is an amalgam of C++ versions, with no provision 95 | * to specify C++11 mode. 96 | * 97 | * It also has a __cplusplus macro stuck at 199711L with 98 | * no way to change it, such as /Zc:__cplusplus. 99 | * 100 | * Assume the C++14 code path, but don't promise that it is a 101 | * fully conforming implementation of C++14 either. 102 | * Hence a value of 201401L, which less than 201402L, 103 | * the standards conforming value of __cplusplus. 104 | */ 105 | # define TROMPELOEIL_CPLUSPLUS 201401L 106 | 107 | # endif /* !defined(_MSVC_LANG) */ 108 | 109 | #endif 110 | 111 | #include 112 | #include 113 | #include 114 | #include 115 | #include 116 | #include 117 | #include 118 | #include 119 | #include 120 | #include 121 | #include 122 | #include 123 | #include 124 | 125 | 126 | #ifdef TROMPELOEIL_SANITY_CHECKS 127 | #include 128 | #define TROMPELOEIL_ASSERT(x) assert(x) 129 | #else 130 | #define TROMPELOEIL_ASSERT(x) do {} while (false) 131 | #endif 132 | 133 | #define TROMPELOEIL_IDENTITY(...) __VA_ARGS__ // work around stupid MS VS2015 RC bug 134 | 135 | #define TROMPELOEIL_ARG16(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15, ...) _15 136 | 137 | #define TROMPELOEIL_COUNT(...) \ 138 | TROMPELOEIL_IDENTITY(TROMPELOEIL_ARG16(__VA_ARGS__, \ 139 | 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) 140 | 141 | #define TROMPELOEIL_CONCAT_(x, y) x ## y 142 | #define TROMPELOEIL_CONCAT(x, y) TROMPELOEIL_CONCAT_(x, y) 143 | 144 | #define TROMPELOEIL_INIT_WITH_STR15(base, x, ...) \ 145 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR14(base, __VA_ARGS__) 146 | 147 | #define TROMPELOEIL_INIT_WITH_STR14(base, x, ...) \ 148 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR13(base, __VA_ARGS__) 149 | 150 | #define TROMPELOEIL_INIT_WITH_STR13(base, x, ...) \ 151 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR12(base, __VA_ARGS__) 152 | 153 | #define TROMPELOEIL_INIT_WITH_STR12(base, x, ...) \ 154 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR11(base, __VA_ARGS__) 155 | 156 | #define TROMPELOEIL_INIT_WITH_STR11(base, x, ...) \ 157 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR10(base, __VA_ARGS__) 158 | 159 | #define TROMPELOEIL_INIT_WITH_STR10(base, x, ...) \ 160 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR9(base, __VA_ARGS__) 161 | 162 | #define TROMPELOEIL_INIT_WITH_STR9(base, x, ...) \ 163 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR8(base, __VA_ARGS__) 164 | 165 | #define TROMPELOEIL_INIT_WITH_STR8(base, x, ...) \ 166 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR7(base, __VA_ARGS__) 167 | 168 | #define TROMPELOEIL_INIT_WITH_STR7(base, x, ...) \ 169 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR6(base, __VA_ARGS__) 170 | 171 | #define TROMPELOEIL_INIT_WITH_STR6(base, x, ...) \ 172 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR5(base, __VA_ARGS__) 173 | 174 | #define TROMPELOEIL_INIT_WITH_STR5(base, x, ...) \ 175 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR4(base, __VA_ARGS__) 176 | 177 | #define TROMPELOEIL_INIT_WITH_STR4(base, x, ...) \ 178 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR3(base, __VA_ARGS__) 179 | 180 | #define TROMPELOEIL_INIT_WITH_STR3(base, x, ...) \ 181 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR2(base, __VA_ARGS__) 182 | 183 | #define TROMPELOEIL_INIT_WITH_STR2(base, x, ...) \ 184 | base{#x, x}, TROMPELOEIL_INIT_WITH_STR1(base, __VA_ARGS__) 185 | 186 | #define TROMPELOEIL_INIT_WITH_STR1(base, x) \ 187 | base{#x, x} 188 | 189 | #define TROMPELOEIL_INIT_WITH_STR0(base) 190 | 191 | #define TROMPELOEIL_INIT_WITH_STR(base, ...) \ 192 | TROMPELOEIL_CONCAT(TROMPELOEIL_INIT_WITH_STR, \ 193 | TROMPELOEIL_COUNT(__VA_ARGS__))(base, __VA_ARGS__) 194 | 195 | #define TROMPELOEIL_PARAM_LIST15(func_type) \ 196 | TROMPELOEIL_PARAM_LIST14(func_type), \ 197 | ::trompeloeil::param_list_t p15 198 | 199 | #define TROMPELOEIL_PARAM_LIST14(func_type) \ 200 | TROMPELOEIL_PARAM_LIST13(func_type), \ 201 | ::trompeloeil::param_list_t p14 202 | 203 | #define TROMPELOEIL_PARAM_LIST13(func_type) \ 204 | TROMPELOEIL_PARAM_LIST12(func_type), \ 205 | ::trompeloeil::param_list_t p13 206 | 207 | #define TROMPELOEIL_PARAM_LIST12(func_type) \ 208 | TROMPELOEIL_PARAM_LIST11(func_type), \ 209 | ::trompeloeil::param_list_t p12 210 | 211 | #define TROMPELOEIL_PARAM_LIST11(func_type) \ 212 | TROMPELOEIL_PARAM_LIST10(func_type), \ 213 | ::trompeloeil::param_list_t p11 214 | 215 | #define TROMPELOEIL_PARAM_LIST10(func_type) \ 216 | TROMPELOEIL_PARAM_LIST9(func_type), \ 217 | ::trompeloeil::param_list_t p10 218 | 219 | #define TROMPELOEIL_PARAM_LIST9(func_type) \ 220 | TROMPELOEIL_PARAM_LIST8(func_type), \ 221 | ::trompeloeil::param_list_t p9 222 | 223 | #define TROMPELOEIL_PARAM_LIST8(func_type) \ 224 | TROMPELOEIL_PARAM_LIST7(func_type), \ 225 | ::trompeloeil::param_list_t p8 226 | 227 | #define TROMPELOEIL_PARAM_LIST7(func_type) \ 228 | TROMPELOEIL_PARAM_LIST6(func_type), \ 229 | ::trompeloeil::param_list_t p7 230 | 231 | #define TROMPELOEIL_PARAM_LIST6(func_type) \ 232 | TROMPELOEIL_PARAM_LIST5(func_type), \ 233 | ::trompeloeil::param_list_t p6 234 | 235 | #define TROMPELOEIL_PARAM_LIST5(func_type) \ 236 | TROMPELOEIL_PARAM_LIST4(func_type), \ 237 | ::trompeloeil::param_list_t p5 238 | 239 | #define TROMPELOEIL_PARAM_LIST4(func_type) \ 240 | TROMPELOEIL_PARAM_LIST3(func_type), \ 241 | ::trompeloeil::param_list_t p4 242 | 243 | #define TROMPELOEIL_PARAM_LIST3(func_type) \ 244 | TROMPELOEIL_PARAM_LIST2(func_type), \ 245 | ::trompeloeil::param_list_t p3 246 | 247 | #define TROMPELOEIL_PARAM_LIST2(func_type) \ 248 | TROMPELOEIL_PARAM_LIST1(func_type), \ 249 | ::trompeloeil::param_list_t p2 250 | 251 | #define TROMPELOEIL_PARAM_LIST1(func_type) \ 252 | ::trompeloeil::param_list_t p1 253 | 254 | #define TROMPELOEIL_PARAM_LIST0(func_type) 255 | 256 | #define TROMPELOEIL_PARAM_LIST(num, func_type) \ 257 | TROMPELOEIL_CONCAT(TROMPELOEIL_PARAM_LIST, num)(func_type) 258 | 259 | 260 | #define TROMPELOEIL_PARAMS15 TROMPELOEIL_PARAMS14, p15 261 | #define TROMPELOEIL_PARAMS14 TROMPELOEIL_PARAMS13, p14 262 | #define TROMPELOEIL_PARAMS13 TROMPELOEIL_PARAMS12, p13 263 | #define TROMPELOEIL_PARAMS12 TROMPELOEIL_PARAMS11, p12 264 | #define TROMPELOEIL_PARAMS11 TROMPELOEIL_PARAMS10, p11 265 | #define TROMPELOEIL_PARAMS10 TROMPELOEIL_PARAMS9, p10 266 | #define TROMPELOEIL_PARAMS9 TROMPELOEIL_PARAMS8, p9 267 | #define TROMPELOEIL_PARAMS8 TROMPELOEIL_PARAMS7, p8 268 | #define TROMPELOEIL_PARAMS7 TROMPELOEIL_PARAMS6, p7 269 | #define TROMPELOEIL_PARAMS6 TROMPELOEIL_PARAMS5, p6 270 | #define TROMPELOEIL_PARAMS5 TROMPELOEIL_PARAMS4, p5 271 | #define TROMPELOEIL_PARAMS4 TROMPELOEIL_PARAMS3, p4 272 | #define TROMPELOEIL_PARAMS3 TROMPELOEIL_PARAMS2, p3 273 | #define TROMPELOEIL_PARAMS2 TROMPELOEIL_PARAMS1, p2 274 | #define TROMPELOEIL_PARAMS1 , p1 275 | #define TROMPELOEIL_PARAMS0 276 | 277 | #define TROMPELOEIL_PARAMS(num) TROMPELOEIL_CONCAT(TROMPELOEIL_PARAMS, num) 278 | 279 | 280 | #if (TROMPELOEIL_CPLUSPLUS == 201103L) 281 | 282 | #define TROMPELOEIL_DECLTYPE_AUTO \ 283 | auto 284 | 285 | #define TROMPELOEIL_TRAILING_RETURN_TYPE(return_type) \ 286 | -> return_type 287 | 288 | #else /* (TROMPELOEIL_CPLUSPLUS == 201103L) */ 289 | 290 | #define TROMPELOEIL_DECLTYPE_AUTO \ 291 | decltype(auto) 292 | 293 | #define TROMPELOEIL_TRAILING_RETURN_TYPE(return_type) \ 294 | /**/ 295 | 296 | #endif /* !(TROMPELOEIL_CPLUSPLUS == 201103L) */ 297 | 298 | static constexpr bool trompeloeil_movable_mock = false; 299 | 300 | namespace trompeloeil 301 | { 302 | template 303 | struct identity_type 304 | { 305 | using type = T; 306 | }; 307 | 308 | template 309 | identity_type 310 | nonconst_member_signature(R (C::*)(Args...)) 311 | { 312 | return {}; 313 | } 314 | 315 | template 316 | identity_type 317 | const_member_signature(R (C::*)(Args...) const) 318 | { 319 | return {}; 320 | } 321 | 322 | template 323 | struct void_t_ 324 | { 325 | using type = void; 326 | }; 327 | 328 | template 329 | using void_t = typename void_t_::type; 330 | 331 | template