Results 1 to 6 of 6

Thread: Single Log File for Qt Project.

  1. #1
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Single Log File for Qt Project.

    hi,

    i have a QT project in Linux with 4 windows(corresponding .cpp..h etc.,).
    i want to maintain a single Log file for all the 4 windows.
    how can i do that?

    Actually i tried creating the file and opening in main.cpp but it cannot be used in other .cpp files,
    how can i use this file pointer in other windows. i tried with extern keyword but it is not working.

    Thanks in advance.

  2. #2
    Join Date
    Sep 2009
    Posts
    72
    Thanked 10 Times in 10 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: Single Log File for Qt Project.

    Have a look at QtMsgHandler qInstallMsgHandler ( QtMsgHandler handler ) function in qt assistant. that will be usable in ur case

  3. #3
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Single Log File for Qt Project.

    i dint find much information about
    QtMsgHandler
    .
    Could you direct me .

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Single Log File for Qt Project.

    you can use the singleton approach for passing the pointer to your four windows. But better you use the solution vishwajeet.dusane suggested you. To find informations use the assistant: On the left choose the tab "index" and type inside the search field "qInstallMsgHandler".

    Or use the online documentation: QtGlobal::qInstallMsgHandler().

  5. #5
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Single Log File for Qt Project.

    i want to use the singleton approach..
    so how can i pass the File pointer..
    could u suggest singleton

  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Single Log File for Qt Project.

    Have a look at our wiki: [WIKI]Singleton_pattern[/WIKI].

Similar Threads

  1. Replies: 1
    Last Post: 3rd December 2009, 23:34
  2. Multiple appearances in a single ui file
    By zgulser in forum Qt Tools
    Replies: 1
    Last Post: 5th June 2009, 19:12
  3. delete a single file from a directory
    By rishiraj in forum Newbie
    Replies: 1
    Last Post: 12th March 2009, 05:46
  4. Multiple project files in a single directory
    By jogeshwarakundi in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 17th July 2008, 07:03
  5. one single project file for Qt/Qtopia Core/QPE
    By izico in forum Qt for Embedded and Mobile
    Replies: 8
    Last Post: 27th June 2007, 07:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.