Skip to content

Instantly share code, notes, and snippets.

@cristianadam
cristianadam / MS_Visual_C++_Visual_Assist.kms
Created June 24, 2022 10:50
Qt Creator 2.5.2 Visual C++ keyboard shortcuts from 2012
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE KeyboardMappingScheme>
<!-- Written by Qt Creator 2.5.2, 2012-08-18T19:03:36. -->
<mapping>
<shortcut id="QtCreator.ReturnToEditor">
<key value="Esc"/>
</shortcut>
<shortcut id="QtCreator.New">
<key value="Ctrl+N"/>
</shortcut>
@cristianadam
cristianadam / qtbase-6.3.0-win-msvc.cmake
Created June 17, 2022 10:45
Script used to compile QtBase 6.3.0 statically for Windows Arm64. First run cmake -P qtbase-6.3.0-win-msvc.cmake in a x86_64 console, then in a arm64 one.
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# Run this script on a Windows host to generate Qt binaries.
# Set the PATH environment variable to contain the locations of cmake and git.
if ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "x64")
set(arch "x86_64")
elseif ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "x86")
set(arch "i386")
@cristianadam
cristianadam / qt-6.3.0-win-msvc.cmake
Created June 15, 2022 22:44
Script used to compile Qt 6.3.0 statically for Windows Arm64. First run cmake -P qt-6.3.0-win-msvc.cmake in a x86_64 console, then in a arm64 one.
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# Run this script on a Windows host to generate Qt binaries.
# Set the PATH environment variable to contain the locations of cmake and git.
if ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "x64")
set(arch "x86_64")
elseif ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "x86")
set(arch "i386")
@cristianadam
cristianadam / Go5G-7zip-benchmark.md
Created December 19, 2021 19:18
7zip benchmark on a Samsung Galaxy Book Go 5G x86, x86_64, arm64 and wsl2 linux arm64

Arm64


7-Zip 21.06 (arm64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-11-24

Windows 10.0 22000
ARM64 0 805.D0E cpus:8 128T f:804EB8C1004
LE 
@cristianadam
cristianadam / 7zip-benchmark.txt
Created November 4, 2021 10:01
7zip benchmark on a Samsung Galaxy Book Go x86, x86_64 and arm64.
C:\Program Files (Arm)\7-Zip>7z b
7-Zip 21.04 beta (arm64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-11-02
Windows 10.0 22000
ARM64 0 805.D0E cpus:8 128T f:804EB8C1004
LE
1T CPU Freq (MHz): 1931 2549 2550 2493 2488 2549 2545
4T CPU Freq (MHz): 346% 1903 354% 1952
@cristianadam
cristianadam / qt5.15.2-qtdeclarative.patch
Created August 18, 2021 14:02
Qt 5.15.2 Declarative patch to build with LLVM MinGW.
diff -Naur old/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp new/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp
--- old/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp 2020-10-27 09:02:12.000000000 +0100
+++ new/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp 2021-06-17 18:41:00.815070000 +0200
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include <initguid.h>
#include "qsgd3d12engine_p.h"
#include "qsgd3d12engine_p_p.h"
@cristianadam
cristianadam / configure-qt.cmake
Last active May 4, 2021 13:30
Script that builds Qt6. Run as: cmake -P configure-qt.cmake msvc "qtbase;qtdeclarative;qttools" and so on.
if (CMAKE_ARGC LESS 4)
message("Usage cmake -P " ${CMAKE_ARGV2} " <platform e.g. mingw/msvc> <module;list>")
return()
endif()
if (CMAKE_ARGV3 STREQUAL "clang")
set(ENV{CC} clang)
set(ENV{CXX} clang++)
endif()
@cristianadam
cristianadam / configure-small.cmake
Last active April 5, 2022 10:21
Qt Creator CMake configuration for a small build
if (CMAKE_ARGC LESS 4)
message("Usage cmake -P " ${CMAKE_ARGV2} " <platform e.g. mingw/msvc>")
return()
endif()
if (CMAKE_ARGV3 STREQUAL "mingw")
set(QT_PLATFORM mingw_64)
elseif(CMAKE_ARGV3 STREQUAL "msvc")
set(QT_PLATFORM msvc2019_64)
endif()
@cristianadam
cristianadam / PreLoad.cmake
Created December 15, 2020 11:51
PreLoad.cmake to add to your sources so that CMake would create fileApi JSON files for your IDE's CMake project loading
foreach(file cache-v2 cmakeFiles-v1 codemodel-v2)
file(WRITE "${CMAKE_BINARY_DIR}/.cmake/api/v1/query/${file}" "")
endforeach()
@cristianadam
cristianadam / download_qt5.cmake
Created October 30, 2020 10:31
CMake script to download qt5. Just need to run `cmake -P download_qt5.cmake`. Tested on Windows, Linux, macOS. For Mingw use `cmake -P download_qt5.cmake mingw`
set(qt_version "5.15.1")
string(REPLACE "." "" qt_version_dotless "${qt_version}")
if (WIN32)
set(url_os "windows_x86")
if (CMAKE_ARG_3 STREQUAL "mingw")
set(qt_package_arch_suffix "win64_mingw81")
set(qt_dir_prefix "${qt_version}/mingw81_64")
set(qt_package_suffix "-Windows-Windows_10-Mingw-Windows-Windows_10-X86_64")
else()