Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 16th, 2012  |  syntax: None  |  size: 0.34 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Wrong qstring value on return from a function [closed]
  2. QString ClassA::getType()
  3. {
  4.     return m_Type;
  5. }
  6.        
  7. void ClassA::setType( const QString & str)
  8. {
  9.     m_Type=str;
  10. }
  11.        
  12. void ClassB::test( ClassA& instance)
  13. {
  14.  
  15.     instance.m_returnType = data.getType();
  16. }
  17.        
  18. int main()
  19. {
  20.    ClassA instance;
  21.    ClassB object;
  22.    object.test(instance);
  23. }