Mercurial > projects > qtd
diff cpp/qt_qtd/qtd_core.cpp @ 1:e78566595089
initial import
author | mandel |
---|---|
date | Mon, 11 May 2009 16:01:50 +0000 |
parents | |
children | 7be693ea7070 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpp/qt_qtd/qtd_core.cpp Mon May 11 16:01:50 2009 +0000 @@ -0,0 +1,41 @@ +/** +* +* Copyright: Copyright QtD Team, 2008-2009 +* License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a> +* +* Copyright QtD Team, 2008-2009 +* Distributed under the Boost Software License, Version 1.0. +* (See accompanying file boost-license-1.0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +* +*/ + +#include "qtd_core.h" +#include <iostream> + +extern "C" DLL_PUBLIC QModelIndex qtd_to_QModelIndex(QModelIndexAccessor mia) +{ + return * (QModelIndex *) (&mia) ; +} + +extern "C" DLL_PUBLIC QModelIndexAccessor qtd_from_QModelIndex(const QModelIndex &index) +{ + QModelIndexAccessor mia = { + index.row(), + index.column(), + index.internalPointer(), + (QAbstractItemModel *) index.model() + }; + + return mia; +} + +#ifdef CPP_SHARED +QTD_EXPORT_VAR(_d_toUtf8) +QTD_EXPORT_VAR(__qtd_dummy) + +extern "C" DLL_PUBLIC void __qtd_qtd_core_initCallBacks(pfunc_abstr d_func, pfunc_abstr dummy) { + QTD_EXPORT_VAR_SET(_d_toUtf8, d_func); + QTD_EXPORT_VAR_SET(__qtd_dummy, dummy); +// std::cout << _d_toUtf8 << "\n"; +} +#endif