About me

我的相片
I'm a web and software developer from Kaohsiung, Taiwan.
I design and implement user interfaces, also contribute to open source projects.
http://penkia.net/portfolio

2014年6月7日 星期六

小玩具 QML Playgrounds

最近隨著 Apple 於 WWDC 發表 Swift 以及附帶的 Xcode 6 Playgrounds 環境, 不但 Swift 主要開發者 Chris Lattner 公開表示受到 Learnable Programming 概念與 Light Table 專案的啟發, Bret Victor 在 2012 年那場知名的演講 Inventing on Principle 又再度引起熱烈討論.

由於之前已經發表過使用 QFileSystemWatcher 監控檔案變化而動態更新 view 的 QML LiveReload 工具; 趁著此波熱議, 花了一個下午做出了 QML 版的 Playgrounds, 原始碼在 Github 上: playgrounds.qml.

目前很簡單的使用 TextEdit 元件 (搭配 Atom Theme 配色), 在內容有修改時觸發 QHttpServer 送出更新過的 source. Loader 本身只負責把 cache 清掉重讀而已. 若要繼續做其他深入功能, 可能得遍歷所有 QObject 的 properties, 並搭配型別顯示不同的控制項.. 往好處想, 至少 syntax highlight 不難做就是了. XD

更新: 在 iOS 上跑也是沒問題的, 科科.

沒有留言: