File indexing completed on 2024-05-05 17:04:26
0001 /* 0002 * This file is part of the KDE project 0003 * Copyright (C) 2014 Arjen Hiemstra <ahiemstra@heimr.nl> 0004 * 0005 * This program is free software; you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation; either version 2 of the License, or 0008 * (at your option) any later version. 0009 * 0010 * This program is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0013 * GNU General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU General Public License 0016 * along with this program; if not, write to the Free Software 0017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #include "QmlGlobalEngine.h" 0021 0022 QmlGlobalEngine* QmlGlobalEngine::sm_instance = 0; 0023 0024 QQmlEngine* QmlGlobalEngine::engine() const 0025 { 0026 return m_engine; 0027 } 0028 0029 void QmlGlobalEngine::setEngine(QQmlEngine* engine) 0030 { 0031 m_engine = engine; 0032 } 0033 0034 QmlGlobalEngine* QmlGlobalEngine::instance() 0035 { 0036 if(!sm_instance) { 0037 sm_instance = new QmlGlobalEngine; 0038 } 0039 return sm_instance; 0040 } 0041 0042 QmlGlobalEngine::QmlGlobalEngine() : m_engine(0) 0043 { 0044 0045 } 0046 0047 QmlGlobalEngine::~QmlGlobalEngine() 0048 { 0049 0050 }