File indexing completed on 2024-05-12 05:40:55
0001 #include <QApplication> 0002 0003 #include <QJSEngine> 0004 #include <QQmlEngine> 0005 #include <QQuickStyle> 0006 #include <QUndoStack> 0007 #include <QVariant> 0008 0009 #include "data/campaignmanager.h" 0010 #include "rwidgets/editors/noteeditor/src/notecontainer.h" 0011 #include "rwidgets/editors/noteeditor/src/textedit.h" 0012 #include "controller/view_controller/notecontroller.h" 0013 #include "utils/iohelper.h" 0014 #include <common_qml/theme.h> 0015 0016 #include "model/playermodel.h" 0017 #include "test_root_path.h" 0018 0019 int main(int argc, char* argv[]) 0020 { 0021 QApplication app(argc, argv); 0022 0023 Q_INIT_RESOURCE(viewsqml); 0024 Q_INIT_RESOURCE(textedit); 0025 Q_INIT_RESOURCE(rolisteam); 0026 Q_INIT_RESOURCE(resources); 0027 0028 QQuickStyle::setStyle("rolistyle"); 0029 QQuickStyle::setFallbackStyle("Fusion"); 0030 QIcon::setFallbackSearchPaths(QIcon::fallbackSearchPaths() << ":/resources/rolistheme"); 0031 0032 //PlayerModel* pmodel= new PlayerModel(); 0033 // auto model= new RemotePlayerModel(pmodel); 0034 0035 campaign::CampaignManager campaignManager(nullptr); 0036 campaignManager.openCampaign( 0037 QUrl(QString("file://%1/manual/pdf/campaign").arg(tests::root_path))); 0038 0039 QUndoStack undoStack; 0040 0041 NoteController ctrl( 0042 "uuid1"); 0043 0044 QObject::connect(&ctrl, &NoteController::performCommand, &ctrl, 0045 [&undoStack](QUndoCommand* cmd) { undoStack.push(cmd); }); 0046 ctrl.setLocalGM(true); 0047 0048 ctrl.setLocalId("uuid"); 0049 ctrl.setOwnerId("uuid"); 0050 0051 NoteContainer view(&ctrl); 0052 0053 view.show(); 0054 return app.exec(); 0055 }