enthought / pyface

pyface: traits-capable windowing framework
Other
105 stars 55 forks source link

Should 'import pyface.api' set the toolkit to 'qt' rather than 'qt4'? #1194

Closed mdickinson closed 1 year ago

mdickinson commented 1 year ago

Currently, import pyface.api in an environment containing PySide or PyQt sets the ETS toolkit to "qt4". This causes issues if an application later tries to set the toolkit to "qt". Would it make more sense for the Pyface import to be setting a toolkit of "qt" instead?

Reproducer:

mdickinson@mirzakhani Desktop % edm env create --force --version 3.8 testing
Removing environment: testing
Fetching indices for runtime repositories. done
Installing runtime... done
Fetching indices for package repositories. done
Installing/removing package(s)

mdickinson@mirzakhani Desktop % edm install --add-repository enthought/lgpl -e testing pyface pyside6
Fetching indices for package repositories.. done

The following packages will be installed:

    importlib_resources  5.4.0-1      27     KiB
    libfreetype          2.12.1-1    637     KiB
    libharfbuzz          3.2.0-4     924     KiB
    libicu               70.1-2       14.55  MiB
    libpng               1.6.37-100  242     KiB
    libturbojpeg         2.1.2-1     430     KiB
    libzstd              1.5.0-1       1.12  MiB
    pyface               7.4.4-2       2.41  MiB
    pyside6              6.2.3-6      11     MiB
    qtbase               6.2.3-3      11.02  MiB
    qtdeclarative        6.2.3-2       8.92  MiB
    qtmultimedia         6.2.3-3     542     KiB
    qtshadertools        6.2.3-2       1.54  MiB
    qtsvg                6.2.3-2     217     KiB
    qttools              6.2.3-3     468     KiB
    shiboken6            6.2.3-4     259     KiB
    traits               6.4.1-1       4.76  MiB
    zipp                 3.7.0-1       6     KiB

Do you want to continue ? [Y/n]: y
Installing/removing package(s)
pyside6             [............................................................................................]
mdickinson@mirzakhani Desktop % edm run -e testing -- python
Enthought Deployment Manager -- https://www.enthought.com
Python 3.8.12 |Enthought, Inc. (x86_64)| (default, Sep 27 2021, 11:51:02) 
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyface.api
>>> from traits.etsconfig.api import ETSConfig
>>> ETSConfig.toolkit
'qt4'