Unverified Commit 5270a030 authored by Bryan Gardiner's avatar Bryan Gardiner

Merge bug fixes and additional classes from @cblp (MR !12).

!12
parents 68053473 39ee4a96
......@@ -60,6 +60,7 @@ executable qtah-generator
, Graphics.UI.Qtah.Generator.Interface.Core.QChar
, Graphics.UI.Qtah.Generator.Interface.Core.QChildEvent
, Graphics.UI.Qtah.Generator.Interface.Core.QCoreApplication
, Graphics.UI.Qtah.Generator.Interface.Core.QDate
, Graphics.UI.Qtah.Generator.Interface.Core.QDir
, Graphics.UI.Qtah.Generator.Interface.Core.QEvent
, Graphics.UI.Qtah.Generator.Interface.Core.QItemSelection
......@@ -75,6 +76,7 @@ executable qtah-generator
, Graphics.UI.Qtah.Generator.Interface.Core.QPointF
, Graphics.UI.Qtah.Generator.Interface.Core.QRect
, Graphics.UI.Qtah.Generator.Interface.Core.QRectF
, Graphics.UI.Qtah.Generator.Interface.Core.QSettings
, Graphics.UI.Qtah.Generator.Interface.Core.QSize
, Graphics.UI.Qtah.Generator.Interface.Core.QSizeF
, Graphics.UI.Qtah.Generator.Interface.Core.QString
......@@ -135,6 +137,7 @@ executable qtah-generator
, Graphics.UI.Qtah.Generator.Interface.Widgets
, Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractButton
, Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractGraphicsShapeItem
, Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractItemDelegate
, Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractItemView
, Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractScrollArea
, Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractSlider
......@@ -145,6 +148,8 @@ executable qtah-generator
, Graphics.UI.Qtah.Generator.Interface.Widgets.QBoxLayout
, Graphics.UI.Qtah.Generator.Interface.Widgets.QButtonGroup
, Graphics.UI.Qtah.Generator.Interface.Widgets.QCheckBox
, Graphics.UI.Qtah.Generator.Interface.Widgets.QDateEdit
, Graphics.UI.Qtah.Generator.Interface.Widgets.QDateTimeEdit
, Graphics.UI.Qtah.Generator.Interface.Widgets.QDial
, Graphics.UI.Qtah.Generator.Interface.Widgets.QDialog
, Graphics.UI.Qtah.Generator.Interface.Widgets.QDialogButtonBox
......@@ -189,10 +194,12 @@ executable qtah-generator
, Graphics.UI.Qtah.Generator.Interface.Widgets.QStackedLayout
, Graphics.UI.Qtah.Generator.Interface.Widgets.QStackedWidget
, Graphics.UI.Qtah.Generator.Interface.Widgets.QStatusBar
, Graphics.UI.Qtah.Generator.Interface.Widgets.QStyledItemDelegate
, Graphics.UI.Qtah.Generator.Interface.Widgets.QSystemTrayIcon
, Graphics.UI.Qtah.Generator.Interface.Widgets.QTabWidget
, Graphics.UI.Qtah.Generator.Interface.Widgets.QTextEdit
, Graphics.UI.Qtah.Generator.Interface.Widgets.QToolBar
, Graphics.UI.Qtah.Generator.Interface.Widgets.QToolBox
, Graphics.UI.Qtah.Generator.Interface.Widgets.QTreeView
, Graphics.UI.Qtah.Generator.Interface.Widgets.QTreeWidget
, Graphics.UI.Qtah.Generator.Interface.Widgets.QVBoxLayout
......
......@@ -93,6 +93,7 @@ forEachListener() {
$fn PtrQWidgetPtrQWidget "QWidget*|QWidget*"
$fn QAbstractSliderAction "QAbstractSlider::SliderAction"
$fn QClipboardMode "QClipboard::Mode"
$fn QDate "QDate"
$fn QModelIndex "QModelIndex"
$fn QModelIndexIntInt "QModelIndex|int|int"
$fn QModelIndexIntIntQModelIndexInt "QModelIndex|int|int|QModelIndex|int"
......
......@@ -24,6 +24,7 @@ import qualified Graphics.UI.Qtah.Generator.Interface.Core.QByteArray as QByteAr
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QChar as QChar
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QChildEvent as QChildEvent
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QCoreApplication as QCoreApplication
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QDate as QDate
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QDir as QDir
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QEvent as QEvent
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QItemSelection as QItemSelection
......@@ -39,6 +40,7 @@ import qualified Graphics.UI.Qtah.Generator.Interface.Core.QPoint as QPoint
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QPointF as QPointF
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QRect as QRect
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QRectF as QRectF
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QSettings as QSettings
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QSize as QSize
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QSizeF as QSizeF
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QString as QString
......@@ -64,6 +66,7 @@ modules =
, QChar.aModule
, QChildEvent.aModule
, QCoreApplication.aModule
, QDate.aModule
, QDir.aModule
, QEvent.aModule
, QItemSelection.aModule
......@@ -78,6 +81,7 @@ modules =
, QPointF.aModule
, QRect.aModule
, QRectF.aModule
, QSettings.aModule
, QSize.aModule
, QSizeF.aModule
, QString.aModule
......
......@@ -40,6 +40,7 @@ import Foreign.Hoppy.Generator.Version (collect, just, test)
import Graphics.UI.Qtah.Generator.Flags (qtVersion)
import Graphics.UI.Qtah.Generator.Interface.Core.QEvent (c_QEvent)
import Graphics.UI.Qtah.Generator.Interface.Core.QObject (c_QObject)
import Graphics.UI.Qtah.Generator.Interface.Core.QString (c_QString)
import Graphics.UI.Qtah.Generator.Interface.Core.QStringList (c_QStringList)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
......@@ -60,15 +61,25 @@ c_QCoreApplication =
collect
[ just $ makeFnMethod (ident2 "qtah" "qcoreapplication" "create") "new" MStatic Nonpure
[objT c_QStringList] $ ptrT $ objT c_QCoreApplication
, just $ mkStaticMethod "applicationName" [] $ objT c_QString
, just $ mkStaticMethod "applicationVersion" [] $ objT c_QString
, test (qtVersion >= [4, 1]) $ mkStaticMethod "arguments" [] $ objT c_QStringList
, just $ mkStaticMethod "exec" [] voidT
, just $ mkStaticMethod "exit" [intT] voidT
, just $ mkStaticMethod' "instance" "getInstance" [] $ ptrT $ objT c_QCoreApplication
, test (qtVersion >= [5, 0]) $ mkStaticMethod "isQuitLockEnabled" [] boolT
, just $ mkStaticMethod "organizationDomain" [] $ objT c_QString
, just $ mkStaticMethod "organizationName" [] $ objT c_QString
, test (qtVersion >= [4, 3]) $ mkStaticMethod' "postEvent" "postEvent"
[ptrT $ objT c_QObject, ptrT $ objT c_QEvent] voidT
, test (qtVersion >= [4, 3]) $ mkStaticMethod' "postEvent" "postEventWithPriority"
[ptrT $ objT c_QObject, ptrT $ objT c_QEvent, intT] voidT
, just $ mkStaticMethod "quit" [] voidT
, just $ mkStaticMethod "sendEvent" [ptrT $ objT c_QObject, ptrT $ objT c_QEvent] boolT
, just $ mkStaticMethod "setApplicationName" [objT c_QString] voidT
, just $ mkStaticMethod "setApplicationVersion" [objT c_QString] voidT
, just $ mkStaticMethod "setOrganizationDomain" [objT c_QString] voidT
, just $ mkStaticMethod "setOrganizationName" [objT c_QString] voidT
, test (qtVersion >= [5, 0]) $ mkStaticMethod "setQuitLockEnabled" [boolT] voidT
-- TODO Other methods.
]
-- This file is part of Qtah.
--
-- Copyright 2018 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/>.
module Graphics.UI.Qtah.Generator.Interface.Core.QDate (
aModule,
c_QDate,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass),
addReqIncludes,
classSetConversionToGc,
classSetEntityPrefix,
ident,
includeStd,
makeClass,
mkConstMethod,
mkConstMethod',
mkCtor,
mkMethod,
mkStaticMethod,
mkStaticMethod',
)
import Foreign.Hoppy.Generator.Spec.ClassFeature (
ClassFeature (Assignable, Copyable, Equatable),
classAddFeatures,
)
import Foreign.Hoppy.Generator.Types (
boolT, intT, int64T, objT,
)
import Foreign.Hoppy.Generator.Version (collect, just, test)
import Graphics.UI.Qtah.Generator.Flags (qtVersion)
import Graphics.UI.Qtah.Generator.Interface.Core.QString (c_QString)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
aModule =
AQtModule $
makeQtModule ["Core", "QDate"]
[ QtExport $ ExportClass c_QDate
]
c_QDate =
addReqIncludes [includeStd "QDate"] $
classSetConversionToGc $
classAddFeatures [Assignable, Copyable, Equatable] $
classSetEntityPrefix "" $
makeClass (ident "QDate") Nothing [] $
collect
[
-- Public Functions
just $ mkCtor "new" []
, just $ mkCtor "newWithYmd" [intT, intT, intT]
, just $ mkConstMethod "addDays" [int64T] (objT c_QDate)
, just $ mkConstMethod "addMonths" [intT] (objT c_QDate)
, just $ mkConstMethod "addYears" [intT] (objT c_QDate)
, just $ mkConstMethod "day" [] intT
, just $ mkConstMethod "dayOfWeek" [] intT
, just $ mkConstMethod "dayOfYear" [] intT
, just $ mkConstMethod "daysInMonth" [] intT
, just $ mkConstMethod "daysInYear" [] intT
, just $ mkConstMethod "daysTo" [objT c_QDate] int64T
-- TODO test (qtVersion >= [4, 5]) $ mkConstMethod "getDate"
-- (intT *year, intT *month, intT *day) voidT
, just $ mkConstMethod "isNull" [] boolT
, just $ mkConstMethod "isValid" [] boolT
, just $ mkConstMethod "month" [] intT
, test (qtVersion >= [4, 2]) $ mkMethod "setDate" [intT, intT, intT] boolT
, just $ mkConstMethod "toJulianDay" [] int64T
, just $ mkConstMethod'
"toString" "toStringWithStringFormat" [objT c_QString] (objT c_QString)
, just $ mkConstMethod "toString" [] (objT c_QString)
-- TODO just $ mkConstMethod' "toString" "toStringWithDateFormat"
-- [DateFormat] (objT c_QString)
-- TODO just $ mkConstMethod' "toString" "toStringWithStringViewFormat"
-- [objT c_QStringView] (objT c_QString)
, just $ mkConstMethod "weekNumber" [] intT
-- TODO just $ mkConstMethod' "weekNumber" "weekNumberWithYearNumber"
-- (intT *yearNumber = Q_NULLPTR) intT
, just $ mkConstMethod "year" [] intT
-- Static Public Members
, just $ mkStaticMethod "currentDate" [] (objT c_QDate)
, just $ mkStaticMethod "fromJulianDay" [int64T] (objT c_QDate)
, just $ mkStaticMethod "fromString" [objT c_QString] (objT c_QDate)
-- TODO just $ mkStaticMethod' "fromString" "fromStringWithDateFormat"
-- [objT c_QString, Qt::DateFormat] (objT c_QDate)
, just $ mkStaticMethod' "fromString" "fromStringWithStringFormat"
[objT c_QString, objT c_QString] (objT c_QDate)
, just $ mkStaticMethod "isLeapYear" [intT] boolT
, just $ mkStaticMethod' "isValid" "isValidYmd" [intT, intT, intT] boolT
]
-- This file is part of Qtah.
--
-- Copyright 2018 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/>.
module Graphics.UI.Qtah.Generator.Interface.Core.QSettings (
aModule,
) where
import Foreign.Hoppy.Generator.Spec (
Class,
Export (ExportClass),
addReqIncludes,
classSetEntityPrefix,
ident,
includeStd,
makeClass,
mkConstMethod,
mkConstMethod',
mkCtor,
mkMethod,
)
import Foreign.Hoppy.Generator.Types (objT, ptrT, voidT)
import Graphics.UI.Qtah.Generator.Interface.Core.QObject (c_QObject)
import Graphics.UI.Qtah.Generator.Interface.Core.QString (c_QString)
import Graphics.UI.Qtah.Generator.Interface.Core.QVariant (c_QVariant)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
aModule :: AModule
aModule =
AQtModule $
makeQtModule ["Core", "QSettings"]
[QtExport $ ExportClass c_QSettings]
c_QSettings :: Class
c_QSettings =
addReqIncludes [includeStd "QSettings"] $
classSetEntityPrefix "" $
makeClass (ident "QSettings") Nothing [c_QObject]
[ mkCtor "new" []
, mkCtor "newWithOrganization" [objT c_QString]
, mkCtor "newWithOrganizationAndApplication" [objT c_QString, objT c_QString]
, mkCtor "newWithOrganizationAndApplicationAndParent"
[objT c_QString, objT c_QString, ptrT $ objT c_QObject]
, mkCtor "newWithParent" [ptrT $ objT c_QObject]
-- TODO QSettings(Scope scope, const QString &organization,
-- const QString &application = QString(), QObject *parent = Q_NULLPTR)
-- TODO QSettings(Format format, Scope scope, const QString &organization,
-- const QString &application = QString(), QObject *parent = Q_NULLPTR)
-- TODO QSettings(const QString &fileName, Format format, QObject *parent = Q_NULLPTR)
, mkMethod "setValue" [objT c_QString, objT c_QVariant] voidT
, mkConstMethod "value" [objT c_QString] (objT c_QVariant)
, mkConstMethod' "value" "valueWithDefault" [objT c_QString, objT c_QVariant] (objT c_QVariant)
-- TODO Other methods.
]
......@@ -54,6 +54,7 @@ import Foreign.Hoppy.Generator.Types (
)
import Foreign.Hoppy.Generator.Version (collect, just, test)
import Graphics.UI.Qtah.Generator.Flags (qtVersion)
import Graphics.UI.Qtah.Generator.Interface.Core.QByteArray (c_QByteArray)
import Graphics.UI.Qtah.Generator.Interface.Core.QChar (c_QChar)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Core.QList (c_QListQVariant)
import Graphics.UI.Qtah.Generator.Interface.Core.QPoint (c_QPoint)
......@@ -91,6 +92,7 @@ c_QVariant =
collect
[ just $ mkCtor "new" []
, just $ mkCtor "newWithBool" [boolT]
, just $ mkCtor "newWithByteArray" [objT c_QByteArray]
, just $ mkCtor "newWithChar" [objT c_QChar]
, just $ mkCtor "newWithDouble" [doubleT]
, test (qtVersion >= [4, 6]) $ mkCtor "newWithFloat" [floatT]
......@@ -135,6 +137,7 @@ c_QVariant =
, just $ mkMethod' "setValue" "setToULongLong" [ullongT] voidT
, test (qtVersion >= [4, 8]) $ mkMethod' "setValue" "swap" [refT $ objT c_QVariant] voidT
, just $ mkConstMethod "toBool" [] boolT
, just $ mkConstMethod "toByteArray" [] (objT c_QByteArray)
, just $ mkConstMethod "toChar" [] $ objT c_QChar
, just $ mkConstMethod "toDouble" [] doubleT
, test (qtVersion >= [4, 6]) $ mkConstMethod "toFloat" [] floatT
......
......@@ -47,6 +47,8 @@ module Graphics.UI.Qtah.Generator.Interface.Core.Types (
bs_KeyboardModifiers,
e_LayoutDirection,
e_MaskMode,
e_MatchFlag,
bs_MatchFlags,
e_MouseButton,
bs_MouseButtons,
e_MouseEventFlag,
......@@ -134,6 +136,8 @@ exports =
, just $ ExportBitspace bs_KeyboardModifiers
, just $ ExportEnum e_LayoutDirection
, just $ ExportEnum e_MaskMode
, just $ ExportEnum e_MatchFlag
, just $ ExportBitspace bs_MatchFlags
, just $ ExportEnum e_MouseButton
, just $ ExportBitspace bs_MouseButtons
, test (qtVersion >= e_MouseEventFlag_minVersion) $ ExportEnum e_MouseEventFlag
......@@ -571,6 +575,20 @@ e_MaskMode =
, (1, ["mask", "out", "color"])
]
(e_MatchFlag, bs_MatchFlags) =
makeQtEnumBitspace (ident1 "Qt" "MatchFlag") "MatchFlags" qtInclude
[ ( 0, ["match", "exactly"])
, ( 8, ["match", "fixed", "string"])
, ( 1, ["match", "contains"])
, ( 2, ["match", "starts", "with"])
, ( 3, ["match", "ends", "with"])
, (16, ["match", "case", "sensitive"])
, ( 4, ["match", "reg", "exp"])
, ( 5, ["match", "wildcard"])
, (32, ["match", "wrap"])
, (64, ["match", "recursive"])
]
(e_MouseButton, bs_MouseButtons) =
makeQtEnumBitspace (ident1 "Qt" "MouseButton") "MouseButtons" qtInclude
[ (0x00000000, ["no", "button"])
......
......@@ -29,13 +29,14 @@ import Foreign.Hoppy.Generator.Spec (
includeStd,
makeClass,
mkCtor,
mkConstMethod,
mkMethod,
)
import Foreign.Hoppy.Generator.Spec.ClassFeature (
ClassFeature (Assignable, Copyable, Equatable),
classAddFeatures,
)
import Foreign.Hoppy.Generator.Types (intT, voidT)
import Foreign.Hoppy.Generator.Types (boolT, intT, voidT)
import Foreign.Hoppy.Generator.Version (collect, just)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
......@@ -56,8 +57,12 @@ c_QFont =
makeClass (ident "QFont") Nothing [] $
collect
[ just $ mkCtor "new" []
, just $ mkConstMethod "bold" [] boolT
, just $ mkMethod "setBold" [boolT] voidT
, just $ mkMethod "setPixelSize" [intT] voidT
, just $ mkMethod "setPointSize" [intT] voidT
, just $ mkMethod "setWeight" [intT] voidT
, just $ mkConstMethod "weight" [] intT
]
-- TODO The rest of QFont.
......@@ -134,7 +134,7 @@ c_QWindow =
, just $ mkMethod "raise" [] voidT
, just $ mkMethod "reportContentOrientationChange" [enumT e_ScreenOrientation] voidT
, just $ mkMethod "requestActivate" [] voidT
, test (qtVersion >= [5, 1]) $ mkMethod "requestUpdate" [] voidT
, test (qtVersion >= [5, 5]) $ mkMethod "requestUpdate" [] voidT
-- TODO mkConstMethod "requestedFormat" [] $ objT c_QSurfaceFormat
, just $ mkMethod' "resize" "resize" [objT c_QSize] voidT
, just $ mkMethod' "resize" "resizeRaw" [intT, intT] voidT
......
......@@ -43,6 +43,7 @@ import Foreign.Hoppy.Generator.Types (
import Foreign.Hoppy.Generator.Version (collect, just, test)
import Graphics.UI.Qtah.Generator.Flags (qtVersion)
import Graphics.UI.Qtah.Generator.Interface.Core.QAbstractItemModel (c_QAbstractItemModel)
import Graphics.UI.Qtah.Generator.Interface.Core.QDate (c_QDate)
import Graphics.UI.Qtah.Generator.Interface.Core.QEvent (c_QEvent)
import Graphics.UI.Qtah.Generator.Interface.Core.QItemSelection (c_QItemSelection)
import Graphics.UI.Qtah.Generator.Interface.Core.QModelIndex (c_QModelIndex)
......@@ -104,6 +105,7 @@ aModule =
, just $ ExportCallback cb_PtrQWidgetPtrQWidgetVoid
, just $ ExportCallback cb_QAbstractSliderActionVoid
, just $ ExportCallback cb_QClipboardModeVoid
, just $ ExportCallback cb_QDateVoid
, just $ ExportCallback cb_QModelIndexVoid
, just $ ExportCallback cb_QModelIndexIntIntVoid
, just $ ExportCallback cb_QModelIndexIntIntQModelIndexIntVoid
......@@ -208,6 +210,10 @@ cb_QClipboardModeVoid =
makeCallback (toExtName "CallbackQClipboardModeVoid")
[enumT QClipboard.e_Mode] voidT
cb_QDateVoid =
makeCallback (toExtName "CallbackQDateVoid")
[objT c_QDate] voidT
cb_QModelIndexVoid =
makeCallback (toExtName "CallbackQModelIndexVoid")
[objT c_QModelIndex] voidT
......
......@@ -19,6 +19,7 @@ module Graphics.UI.Qtah.Generator.Interface.Widgets (modules) where
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractButton as QAbstractButton
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractGraphicsShapeItem as QAbstractGraphicsShapeItem
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractItemDelegate as QAbstractItemDelegate
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractItemView as QAbstractItemView
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractScrollArea as QAbstractScrollArea
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractSlider as QAbstractSlider
......@@ -29,6 +30,8 @@ import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QApplication as QA
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QBoxLayout as QBoxLayout
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QButtonGroup as QButtonGroup
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QCheckBox as QCheckBox
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QDateEdit as QDateEdit
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QDateTimeEdit as QDateTimeEdit
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QDial as QDial
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QDialog as QDialog
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QDialogButtonBox as QDialogButtonBox
......@@ -73,10 +76,12 @@ import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QSplitter as QSpli
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QStackedLayout as QStackedLayout
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QStackedWidget as QStackedWidget
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QStatusBar as QStatusBar
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QStyledItemDelegate as QStyledItemDelegate
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QSystemTrayIcon as QSystemTrayIcon
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QTabWidget as QTabWidget
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QTextEdit as QTextEdit
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QToolBar as QToolBar
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QToolBox as QToolBox
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QTreeView as QTreeView
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QTreeWidget as QTreeWidget
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QVBoxLayout as QVBoxLayout
......@@ -89,6 +94,7 @@ modules :: [AModule]
modules =
[ QAbstractButton.aModule
, QAbstractGraphicsShapeItem.aModule
, QAbstractItemDelegate.aModule
, QAbstractItemView.aModule
, QAbstractScrollArea.aModule
, QAbstractSlider.aModule
......@@ -99,6 +105,8 @@ modules =
, QBoxLayout.aModule
, QButtonGroup.aModule
, QCheckBox.aModule
, QDateEdit.aModule
, QDateTimeEdit.aModule
, QDial.aModule
, QDialog.aModule
, QDialogButtonBox.aModule
......@@ -143,10 +151,12 @@ modules =
, QStackedLayout.aModule
, QStackedWidget.aModule
, QStatusBar.aModule
, QStyledItemDelegate.aModule
, QSystemTrayIcon.aModule
, QTabWidget.aModule
, QTextEdit.aModule
, QToolBar.aModule
, QToolBox.aModule
, QTreeView.aModule
, QTreeWidget.aModule
, QTreeWidget.itemModule
......
-- This file is part of Qtah.
--
-- Copyright 2018 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/>.
module Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractItemDelegate (
aModule,
c_QAbstractItemDelegate,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass),
addReqIncludes,
classSetEntityPrefix,
ident,
includeStd,
makeClass,
)
import Graphics.UI.Qtah.Generator.Interface.Core.QObject (c_QObject)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
aModule =
AQtModule $
makeQtModule ["Widgets", "QAbstractItemDelegate"] $
QtExport (ExportClass c_QAbstractItemDelegate) :
map QtExportSignal signals
c_QAbstractItemDelegate =
addReqIncludes [includeStd "QAbstractItemDelegate"] $
classSetEntityPrefix "" $
makeClass (ident "QAbstractItemDelegate") Nothing [c_QObject] $
[ -- TODO Methods.
]
signals =
[ -- TODO Signals.
]
......@@ -30,6 +30,7 @@ import Foreign.Hoppy.Generator.Spec (
makeClass,
mkBoolHasProp,
mkConstMethod,
mkConstMethod',
mkMethod,
mkMethod',
mkProp,
......@@ -59,6 +60,7 @@ import Graphics.UI.Qtah.Generator.Interface.Internal.Listener (
c_ListenerQModelIndex,
c_ListenerQSize,
)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractItemDelegate (c_QAbstractItemDelegate)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractScrollArea (c_QAbstractScrollArea)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QWidget (c_QWidget)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
......@@ -100,11 +102,14 @@ c_QAbstractItemView =
, mkProp "iconSize" $ objT c_QSize
, mkConstMethod "indexAt" [objT c_QPoint] $ objT c_QModelIndex
, mkConstMethod "indexWidget" [objT c_QModelIndex] $ ptrT $ objT c_QWidget
-- TODO mkConstMethod' "itemDelegate" "itemDelegate" [] $ ptrT $ objT c_QAbstractItemDelegate
-- TODO mkConstMethod' "itemDelegate" "itemDelegateAt" [objT c_QModelIndex] $
-- ptrT $ objT c_QAbstractItemDelegate
-- TODO mkConstMethod "itemDelegateForColumn" [intT] $ ptrT $ objT c_QAbstractItemDelegate
-- TODO mkConstMethod "itemDelegateForRow" [intT] $ ptrT $ objT c_QAbstractItemDelegate
, mkConstMethod' "itemDelegate" "itemDelegate" [] $
ptrT $ objT c_QAbstractItemDelegate
, mkConstMethod' "itemDelegate" "itemDelegateAt" [objT c_QModelIndex] $
ptrT $ objT c_QAbstractItemDelegate
, mkConstMethod "itemDelegateForColumn" [intT] $
ptrT $ objT c_QAbstractItemDelegate
, mkConstMethod "itemDelegateForRow" [intT] $
ptrT $ objT c_QAbstractItemDelegate
, mkMethod "keyboardSearch" [objT c_QString] voidT
, mkProp "model" $ ptrT $ objT c_QAbstractItemModel
, mkMethod "openPersistentEditor" [objT c_QModelIndex] voidT
......@@ -120,9 +125,9 @@ c_QAbstractItemView =
, mkProp "selectionModel" $ ptrT $ objT c_QItemSelectionModel
, mkMethod "setDropIndicatorShown" [boolT] voidT
, mkMethod "setIndexWidget" [objT c_QModelIndex, ptrT $ objT c_QWidget] voidT
-- TODO mkMethod "setItemDelegate" [ptrT $ objT c_QAbstractItemDelegate] voidT
-- TODO mkMethod "setItemDelegateForColumn" [intT, ptrT $ objT c_QAbstractItemDelegate] voidT
-- TODO mkMethod "setItemDelegateForRow" [intT, ptrT $ objT c_QAbstractItemDelegate] voidT
, mkMethod "setItemDelegate" [ptrT $ objT c_QAbstractItemDelegate] voidT
, mkMethod "setItemDelegateForColumn" [intT, ptrT $ objT c_QAbstractItemDelegate] voidT
, mkMethod "setItemDelegateForRow" [intT, ptrT $ objT c_QAbstractItemDelegate] voidT
, mkConstMethod "showDropIndicator" [] boolT
, mkConstMethod "sizeHintForColumn" [intT] intT
, mkConstMethod "sizeHintForIndex" [objT c_QModelIndex] $ objT c_QSize
......
......@@ -67,11 +67,11 @@ c_QAction =
classSetEntityPrefix "" $
makeClass (ident "QAction") Nothing [c_QObject] $
collect
[ test (qtVersion >= [5, 0]) $ mkCtor "new" []
[ test (qtVersion >= [5, 7]) $ mkCtor "new" []
, just $ mkCtor "newWithParent" [ptrT $ objT c_QObject]
, test (qtVersion >= [5, 0]) $ mkCtor "newWithText" [objT c_QString]
, test (qtVersion >= [5, 7]) $ mkCtor "newWithText" [objT c_QString]
, just $ mkCtor "newWithTextAndParent" [objT c_QString, ptrT $ objT c_QObject]
, test (qtVersion >= [5, 0]) $ mkCtor "newWithIconAndText" [objT c_QIcon, objT c_QString]
, test (qtVersion >= [5, 7]) $ mkCtor "newWithIconAndText" [objT c_QIcon, objT c_QString]
, just $ mkCtor "newWithIconAndTextAndParent"
[objT c_QIcon, objT c_QString, ptrT $ objT c_QObject]
, just $ mkProp "actionGroup" $ ptrT $ objT c_QActionGroup
......
-- This file is part of Qtah.
--
-- Copyright 2018 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/>.
module Graphics.UI.Qtah.Generator.Interface.Widgets.QDateEdit (
aModule,
c_QDateEdit,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass),
addReqIncludes,
classSetEntityPrefix,
ident,
includeStd,
makeClass,
mkCtor,
)
import Foreign.Hoppy.Generator.Types (objT, ptrT)
import Foreign.Hoppy.Generator.Version (collect, just)
import Graphics.UI.Qtah.Generator.Interface.Core.QDate (c_QDate)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QDateTimeEdit (
c_QDateTimeEdit,
)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QWidget (c_QWidget)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
aModule =
AQtModule $
makeQtModule ["Widgets", "QDateEdit"]
[ QtExport $ ExportClass c_QDateEdit ]
c_QDateEdit =
addReqIncludes [includeStd "QDateEdit"] $
classSetEntityPrefix "" $
makeClass (ident "QDateEdit") Nothing [c_QDateTimeEdit] $
collect
[ just $ mkCtor "new" []
, just $ mkCtor "newWithParent" [ptrT $ objT c_QWidget]
, just $ mkCtor "newWithDate" [objT c_QDate]
, just $ mkCtor "newWithDateAndParent" [objT c_QDate, ptrT $ objT c_QWidget]
]
-- This file is part of Qtah.
--
-- Copyright 2018 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