title: QT function arguments
body: <p>Hello I am new in QT and I want to an make Log class.
  I made <strong>Log.cpp</strong>, below code saves log messages in <strong>Log.txt</strong> file but problem is in function argument <code>QString msg</code>. I want user to type what message need to save by calling <code>logs.log_message("My log message").</code></p>
  
  <pre><code>#include "log.h"
  
  
  void Log::log_message(QString msg)
  {
      QFile file("Log.txt");
      if(!file.open(QIODevice::Append | QIODevice::WriteOnly | QIODevice::Text))
          return;
      QTextStream out(&amp;file);
      out &lt;&lt; msg \n";
  }
  </code></pre>
  
  <p>And when i try to call that method in main function i have error:</p>
  
  <pre><code>Log logs;
  logs.log_message('Database initialized');
  </code></pre>
  
  <p><strong>Issues :</strong></p>
  
  <blockquote>
    <p>C:\Users\ikac\Desktop\workspace\QT\Phonebook-build-desktop-Qt_4_8_1_for_Desktop_-<em>MSVC2010</em>_Qt_SDK__Debug..\Phonebook\main.cpp:15: error: C2015: too many characters in constant</p>
    
    <p>C:\Users\ikac\Desktop\workspace\QT\Phonebook-build-desktop-Qt_4_8_1_for_Desktop_-<em>MSVC2010</em>_Qt_SDK__Debug..\Phonebook\main.cpp:15: error: C2660: 'Log::log_message' : function does not take 1 arguments</p>
    
    <p>C:\Users\ikac\Desktop\workspace\QT\Phonebook-build-desktop-Qt_4_8_1_for_Desktop_-<em>MSVC2010</em>_Qt_SDK__Debug..\Phonebook\log.cpp:5:
    error: C2511: 'void Log::log_message(QString)' : overloaded member
    function not found in 'Log'</p>
    
    <p>c:\users\ikac\desktop\workspace\qt\phonebook\log.h:8: see declaration
    of 'Log'</p>
    
    <p>C:\Users\ikac\Desktop\workspace\QT\Phonebook-build-desktop-Qt_4_8_1_for_Desktop_-<em>MSVC2010</em>_Qt_SDK__Debug..\Phonebook\log.cpp:10:
    error: C2017: illegal escape sequence</p>
    
    <p>C:\Users\ikac\Desktop\workspace\QT\Phonebook-build-desktop-Qt_4_8_1_for_Desktop_-<em>MSVC2010</em>_Qt_SDK__Debug..\Phonebook\log.cpp:10:
    error: C2001: newline in constant</p>
  </blockquote>
  
  <p><strong>Compiler output:</strong></p>
  
  <blockquote>
    <p>16:22:00: Running build steps for project Phonebook... 16:22:00:
    Configuration unchanged, skipping qmake step. 16:22:00: Starting:
    "D:\QT\QtCreator\bin\jom.exe"  main.cpp ..\Phonebook\main.cpp(15) :
    error C2015: too many characters in constant ..\Phonebook\main.cpp(15)
    : error C2660: 'Log::log_message' : function does not take 1 arguments
    log.cpp ..\Phonebook\log.cpp(5) : error C2511: 'void
    Log::log_message(QString)' : overloaded member function not found in
    'Log'
            c:\users\ikac\desktop\workspace\qt\phonebook\log.h(8) : see declaration of 'Log' ..\Phonebook\log.cpp(10) : error C2017: illegal
    escape sequence ..\Phonebook\log.cpp(10) : error C2001: newline in
    constant Generating Code...   cl -c -nologo -Zm200 -Zc:wchar_t- -Zi
    -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"d:\QT\Desktop\Qt\4.8.1\msvc2010\include\QtCore" -I"d:\QT\Desktop\Qt\4.8.1\msvc2010\include\QtGui" -I"d:\QT\Desktop\Qt\4.8.1\msvc2010\include\QtSql" -I"d:\QT\Desktop\Qt\4.8.1\msvc2010\include" -I"d:\QT\Desktop\Qt\4.8.1\msvc2010\include\ActiveQt" -I"debug" -I"." -I"..\Phonebook" -I"." -I"d:\QT\Desktop\Qt\4.8.1\msvc2010\mkspecs\win32-msvc2010" -Fodebug\ @C:\Users\ikac\AppData\Local\Temp\main.obj.5108.31.jom
      D:\QT\QtCreator\bin\jom.exe -f Makefile.Debug jom:
    C:\Users\ikac\Desktop\workspace\QT\Phonebook-build-desktop-Qt_4_8_1_for_Desktop_-<em>MSVC2010</em>_Qt_SDK__Debug\Makefile.Debug [debug\main.obj] Error 2</p>
    
    <p>jom 1.0.8 - empower your cores</p>
    
    <p>jom:
    C:\Users\ikac\Desktop\workspace\QT\Phonebook-build-desktop-Qt_4_8_1_for_Desktop_-<em>MSVC2010</em>_Qt_SDK__Debug\Makefile [debug] Error 2 16:22:05: The process "D:\QT\QtCreator\bin\jom.exe"
    exited with code 2. Error while building project Phonebook (target:
    Desktop) When executing build step 'Make'</p>
  </blockquote>