qtah-cpp-qt5 0.5.1 → 0.6.0
raw patch · 27 files changed
+361/−35 lines, 27 filesdep ~qtah-generatorsetup-changed
Dependency ranges changed: qtah-generator
Files
- Setup.hs +13/−12
- cpp/encode.cpp +1/−1
- cpp/encode.hpp +1/−1
- cpp/event.hpp +1/−1
- cpp/qtah.pro +2/−2
- cpp/qtahopenglwindow.hpp +1/−1
- cpp/qtahrasterwindow.hpp +1/−1
- cpp/wrap_qapplication.cpp +1/−1
- cpp/wrap_qapplication.hpp +1/−1
- cpp/wrap_qcoreapplication.cpp +29/−1
- cpp/wrap_qcoreapplication.hpp +8/−1
- cpp/wrap_qformlayout.cpp +1/−1
- cpp/wrap_qformlayout.hpp +1/−1
- cpp/wrap_qgridlayout.cpp +1/−1
- cpp/wrap_qgridlayout.hpp +1/−1
- cpp/wrap_qimage.cpp +1/−1
- cpp/wrap_qimage.hpp +1/−1
- cpp/wrap_qmetaclassinfo.cpp +32/−0
- cpp/wrap_qmetaclassinfo.hpp +34/−0
- cpp/wrap_qmetaobject.cpp +60/−0
- cpp/wrap_qmetaobject.hpp +50/−0
- cpp/wrap_qobject.cpp +61/−0
- cpp/wrap_qobject.hpp +47/−0
- cpp/wrap_qstring.cpp +1/−1
- cpp/wrap_qstring.hpp +1/−1
- qtah-cpp-qt5.cabal +9/−3
- src/Graphics/UI/Qtah/NothingToSeeHere.hs +1/−1
Setup.hs view
@@ -1,6 +1,6 @@ -- This file is part of Qtah. ----- Copyright 2015-2018 The Qtah Authors.+-- Copyright 2015-2019 The Qtah Authors. -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Lesser General Public License as published by@@ -160,8 +160,8 @@ generatorConfiguredProgram <- maybe (dieFn $ packageName ++ ": Couldn't find qtah-generator. Is it installed?") return $ lookupProgram generatorProgram programDb- output <- fmap lines $- getProgramOutput verbosity generatorConfiguredProgram ["--qmake-executable"]+ output <-+ lines <$> getProgramOutput verbosity generatorConfiguredProgram ["--qmake-executable"] case output of executable:args -> return (executable, args) [] -> fail $ packageName ++@@ -321,10 +321,12 @@ #endif qt4Flag = fromMaybe False $ lookupFlag (mkFlagName "qt4") flags qt5Flag = fromMaybe False $ lookupFlag (mkFlagName "qt5") flags- qtFlag = if qt4Flag then Just 4 else if qt5Flag then Just 5 else Nothing+ qtFlag | qt4Flag = Just 4+ | qt5Flag = Just 5+ | otherwise = Nothing when (qt4Flag && qt5Flag) $- dieFn $ concat- [packageName, ": The qt4 and qt5 flags are mutually exclusive. Please select at most one."]+ dieFn $+ packageName ++ ": The qt4 and qt5 flags are mutually exclusive. Please select at most one." -- Inspect the QTAH_QT environment variable. qtahQtStr <- lookupEnv "QTAH_QT"@@ -341,11 +343,10 @@ -- generator to pick up. case (qtahQtMajor, qtFlag) of -- If both QTAH_QT and one of the qtX flags above is set, then they must agree.- (Just m, Just n) -> do- when (m /= n) $- dieFn $ concat- [packageName, ": QTAH_QT=", show $ fromMaybe "" qtahQtStr, " and the qt",- show n, " flag conflict."]+ (Just m, Just n) | m /= n ->+ dieFn $ concat+ [packageName, ": QTAH_QT=", show $ fromMaybe "" qtahQtStr, " and the qt",+ show n, " flag conflict."] -- Otherwise, if QTAH_QT is not already set but we have a flag preference, -- then use QTAH_QT to tell qtah-generator about the flag. (Nothing, Just n) -> setEnv "QTAH_QT" $ show n@@ -360,7 +361,7 @@ (_, Just n) -> notice verbosity $ concat [packageName, ": Requesting Qt ", show n, " because of the qt", show n, " flag."]- _ -> notice verbosity $ concat [packageName, ": Requesting system default Qt."]+ _ -> notice verbosity $ packageName ++ ": Requesting system default Qt." return $ qtahQtMajor <|> qtFlag
cpp/encode.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/encode.hpp view
@@ -3,7 +3,7 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/event.hpp view
@@ -3,7 +3,7 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/qtah.pro view
@@ -1,6 +1,6 @@ # This file is part of Qtah. #-# Copyright 2015-2018 The Qtah Authors.+# Copyright 2015-2019 The Qtah Authors. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by@@ -21,7 +21,7 @@ TARGET = qtah TEMPLATE = lib-VERSION = 0.5.0+VERSION = 0.6.0 # Doesn't seem to work here: CONFIG += c++11 QMAKE_CXXFLAGS += -std=c++11
cpp/qtahopenglwindow.hpp view
@@ -3,7 +3,7 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/qtahrasterwindow.hpp view
@@ -3,7 +3,7 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qapplication.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qapplication.hpp view
@@ -3,7 +3,7 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qcoreapplication.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by@@ -33,6 +33,34 @@ } return new QCoreApplication(*argc, argv);+}++QString translate(const QString& context, const QString& sourceText) {+ return QCoreApplication::translate(+ context.toStdString().c_str(),+ sourceText.toStdString().c_str());+}++QString translate(+ const QString& context,+ const QString& sourceText,+ const QString& disambiguation) {+ return QCoreApplication::translate(+ context.toStdString().c_str(),+ sourceText.toStdString().c_str(),+ disambiguation.toStdString().c_str());+}++QString translate(+ const QString& context,+ const QString& sourceText,+ const QString& disambiguation,+ int n) {+ return QCoreApplication::translate(+ context.toStdString().c_str(),+ sourceText.toStdString().c_str(),+ disambiguation.toStdString().c_str(),+ n); } } // namespace qcoreapplication
cpp/wrap_qcoreapplication.hpp view
@@ -3,7 +3,7 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by@@ -19,12 +19,19 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. #include <QCoreApplication>+#include <QString> #include <QStringList> namespace qtah { namespace qcoreapplication { QCoreApplication* create(const QStringList&);++QString translate(const QString&, const QString&);++QString translate(const QString&, const QString&, const QString&);++QString translate(const QString&, const QString&, const QString&, int); } // namespace qcoreapplication } // namespace qtah
cpp/wrap_qformlayout.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qformlayout.hpp view
@@ -3,7 +3,7 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qgridlayout.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qgridlayout.hpp view
@@ -3,7 +3,7 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qimage.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qimage.hpp view
@@ -3,7 +3,7 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
+ cpp/wrap_qmetaclassinfo.cpp view
@@ -0,0 +1,32 @@+// This file is part of Qtah.+//+// Copyright 2015-2019 The Qtah Authors.+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Lesser General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Lesser General Public License for more details.+//+// You should have received a copy of the GNU Lesser General Public License+// along with this program. If not, see <http://www.gnu.org/licenses/>.++#include "wrap_qmetaclassinfo.hpp"++namespace qtah {+namespace qmetaclassinfo {++QString name(const QMetaClassInfo& self) {+ return self.name();+}++QString value(const QMetaClassInfo& self) {+ return self.value();+}++} // namespace qmetaclassinfo+} // namespace qtah
+ cpp/wrap_qmetaclassinfo.hpp view
@@ -0,0 +1,34 @@+#ifndef QTAH_WRAP_QMETACLASSINFO_HPP+#define QTAH_WRAP_QMETACLASSINFO_HPP++// This file is part of Qtah.+//+// Copyright 2015-2019 The Qtah Authors.+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Lesser General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Lesser General Public License for more details.+//+// You should have received a copy of the GNU Lesser General Public License+// along with this program. If not, see <http://www.gnu.org/licenses/>.++#include <QMetaClassInfo>+#include <QString>++namespace qtah {+namespace qmetaclassinfo {++QString name(const QMetaClassInfo& self);++QString value(const QMetaClassInfo& self);++} // namespace qmetaclassinfo+} // namespace qtah++#endif // QTAH_WRAP_QMETACLASSINFO_HPP
+ cpp/wrap_qmetaobject.cpp view
@@ -0,0 +1,60 @@+// This file is part of Qtah.+//+// Copyright 2015-2019 The Qtah Authors.+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Lesser General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Lesser General Public License for more details.+//+// You should have received a copy of the GNU Lesser General Public License+// along with this program. If not, see <http://www.gnu.org/licenses/>.++#include "wrap_qmetaobject.hpp"++namespace qtah {+namespace qmetaobject {++int indexOfClassInfo(const QMetaObject& self, const QString& name) {+ return self.indexOfClassInfo(name.toStdString().c_str());+}++int indexOfConstructor(const QMetaObject& self, const QString& name) {+ return self.indexOfConstructor(name.toStdString().c_str());+}++int indexOfEnumerator(const QMetaObject& self, const QString& name) {+ return self.indexOfEnumerator(name.toStdString().c_str());+}++int indexOfMethod(const QMetaObject& self, const QString& name) {+ return self.indexOfMethod(name.toStdString().c_str());+}++int indexOfProperty(const QMetaObject& self, const QString& name) {+ return self.indexOfProperty(name.toStdString().c_str());+}++int indexOfSignal(const QMetaObject& self, const QString& name) {+ return self.indexOfSignal(name.toStdString().c_str());+}++int indexOfSlot(const QMetaObject& self, const QString& name) {+ return self.indexOfSlot(name.toStdString().c_str());+}++namespace connection {++bool isValid(const QMetaObject::Connection& self) {+ return static_cast<bool>(self);+}++} // namespace connection++} // namespace qmetaobject+} // namespace qtah
+ cpp/wrap_qmetaobject.hpp view
@@ -0,0 +1,50 @@+#ifndef QTAH_WRAP_QMETAOBJECT_HPP+#define QTAH_WRAP_QMETAOBJECT_HPP++// This file is part of Qtah.+//+// Copyright 2015-2019 The Qtah Authors.+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Lesser General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Lesser General Public License for more details.+//+// You should have received a copy of the GNU Lesser General Public License+// along with this program. If not, see <http://www.gnu.org/licenses/>.++#include <QMetaObject>+#include <QString>++namespace qtah {+namespace qmetaobject {++int indexOfClassInfo(const QMetaObject& self, const QString& name);++int indexOfConstructor(const QMetaObject& self, const QString& name);++int indexOfEnumerator(const QMetaObject& self, const QString& name);++int indexOfMethod(const QMetaObject& self, const QString& name);++int indexOfProperty(const QMetaObject& self, const QString& name);++int indexOfSignal(const QMetaObject& self, const QString& name);++int indexOfSlot(const QMetaObject& self, const QString& name);++namespace connection {++bool isValid(const QMetaObject::Connection& self);++} // namespace connection++} // namespace qmetaobject+} // namespace qtah++#endif // QTAH_WRAP_QMETAOBJECT_HPP
+ cpp/wrap_qobject.cpp view
@@ -0,0 +1,61 @@+// This file is part of Qtah.+//+// Copyright 2015-2019 The Qtah Authors.+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Lesser General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Lesser General Public License for more details.+//+// You should have received a copy of the GNU Lesser General Public License+// along with this program. If not, see <http://www.gnu.org/licenses/>.++#include "wrap_qobject.hpp"++namespace qtah {+namespace qobject {++bool inherits(const QObject& obj, const QString& className) {+ return obj.inherits(className.toStdString().c_str());+}++QVariant property(const QObject& obj, const QString& propertyName) {+ return obj.property(propertyName.toStdString().c_str());+}++void setProperty(QObject& obj, const QString& propertyName, const QVariant& value) {+ obj.setProperty(propertyName.toStdString().c_str(), value);+}++QMetaObject::Connection connect(const QObject* obj1, std::string signalName, const QObject* obj2, std::string slotName)+{+ std::string buf("2");+ const char* signal = buf.append(signalName).c_str();++ std::string buf2("1");+ const char* slot = buf2.append(slotName).c_str();++ return QObject::connect(obj1, signal, obj2, slot);+}++bool disconnect(const QObject* obj1, std::string signalName, const QObject* obj2, std::string slotName)+{+ std::string buf("2");+ const char* signal = buf.append(signalName).c_str();++ std::string buf2("1");+ const char* slot = buf2.append(slotName).c_str();++ bool disconnected = QObject::disconnect(obj1, signal, obj2, slot);+ return disconnected;+}++++} // namespace qobject+} // namespace qtah
+ cpp/wrap_qobject.hpp view
@@ -0,0 +1,47 @@+#ifndef QTAH_WRAP_QOBJECT_HPP+#define QTAH_WRAP_QOBJECT_HPP++// This file is part of Qtah.+//+// Copyright 2015-2019 The Qtah Authors.+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Lesser General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU Lesser General Public License for more details.+//+// You should have received a copy of the GNU Lesser General Public License+// along with this program. If not, see <http://www.gnu.org/licenses/>.++#include <string>++#include <Qt>+#include <QtGlobal>+#include <QObject>+#include <QString>+#include <QMetaObject>+#include <QVariant>++namespace qtah {+namespace qobject {++bool inherits(const QObject& obj, const QString& className);++QVariant property(const QObject& obj, const QString& propertyName);++void setProperty(QObject& obj, const QString& propertyName, const QVariant& value);++QMetaObject::Connection connect(const QObject* obj1, std::string signalName, const QObject* obj2, std::string slotName);++bool disconnect(const QObject* obj1, std::string signalName, const QObject* obj2, std::string slotName);+++} // namespace qobject+} // namespace qtah++#endif // QTAH_WRAP_QOBJECT_HPP
cpp/wrap_qstring.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qstring.hpp view
@@ -3,7 +3,7 @@ // This file is part of Qtah. //-// Copyright 2015-2018 The Qtah Authors.+// Copyright 2015-2019 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
qtah-cpp-qt5.cabal view
@@ -1,12 +1,12 @@ name: qtah-cpp-qt5-version: 0.5.1+version: 0.6.0 synopsis: Qt bindings for Haskell - C++ library homepage: http://khumba.net/projects/qtah license: LGPL-3 license-files: LICENSE.GPL, LICENSE.LGPL author: Bryan Gardiner <bog@khumba.net> maintainer: Bryan Gardiner <bog@khumba.net>-copyright: Copyright 2015-2018 The Qtah Authors.+copyright: Copyright 2015-2019 The Qtah Authors. category: Graphics build-type: Custom -- Cabal 1.20 is needed for BuildFlags.buildNumJobs.@@ -32,6 +32,12 @@ cpp/wrap_qgridlayout.hpp cpp/wrap_qimage.cpp cpp/wrap_qimage.hpp+ cpp/wrap_qmetaclassinfo.cpp+ cpp/wrap_qmetaclassinfo.hpp+ cpp/wrap_qmetaobject.cpp+ cpp/wrap_qmetaobject.hpp+ cpp/wrap_qobject.cpp+ cpp/wrap_qobject.hpp cpp/wrap_qstring.cpp cpp/wrap_qstring.hpp @@ -42,7 +48,7 @@ build-depends: base >=4 && <5 , process >=1.2 && <1.7- , qtah-generator >=0.5 && <0.6+ , qtah-generator >=0.6 && <0.7 ghc-options: -W -fwarn-incomplete-patterns -fwarn-unused-do-bind custom-setup
src/Graphics/UI/Qtah/NothingToSeeHere.hs view
@@ -1,6 +1,6 @@ -- This file is part of Qtah. ----- Copyright 2015-2018 The Qtah Authors.+-- Copyright 2015-2019 The Qtah Authors. -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Lesser General Public License as published by