192 QString compiler_version = "Compiler version: "; |
193 QString compiler_version = "Compiler version: "; |
193 QString kernel_line = "Kernel: "; |
194 QString kernel_line = "Kernel: "; |
194 QString screen_size = "Size of the screen(s): " + |
195 QString screen_size = "Size of the screen(s): " + |
195 QString::number(screen->width()) + "x" + QString::number(screen->height()) + "\n"; |
196 QString::number(screen->width()) + "x" + QString::number(screen->height()) + "\n"; |
196 QString number_of_screens = "Number of screens: " + QString::number(screen->screenCount()) + "\n"; |
197 QString number_of_screens = "Number of screens: " + QString::number(screen->screenCount()) + "\n"; |
197 std::string processor_name = "Processor: "; |
198 QString processor_name = "Processor: "; |
198 |
199 |
199 // platform specific code |
200 // platform specific code |
200 #ifdef Q_WS_MACX |
201 #ifdef Q_WS_MACX |
201 number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n"; |
202 number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n"; |
202 |
203 |
243 { |
244 { |
244 case QSysInfo::WV_2000: os_version += "Windows 2000\n"; break; |
245 case QSysInfo::WV_2000: os_version += "Windows 2000\n"; break; |
245 case QSysInfo::WV_XP: os_version += "Windows XP\n"; break; |
246 case QSysInfo::WV_XP: os_version += "Windows XP\n"; break; |
246 case QSysInfo::WV_VISTA: os_version += "Windows Vista\n"; break; |
247 case QSysInfo::WV_VISTA: os_version += "Windows Vista\n"; break; |
247 case QSysInfo::WV_WINDOWS7: os_version += "Windows 7\n"; break; |
248 case QSysInfo::WV_WINDOWS7: os_version += "Windows 7\n"; break; |
|
249 //case QSysInfo::WV_WINDOWS8: os_version += "Windows 8\n"; break; //QT 5+ |
248 default: os_version += "Windows (Unknown version)\n"; break; |
250 default: os_version += "Windows (Unknown version)\n"; break; |
249 } |
251 } |
250 kernel_line += "Windows kernel\n"; |
252 kernel_line += "Windows kernel\n"; |
251 #endif |
253 #endif |
252 #ifdef Q_WS_X11 |
254 #ifdef Q_WS_X11 |
280 |
282 |
281 i = 0x80000002; |
283 i = 0x80000002; |
282 asm volatile |
284 asm volatile |
283 ("cpuid" : "=a" (registers[0]), "=b" (registers[1]), "=c" (registers[2]), "=d" (registers[3]) |
285 ("cpuid" : "=a" (registers[0]), "=b" (registers[1]), "=c" (registers[2]), "=d" (registers[3]) |
284 : "a" (i), "c" (0)); |
286 : "a" (i), "c" (0)); |
285 processor_name += std::string((const char *)®isters[0], 4); |
287 processor_name += QByteArray(reinterpret_cast<char*>(®isters[0]), 4); |
286 processor_name += std::string((const char *)®isters[1], 4); |
288 processor_name += QByteArray(reinterpret_cast<char*>(®isters[1]), 4); |
287 processor_name += std::string((const char *)®isters[2], 4); |
289 processor_name += QByteArray(reinterpret_cast<char*>(®isters[2]), 4); |
288 processor_name += std::string((const char *)®isters[3], 4); |
290 processor_name += QByteArray(reinterpret_cast<char*>(®isters[3]), 4); |
289 i = 0x80000003; |
291 i = 0x80000003; |
290 asm volatile |
292 asm volatile |
291 ("cpuid" : "=a" (registers[0]), "=b" (registers[1]), "=c" (registers[2]), "=d" (registers[3]) |
293 ("cpuid" : "=a" (registers[0]), "=b" (registers[1]), "=c" (registers[2]), "=d" (registers[3]) |
292 : "a" (i), "c" (0)); |
294 : "a" (i), "c" (0)); |
293 processor_name += std::string((const char *)®isters[0], 4); |
295 processor_name += QByteArray(reinterpret_cast<char*>(®isters[0]), 4); |
294 processor_name += std::string((const char *)®isters[1], 4); |
296 processor_name += QByteArray(reinterpret_cast<char*>(®isters[1]), 4); |
295 processor_name += std::string((const char *)®isters[2], 4); |
297 processor_name += QByteArray(reinterpret_cast<char*>(®isters[2]), 4); |
296 processor_name += std::string((const char *)®isters[3], 4); |
298 processor_name += QByteArray(reinterpret_cast<char*>(®isters[3]), 4); |
297 i = 0x80000004; |
299 i = 0x80000004; |
298 asm volatile |
300 asm volatile |
299 ("cpuid" : "=a" (registers[0]), "=b" (registers[1]), "=c" (registers[2]), "=d" (registers[3]) |
301 ("cpuid" : "=a" (registers[0]), "=b" (registers[1]), "=c" (registers[2]), "=d" (registers[3]) |
300 : "a" (i), "c" (0)); |
302 : "a" (i), "c" (0)); |
301 processor_name += std::string((const char *)®isters[0], 4); |
303 processor_name += QByteArray(reinterpret_cast<char*>(®isters[0]), 4); |
302 processor_name += std::string((const char *)®isters[1], 4); |
304 processor_name += QByteArray(reinterpret_cast<char*>(®isters[1]), 4); |
303 processor_name += std::string((const char *)®isters[2], 4); |
305 processor_name += QByteArray(reinterpret_cast<char*>(®isters[2]), 4); |
304 processor_name += std::string((const char *)®isters[3], 3); |
306 processor_name += QByteArray(reinterpret_cast<char*>(®isters[3]), 4); |
|
307 processor_name += "\n"; |
305 #else |
308 #else |
306 processor_name += "Unknown"; |
309 processor_name += "Unknown"; |
307 #endif |
310 #endif |
308 |
311 |
309 // compiler |
312 // compiler |