QDataStream &QDataStream::operator<<(qint32 i){ CHECK_STREAM_PRECOND(*this) if (noswap) { dev->write((char *)&i, sizeof(qint32)); } else { // swap bytes register uchar *p = (uchar *)(&i); char b[4]; qDebug() << "1:" << p << "/" << *p << ", "<< b << ", " << b[0] << ", " << b[1] << ", "<< b[2] << ", "<< b[3]; b[3] = *p++; qDebug() << "2:" << p << "/" << *p << ", "<< b << ", " << b[0] << ", " << b[1] << ", "<< b[2] << ", "<< b[3]; b[2] = *p++; qDebug() << "3:" << p << "/" << *p << ", "<< b << ", " << b[0] << ", " << b[1] << ", "<< b[2] << ", "<< b[3]; b[1] = *p++; qDebug() << "4:" << p << "/" << *p << ", "<< b << ", " << b[0] << ", " << b[1] << ", "<< b[2] << ", "<< b[3]; b[0] = *p; qDebug() << "5:" << p << "/" << *p << ", "<< b << ", " << b[0] << ", " << b[1] << ", "<< b[2] << ", "<< b[3]; dev->write(b, 4); } return *this;}
C++ (Qt)#include <QtGui/QApplication>#include <QtGui/QMainWindow>#include <QtGui/QDockWidget> int main(int argc, char *argv[]){ QApplication a(argc, argv); QMainWindow *testDocksClass = new QMainWindow(); QWidget *centralWidget; QDockWidget *dockWidget_2; QWidget *dockWidgetContents_2; QDockWidget *dockWidget; QWidget *dockWidgetContents; QDockWidget *dockWidget_3; QWidget *dockWidgetContents_3; centralWidget = new QWidget(testDocksClass); testDocksClass->setCentralWidget(centralWidget); dockWidget = new QDockWidget(testDocksClass); dockWidgetContents = new QWidget(); dockWidget->setWidget(dockWidgetContents); testDocksClass->addDockWidget(static_cast<Qt::DockWidgetArea>(1), dockWidget); dockWidget_2 = new QDockWidget(testDocksClass); dockWidgetContents_2 = new QWidget(); dockWidget_2->setWidget(dockWidgetContents_2); testDocksClass->addDockWidget(static_cast<Qt::DockWidgetArea>(2), dockWidget_2); dockWidget_3 = new QDockWidget(testDocksClass); dockWidgetContents_3 = new QWidget(); dockWidget_3->setWidget(dockWidgetContents_3); testDocksClass->addDockWidget(static_cast<Qt::DockWidgetArea>(1), dockWidget_3); QByteArray arr = testDocksClass->saveState(); testDocksClass->restoreState(arr); // CRASH INTO RELEASE testDocksClass->show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); return a.exec();}
C:\Program Files\Microsoft Visual Studio 9.0\VC\binMicrosoft (R) Program Maintenance Utility Version 9.00.21022.08Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86Copyright (C) Microsoft Corporation. All rights reserved.