Skip to main content

Cross-Qt compatibility module for IDAPython

Project description

Cross-Qt compatibility module for IDAPython.

What is it?

Cute is a tiny compatibility module, to allow IDAPython code to use PySide/Qt4 and PyQt/Qt5 seamlessly.


Cute was originally a part of Sark (sark.qt). Since no-one likes dependencies, especially for things this small, no-one used it. So I decided to release it as a separate module as well, so that people can just take the file as-is and use it in their own code.


Qt Modules

Importing QtCore, QtGui and QtWidgets works for all Qt versions. For Qt4, QtWidgets is an alias for QtGui, so Qt5 code with QtWidgets / QtGui separation will work on Qt4 as well.

from cute import QtCure, QtGui, QtWidgets

Connecting to Signals

Cute offers a cute.connect(...) method to mitigate the difference between Qt4 and Qt5.

# Qt4 Code:
QtCore.QObject.connect(my_object, QtCore.SIGNAL('error(QProcess::ProcessError)'), my_callback)

# Qt5 Code:

# Cute Code:
cute.connect(my_object, 'error(QProcess::ProcessError)', my_callback)

The API for disconnecting is the same, just use the cute.disconnect(...) function.

Form to Widget

IDA has 2 APIs for getting the widget associated with a TForm. One for PyQt and one for PySide. Cute wraps them both in one function.

my_widget = cute.form_to_widget(my_tform)

Which Qt Should I Use?

Sometimes, you do need to to know the Qt version your code uses. For those cases, ask the use_qt5 variable.

if cute.use_qt5:
    print 'Use Qt5'
    print 'Use Qt4'

In a Project

There are two recommended ways to use Cute:

  1. Copy it into your own project. This way does create code duplication, but avoid dependencies.
  2. Install it as a package - pip install idacute.


Cute is released under the MIT license, so you are free to use it in any project whatsoever.


Q: Why did you name it “cute”?

A: For years I was sure “Qt” is pronounced “Q T”. This is my effort to remind myself it is not.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Built Distributions

idacute-1.0.1-py2.py3-none-any.whl (5.7 kB view hashes)

Uploaded py2 py3

idacute-1.0.1-py2-none-any.whl (7.6 kB view hashes)

Uploaded py2

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page