Results 1 to 5 of 5

Thread: Getting MAC Information from qt?

  1. #1
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Getting MAC Information from qt?

    Hi All,

    I m using Qt 4.1.5 on my Mac.
    I want some system information as username currently using the system,Mac OS version, Machine Name,Processor Type(Intel or Power Pc) etc at run time.

    If anybody knows how to get system information then plz help me.

    Thanks.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Getting MAC Information from qt?

    For CPU info use host_info() and the host_basic_info structure ( they are defined in host_info.h).

    As for the others you have to use platform API.

    Regards

  3. #3
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Re: Getting MAC Information from qt?

    Thanks for Reply.

    Actually I m new to MAC so I donot know which API I have to use to get the other Information.

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Getting MAC Information from qt?

    Try looking on developer.apple.com.
    But you can also look at darwinsource.opendarwin.org( which is down now ).

  5. #5
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Getting MAC Information from qt?

    Quote Originally Posted by marcel View Post
    Try looking on developer.apple.com.
    But you can also look at darwinsource.opendarwin.org( which is down now ).
    I am not sure but now is all transfer to

    http://www.macports.org/
    http://www.macosforge.org/

    libs && other i install from http://darwinports.com/

    port install mysql ..

    if you like to discovery sysinfo user..
    I want some system information as username currently using the system,Mac OS version, Machine Name,Processor Type(Intel or Power Pc) etc at run time.
    You can use applescript and qprocess...

    Qt Code:
    1. #elif defined(Q_OS_MACX)
    2.  
    3. //create script
    4. QString scriptFilename = ((Window*)qApp->mainWidget())->getTitle()->getAlbum()->getTmpDir() +
    5. "/tmpBackgroundScript";
    6.  
    7. QFile file( scriptFilename );
    8. if(file.open(IO_WriteOnly))
    9. {
    10. //-----
    11. QTextStream stream;
    12. stream.setDevice( &file );
    13. stream.setEncoding( QTextStream::UnicodeUTF8 );
    14. //-----
    15. stream << "tell application \"Finder\"\n";
    16. stream << "set pFile to POSIX file \"" << chosenFilename.ascii() << "\"\n";
    17. stream << "set desktop picture to file pFile\n";
    18. stream << "end tell";
    19. }
    20. file.close();
    21.  
    22. //run script to set background
    23. p.addArgument( "/usr/bin/osascript" );
    24. p.addArgument( scriptFilename );
    25. p.start();
    26.  
    27. //if there is an old file remove it
    28. if(!oldFilename.isNull())
    29. { tmpDir.remove( oldFilename ); }
    30.  
    31. //-------------------------------
    32. //UNIX
    33. #else
    To copy to clipboard, switch view to plain text mode 

    have a look on applescript you can get so many info....

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  2. Additional QtMsgHandler information
    By bruccutler in forum Newbie
    Replies: 2
    Last Post: 23rd April 2007, 16:38
  3. How I can retrive information abt file.
    By safknw in forum General Programming
    Replies: 3
    Last Post: 2nd December 2006, 13:35
  4. capture information to the command line qt4
    By nikita in forum Qt Programming
    Replies: 3
    Last Post: 5th September 2006, 16:03
  5. Replies: 13
    Last Post: 1st June 2006, 14:01

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.