Copyright | (c) Marcin Mrotek, 2015 |
---|---|
License | BSD3 |
Maintainer | marcin.jan.mrotek@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Extensions |
|
Main module. Should be enough for most uses.
- registerHaskellModel :: IO ()
- setupDataModel :: forall a. (SetupColumns a, CountFields a) => IO (DataModel a)
- finalizeDataModel :: DataModel a -> IO ()
- setRowCountCallback :: DataModel a -> RowCountCallback -> IO ()
- setDataCallback :: QtTable a => DataModel a -> DataCallback a -> IO ()
- setHeaderDataCallback :: DataModel a -> HeaderDataCallback -> IO ()
- data DataModel a
- delegate :: DataModel a -> HmDelegateHandle
- data HmDelegateHandle
- class QtTable t where
- class SetupColumns t where
- setupColumns :: HmDelegateHandle -> proxy t -> IO ()
- data ColumnIndexException
- type RowCountCallback = IO Int
- type DataCallback a = Int -> IO a
- type HeaderDataCallback = Int -> IO String
Documentation
registerHaskellModel :: IO () Source
Register the HaskellModel in QML's type system, so it can be used in .qml documents.
setupDataModel :: forall a. (SetupColumns a, CountFields a) => IO (DataModel a) Source
Create a data model handle that can be passed to HaskellModel.
finalizeDataModel :: DataModel a -> IO () Source
Free a data model handle.
setRowCountCallback :: DataModel a -> RowCountCallback -> IO () Source
Replace the row count callback of a data model handle.
setDataCallback :: QtTable a => DataModel a -> DataCallback a -> IO () Source
Replace the data callback of a data model handle.
setHeaderDataCallback :: DataModel a -> HeaderDataCallback -> IO () Source
Replace the header data callback of a data model handle. Not used by any QML views.
delegate :: DataModel a -> HmDelegateHandle Source
Identifier of the handle.
data HmDelegateHandle Source
Identifier of a HaskellModel delegate handle.
Marshal HmDelegateHandle Source | |
type MarshalMode HmDelegateHandle c d = ModeBidi c Source |
A class of types with columns that can be indexed by an integer. A generic implementation is provided for all single constructor types.
Nothing
class SetupColumns t where Source
A class of types that can provide a template to setup the QT HaskellModel. A generic implementation is provided for all proxyle constructor types.
Nothing
setupColumns :: HmDelegateHandle -> proxy t -> IO () Source
data ColumnIndexException Source
Exception thrown when QML tries to acces a column that is not available. Shouldn't really happen.
ColumnIndexNegative Int | QML called for a negative column index. |
ColumnIndexOutOfBounds Int Int | QML called for a column index that is too high. |
type RowCountCallback = IO Int Source
Used by QML to query the number of rows in a model.
type DataCallback a = Int -> IO a Source
Used by QML to obtain a row at the given index.
type HeaderDataCallback = Int -> IO String Source
Used by QML to obtain the name of the column at the given index.