Skip to content

Commit e9d23ee

Browse files
committed
Style
1 parent 461dd8f commit e9d23ee

1 file changed

Lines changed: 22 additions & 21 deletions

File tree

ff-qtah/FF/Qt.hs

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
module FF.Qt (printChildrenTree, whenUIIdle) where
22

3-
import Data.Foldable (for_)
4-
import qualified Graphics.UI.Qtah.Core.QMetaClassInfo as QMetaClassInfo
5-
import qualified Graphics.UI.Qtah.Core.QMetaObject as QMetaObject
6-
import Graphics.UI.Qtah.Core.QObject (QObjectPtr, toQObject)
7-
import qualified Graphics.UI.Qtah.Core.QObject as QObject
8-
import qualified Graphics.UI.Qtah.Core.QTimer as QTimer
9-
import Graphics.UI.Qtah.Signal (connect_)
3+
import Data.Foldable (for_)
4+
import Graphics.UI.Qtah.Core.QMetaClassInfo qualified as QMetaClassInfo
5+
import Graphics.UI.Qtah.Core.QMetaObject qualified as QMetaObject
6+
import Graphics.UI.Qtah.Core.QObject (QObjectPtr, toQObject)
7+
import Graphics.UI.Qtah.Core.QObject qualified as QObject
8+
import Graphics.UI.Qtah.Core.QTimer qualified as QTimer
9+
import Graphics.UI.Qtah.Signal (connect_)
1010

11-
printChildrenTree :: QObjectPtr object => object -> IO ()
12-
printChildrenTree = go 0 . toQObject where
13-
go level object = do
14-
name <- QObject.objectName object
15-
meta <- QObject.metaObject object
16-
classInfo <- QMetaObject.classInfo meta 0
17-
className <- QMetaClassInfo.name classInfo
18-
putStrLn $
19-
unwords $ replicate level "| " ++ [show name, ":", show className]
20-
children <- QObject.children object
21-
for_ children $ go (level + 1)
11+
printChildrenTree :: (QObjectPtr object) => object -> IO ()
12+
printChildrenTree = go 0 . toQObject
13+
where
14+
go level object = do
15+
name <- QObject.objectName object
16+
meta <- QObject.metaObject object
17+
classInfo <- QMetaObject.classInfo meta 0
18+
className <- QMetaClassInfo.name classInfo
19+
putStrLn . unwords $
20+
replicate level "| " ++ [show name, ":", show className]
21+
children <- QObject.children object
22+
for_ children $ go (level + 1)
2223

2324
whenUIIdle :: IO () -> IO ()
2425
whenUIIdle action = do
25-
t <- QTimer.new
26-
connect_ t QTimer.timeoutSignal action
27-
QTimer.start t 0
26+
t <- QTimer.new
27+
connect_ t QTimer.timeoutSignal action
28+
QTimer.start t 0

0 commit comments

Comments
 (0)