Don’t use width/height stylesheet in Qt

Qt has an internal collision if you use “width: xxx;” or “height: xxx” in the widgets. The collision is between Qt’s layout system and style sheet handling. It causes Qt incorrectly calculating QScrollBar’s size. Therefore it effected all other widgets along side the scrollbars. The best solution is: don’t use width or height style in…

Two key points in writing a Windows NDIS Miniport Driver with NdisMediumIP

In Windows 7 or later, NDIS miniport driver support NdisMediumIP as its media type. This means the network data sending to or receiving from the network adapter is pure IP packet, without any media frame like an ethernet frame. Everything is OK to write such a miniport driver, except for two points different from traditional…

Access one opened file/device handle from multiple threads in Windows

Windows’ kernel I/O manager will serialize I/O requests automatically if you didn’t have the flag FILE_FLAG_OVERLAPPED in CreateFile() call, as the page http://winprogger.com/multithreaded-synchronous-io-must-be-asynchronous/comment-page-1/#comment-59075 described. This fact haven’t be mentioned in M$’s documentation, and there is few information about this on the web. Conclusion. If you want to Open a handle and access it from multiple…

Build Qt from source and install it on Windows

The major problem is its installation. 1. Doing shadow building. Configure the building in a side directory. configure -target xp -prefix the-correct-path-to-install -D _USING_V110_SDK71_ For example, the command with ssl support should be like this: configure -target xp -prefix C:/Qt/5.6.3/msvc2015_xp -D _USING_V110_SDK71_ -openssl -I C:/openssl-1.0.2s/inc32 -L C:/openssl-1.0.2s/out32 The correct install path is important, since a…

Old Android version, linux shared library and apk packer controlled by Android Studio

Old Android version (4.4 on my side) didn’t look for shared library by SONAME inside. It only checks file name. For example, in recent Android version (7 or 8), one file named libcrypto.so whose SONAME is libcrypto.so.1.0.0 can be loaded by dependents successfully. But in old versions the system reported “dlopen failed to load libcrypto.so.1.0.0”.…

Android studio 3.0, modules and IDE symbol indexing

Long in short, after upgraded to Android Studio 3.0, symbols from aar binary modules cannot be resolved in IDE, although the building/make is successful. Clean or Rebuild project is useless.   Two steps solution: Change line compile(‘the-aar-module-name’) to implementation project(‘the-aar-module-name’) Select ‘Invalidate Caches / Restart‘ from File menu.

Strange behavior in WOW64 DLL loading in Windows 2008 R2

That is, if a 32bit DLL was loaded by CreateRemoteThread(), the DLL would be unloaded silently without DLL_PROCESS_DETACH invocation sent to DLLMain() of the DLL. There are indeed 2 weird issues, one is silent unloading, the other is no DLL_PROCESS_DETACH callback. This occurs on WOW64 environment of Windows 2008 Server R2 only.  Windows 2012 and…

Selecting a correct order of API call sequences is important

In short, ffmpeg changes its API in recent versions. One of them is marking AVStream.codec as deprecated. On other side, a AVCodecParameters * AVStream.codecpar was added for codec information described in the stream. To decode data read from stream correctly, we must create a AVCodecContext through avcodec_alloc_context3(), copy codec information from AVStream.codecpar to this allocated AVCodecContext, and…

A simple shell script integrated to Xcode to generate and copy architecture adaptive dylib in

if [ “$CONFIGURATION” == “Debug” ]; then    LIBFFMPEG_DIR=”$PROJECT_DIR/../../ffmpeg/ios/universal/debug” else    LIBFFMPEG_DIR=”$PROJECT_DIR/../../ffmpeg/ios/universal/release” fi for a in $ARCHS; do     EXTRACT_ARCHS=”$EXTRACT_ARCHS -extract $a” done lipo “$LIBFFMPEG_DIR/lib/libffmpeg.dylib” $EXTRACT_ARCHS -output “$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/libffmpeg.dylib” if [ “$CODE_SIGNING_REQUIRED” == “YES” ]; then    codesign -s “$EXPANDED_CODE_SIGN_IDENTITY” “$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/libffmpeg.dylib” fi install_name_tool -change “libffmpeg.dylib” “@executable_path/libffmpeg.dylib” “$BUILT_PRODUCTS_DIR/$EXECUTABLE_PATH”