QTreeView.hs 2.02 KB
Newer Older
1 2
-- This file is part of Qtah.
--
3
-- Copyright 2015-2018 The Qtah Authors.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
--
-- 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.QTreeView (
  aModule,
  c_QTreeView,
  ) where

import Foreign.Hoppy.Generator.Spec (
24
  Class,
25 26 27 28 29 30 31
  Export (ExportClass),
  addReqIncludes,
  classSetEntityPrefix,
  ident,
  includeStd,
  makeClass,
  mkCtor,
32
  mkBoolIsProp,
33
  mkMethod,
34
  )
35
import Foreign.Hoppy.Generator.Types (intT, voidT)
36 37
import Foreign.Hoppy.Generator.Version (collect, just, test)
import Graphics.UI.Qtah.Generator.Flags (qtVersion)
38 39 40 41 42 43
import Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractItemView (c_QAbstractItemView)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types

{-# ANN module "HLint: ignore Use camelCase" #-}

44
aModule :: AModule
45 46
aModule =
  AQtModule $
47 48 49
  makeQtModule ["Widgets", "QTreeView"] $
  QtExport (ExportClass c_QTreeView) :
  map QtExportSignal signals
50

51
c_QTreeView :: Class
52 53 54
c_QTreeView =
  addReqIncludes [includeStd "QTreeView"] $
  classSetEntityPrefix "" $
55 56 57 58 59 60 61 62 63 64 65 66
  makeClass (ident "QTreeView") Nothing [c_QAbstractItemView] $
  collect
  [ just $ mkCtor "new" []
  , just $ mkBoolIsProp "headerHidden"
  , just $ mkMethod "resizeColumnToContents" [intT] voidT
  , test (qtVersion >= [4, 2]) $ mkBoolIsProp "sortingEnabled"
  -- TODO add more methods
  ]

signals :: [Signal]
signals =
  [ -- TODO add signals
67
  ]