Skip to content

Instantly share code, notes, and snippets.

View keithel's full-sized avatar

Keith Kyzivat keithel

  • New Hampshire, USA
View GitHub Profile

Apple debugging tips

  1. Create a blank Xcode project for the purpose of debugging your app, if it was not built with Xcode.
  2. Select your executable you wish to debug using Debug->Debug Executable... or Debug->Attach to process.
  3. You can modify startup parameters for the app using the scheme, accessible at Product->Scheme->Edit Scheme....
  4. To load debug versions of libraries, like the Qt libraries, set the environment variable DYLD_IMAGE_SUFFIX to _debug which will load the the debug versions of the Qt libraries. You can set this in the Arguments tab of the Scheme editor.
  5. In Scheme editor, make sure that the Document Versions ☐ Allow debugging when browsing versions checkbox is unchecked - it defaults to on. Without doing this, you will often have applications failing on startup because Xcode inserts command line options to the application that the app is not expecting.
  6. Make sure that the .dSYM files are located adjacent to the .frameworks and/or .dyld libraries.
  7. Running `image l
@keithel
keithel / config.summary
Last active April 18, 2023 16:58
Qt 6.5.0 configure for macOS universal build, frameworks, nodejs webengine issue
Building for: macx-clang (x86_64;arm64), x86_64 features: cx16 mmx sse sse2 sse3 ssse3 sse4.1)
Compiler: clang (Apple) 14.0.0.14000029
Build options:
Mode ................................... debug and release (with debug info)
Optimize release build for size ........ no
Fully optimize release builds (-O3) .... no
Building shared libraries .............. yes
Using C standard ....................... C11
Using C++ standard ..................... C++17
@keithel
keithel / filedialog_timing.py
Created April 14, 2023 16:17
Maya python code to test how long it takes to open and close a file dialog
import maya.cmds as cmds
from PySide6.QtCore import Slot, QObject, QElapsedTimer
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
app = QApplication.instance()
active_window = None
elapsed_timer = QElapsedTimer()
@Slot(QWidget, QWidget)
def check_if_dialog_open(old, now):
@keithel
keithel / webengineview_pixel_color.py
Created March 22, 2023 18:09
Testing QWebEngineView rendering
try:
from PySide2.QtWebEngineWidgets import QWebEngineView
from PySide2.QtCore import QObject, Signal, Slot, QTimer, QEventLoop, QPoint
from PySide2.QtWidgets import QLabel, QWidget
from PySide2.QtGui import QImage, QRegion
except ModuleNotFoundError:
from PySide6.QtWebEngineWidgets import QWebEngineView
from PySide6.QtCore import QObject, Signal, Slot, QTimer, QEventLoop, QPoint
from PySide6.QtWidgets import QLabel, QWidget
from PySide6.QtGui import QImage, QPainter, QRegion, QPixmap
@keithel
keithel / qt6.5-build-rocky8-needed-packages.txt
Created January 26, 2023 18:44
Packages needed to build Qt 6.5 core libs with full XCB support on Rocky 8
libXrender-devel libXrender
libxcb-devel libxcb-render, libxcb-shape, libxcb-randr, libxcb-xfixes, libxcb-xkb, libxcb-sync, libxcb-shm
xcb-util-renderutil-devel libxcb-render-util
xcb-util-wm-devel libxcb-icccm
xcb-util-keysyms-devel libxcb-keysyms
xcb-util-image-devel libxcb-image
xcb-util-devel libxcb-util
xcb-util-cursor-devel libxcb-cursor0
libxkbcommon-devel libxkbcommon
libxkbcommon-x11-devel libxkbcommon-x11
@keithel
keithel / qt5_repos_needing_write_access.py
Created January 13, 2023 17:04
Python script that uses github rest api to fetch qt submodule repositories from a github server organization that mirrors Qt repositories and shows which repositories do not have write access or do not exist.
#!/usr/bin/env python
import sys
import os
import os.path
import requests
if __name__ == "__main__":
if not os.path.isfile("./init-repository"):
print("Please execute from the base of a qt5 repository", file=sys.stderr)
@keithel
keithel / copy_missing_qml_so_to_runtime_dir.py
Last active January 9, 2023 21:30
Copy missing Qt Qml .so files from Qt artifact to runTime qml dir
#!/usr/bin/env python
import sys
from argparse import ArgumentParser, Namespace
from pathlib import Path
import os
from os.path import dirname, basename
from typing import Tuple
from shutil import copy
@keithel
keithel / .python-version
Created December 4, 2022 18:10
Qt webui example in Python (ported by me)
pyside2
@keithel
keithel / pyside6_enum_test.py
Created November 12, 2022 20:43
PySide 6 6.4 Enum test
from PySide6.QtGui import QStandardItem
import traceback
from enum import IntEnum
user_type = QStandardItem.UserType
# should get: `ItemType.UserType` with new enum support
assert str(user_type) == "ItemType.UserType", "user_type != ItemType.UserType"
try:
assert user_type + 1 == 1001, "user_type + 1 != 1001"
@keithel
keithel / recover-ntfs-inodes.sh
Created November 7, 2022 14:52
Script to recover multiple inodes of deleted files discovered in the NTFS MFT file of an NTFS volume
#!/bin/bash
# Script to recover multiple inodes of deleted files discovered in the NTFS MFT
# file of an NTFS volume
set -e
set -u
echo "$0 $@"