withQtWStringResult :: (Ptr CWchar -> IO CInt) -> IO String
withQtWStringResult f
  = do
    len <- f nullPtr
    if (len<=0)
     then return ""
     else withCWString (replicate (fromCInt len) ' ') $ \cstr ->
          do f cstr
             peekCWString cstr
withQtWStringResult :: (Ptr CWchar -> IO CInt) -> IO String
withQtWStringResult f
  = do
    len <- f nullPtr
    if (len<=0)
     then return ""
     else withCWString (replicate (fromCInt len) ' ') $ \cstr ->
          do f cstr
             peekCWString cstr
withQtWStringResult f
  = do
    len <- f nullPtr
    if (len<=0)
     then return ""
     else withCWString (replicate (fromCInt len) ' ') $ \cstr ->
          do f cstr
             peekCWString cstr