withQtStringResult :: (Ptr CChar -> IO CInt) -> IO String
withQtStringResult f
  = do
    len <- f nullPtr
    if (len<=0)
     then return ""
     else withCString (replicate (fromCInt len) ' ') $ \cstr ->
          do f cstr
             peekCString cstr
withQtStringResult :: (Ptr CChar -> IO CInt) -> IO String
withQtStringResult f
  = do
    len <- f nullPtr
    if (len<=0)
     then return ""
     else withCString (replicate (fromCInt len) ' ') $ \cstr ->
          do f cstr
             peekCString cstr
withQtStringResult f
  = do
    len <- f nullPtr
    if (len<=0)
     then return ""
     else withCString (replicate (fromCInt len) ' ') $ \cstr ->
          do f cstr
             peekCString cstr