Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to PySide6 #1476

Merged
merged 37 commits into from
Oct 19, 2023
Merged

Upgrade to PySide6 #1476

merged 37 commits into from
Oct 19, 2023

Conversation

psavery
Copy link
Collaborator

@psavery psavery commented May 23, 2023

This PR also upgrades our Python version to Python3.11, renames hexrd.ui to hexrdgui, and adds osx-arm64 packages. So a lot of major changes.

Fixes: #1145
Fixes: #1338
Fixes: #1351
Fixes: #1467
Fixes: #1556
Fixes: #1589

psavery and others added 23 commits October 19, 2023 12:32
This was done via this command:

```bash
find . -name "*.py" | xargs sed -i 's/PySide2/PySide6/g'
```

This takes care of most changes needed.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
This is different in PySide6

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
It is installing pyside2, and having pyside2 and pyside6 at the same
time can cause compatibility issues.

Now, the period table will not work, but we can try to fix it later.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
PySide6 needs it.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
The regular `matplotlib` package brings in qt5 dependencies which we
want to avoid. Using `matplotlib-base` skips the qt dependencies and
will use what we already have (pyside6).

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
The "silx-base" does not install any other dependencies, which is
great for us. That means we can use PySide6 with silx and not install
Qt5.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
I don't know why this is an issue, but these changes appear to fix it.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
I think this works better... for some reason, we need to accept
the progress as part of the QueuedConnection for PySide6.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
PySide6 requires us to do this.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Need to do this for PySide6 for some reason.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
The following warning was appearing:

```
QAbstractItemView::commitData called with an editor that does not belong to this view
```

It looks like the modified functions were getting called with a checkbox
before it belonged to the view.

To fix it, we now only commit the data on user interaction (the `clicked` signal
instead of the `toggled` signal).

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
This was just a request made by LLNL.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
It appears that PySide6 saves and loads QSettings a little differently
than PySide2. When we load QSettings into PySide6 that were generated
in PySide2, lists that are nested in dicts become lists of lists
instead of flat lists. There may be some other differences too.

Rather than trying to figure out how to patch the QSettings, let's
just make a new version of QSettings. This means that when users
upgrade to the PySide6 version, they will lose their settings, but
that is okay...

This doesn't affect state files at all, which do not use QSettings
but a different mechanism for storing state.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
The panel buffer should not be applied when pre-processing images, only after
import is complete and images are re-loaded.

Signed-off-by: Brianna Major <brianna.major@kitware.com>
Otherwise, it goes to the back of the application.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
This fixes an error that was occurring.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
We don't need to reject because `self.remove_lines()` is already
called. And rejecting is causing an issue due to a bug in Qt
(reported [here](https://bugreports.qt.io/browse/PYSIDE-2490)).

This issue is new to PySide6. We might run into it elsewhere. But
let's hope that Qt fixes the issue soon.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Qt is deprecating "exec_" in favor of "exec", so let's go ahead and
switch that over.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
It is nicer to have a window title than just "hexrd".

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
We were planning on doing this for a while anyways. Since we are
making major changes, we might as well keep on going!

Fixes: #1145

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
bnmajor and others added 5 commits October 19, 2023 12:32
The save images dialog used to use the working directory as the default
location. This may not be in sync (like after loading a state file) and may not
be a good starting point. Instead use the most recent images directory. If that
path does not exist or is invalid default to the current working directory.

Signed-off-by: Brianna Major <brianna.major@kitware.com>
I'm not sure if we are repeatedly connecting anywhere (I don't immediately
see that), but just in case we are, make sure that previous connections
are removed before new connections are made.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
We are removing the namespace package support to simplify things.

Now, all HEXRDGUI code will lie under `hexrdgui` instead of `hexrd.ui`.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
It keeps on causing issues, so let's just disable it for now.

We can enable it as long as we are sure that this issue will not
happen again: #1556

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
@psavery psavery marked this pull request as ready for review October 19, 2023 20:07
@psavery psavery requested a review from bnmajor October 19, 2023 20:08
Copy link
Collaborator

@bnmajor bnmajor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!! 🚀

@psavery psavery merged commit f93458a into master Oct 19, 2023
18 checks passed
@psavery psavery deleted the pyside6 branch October 19, 2023 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants