Qt:平台相关的代码写法

Qt:平台相关的代码写法

#ifdef Q_OS_LINUX

#ifdef V4L

rc = new V4L1VideoCaptureDevice;

#endif //V4L

#endif //Q_OS_LINUX

#ifdef Q_OS_WIN32

rc = new CvVideoCaptureDevice;

#endif // Q_OS_WIN32

} else {

rc = new XvidVideoCaptureDevice( file );

}

#ifndef Q_OS_MAC

vboxLayout->setSpacing(6);

#endif

vboxLayout->setMargin(11);

storageLayout = new QHBoxLayout();

#ifndef Q_OS_MAC

storageLayout->setSpacing(6);

#endif

#ifndef Q_OS_MAC

storageLayout->setMargin(0);

#endif

你可能感兴趣的:(qt)