The code looks fine and is almost complete.
First, please make sure that the DXF file can be found and there are no other errors. The return value of importFile should be 0, if the import was successful.
After the import, the scenes and views have to be regenerated with:
documentInterface.regenerateScenes();
Performing an auto zoom is usually also a good idea:
documentInterface.autoZoom();
May I ask, why you are experimenting with QCAD code in C++, not ECMAScript (JavaScript)? I'd highly recommend to use ECMAScript to extend QCAD or to build new applications based on QCAD technology.
This simple example could look like this in ECMAScript (as standalone application):
File 'dummy.js':
var storage = new RMemoryStorage();
var spatialIndex = new RSpatialIndexNavel();
var document = new RDocument(storage, spatialIndex);
var view = new RGraphicsViewQt();
var documentInterface = new RDocumentInterface(document);
var scene = new RGraphicsSceneQt(documentInterface);
view.setScene(scene);
view.show();
documentInterface.importFile("/path/to/file/dummy.dxf", "DXF 2000");
documentInterface.regenerateScenes();
documentInterface.autoZoom();
QCoreApplication.exec();
It can be run like this:
./qcad -autostart dummy.js
Scripts can access the entire API of QCAD and almost all of Qt. Using C++, you would likely sooner or later get to a point where you would have to re-implement some of the QCAD code written in ECMAScript (most of the user interface related code, all of the tools and most widgets are implemented in ECMAScript).