Python 3/Qt 5 package uploaded to daily PPA

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
triplus
Posts: 7321
Joined: Mon Dec 12, 2011 4:45 pm

Re: Python 3/Qt 5 package uploaded to daily PPA

Postby triplus » Sun Aug 19, 2018 3:11 pm

NormandC wrote:
Sat Aug 18, 2018 9:52 pm
I'll also add that the freecad-python3 package is not adapted to the current Ubuntu Gnome theme.
This is related to QGtkStyle being removed from Qt5.7+. Therefore for now Qt5 apps effectively don't use the Ubuntu native style anymore and such result is expected to happen on Ubuntu for Qt5 apps. There are some options (workarounds) available (basically by continuing to use QGtkStyle) but the end user has to install enable them on their own. No official solution yet. Or i guess if the end user is using a custom FreeCAD stylesheet. That will determine the FreeCAD look. Regardless of the desktop environment used.
looo wrote:
Sun Aug 19, 2018 6:02 am
Maybe @triplus can tell us why his Tux-module need sip. btw.: sip is gpl.
Not that i know of. At least not directly. ATM i don't have Ubuntu 18.04 install but i guess it is time to have one (at least in VM) to test things easily. For now i tested only on my local Py3/Qt5 build (different version of Py3 and Qt5) and can't reproduce the issue. I suspect that this could be related:

https://forum.freecadweb.org/viewtopic. ... 20#p250040

And this PR might have fixed things:

https://github.com/FreeCAD/FreeCAD/pull/1615

As sip is to PyQt what shiboken is to PySide. PySide trying to use sip therefore doesn't make much sense. I am guessing best if first @kkremitzki removes the workaround used and just updates the freecad-python3 package using the latest FreeCAD code. Hopefully the issue will get resolved by doing that. If not i can take a further look on what might be causing the mentioned issue.
User avatar
NormandC
Posts: 16801
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Python 3/Qt 5 package uploaded to daily PPA

Postby NormandC » Sun Aug 19, 2018 3:53 pm

triplus wrote:
Sun Aug 19, 2018 3:11 pm
This is related to QGtkStyle being removed from Qt5.7+. Therefore for now Qt5 apps effectively don't use the Ubuntu native style anymore and such result is expected to happen on Ubuntu for Qt5 apps.
Bummer. Thanks for the info.

triplus wrote:
Sun Aug 19, 2018 3:11 pm
Or i guess if the end user is using a custom FreeCAD stylesheet.
I was using a custom one modified from the existing stylesheets, to get only the Model tree arrows and lines. Unfortunately it does not work anymore in v0.18. One thing that makes it hard is that if you use a Qt stylesheet, you have to style everything which is a pain. As a general rule, I dislike separate themes for apps, I prefer that they comply with the desktop theme. Oh well.
triplus
Posts: 7321
Joined: Mon Dec 12, 2011 4:45 pm

Re: Python 3/Qt 5 package uploaded to daily PPA

Postby triplus » Sun Aug 19, 2018 4:08 pm

Note that to get the native look back for Qt5 apps it's still rather easy to achieve that:

https://www.linuxuprising.com/2018/05/g ... le-in.html

It's just not official solution anymore and enabled by default. Likely due to the fact if you use a custom desktop theme there could be some glitches involved and at some point in time i guess such solution could stop working. But for now it is still rather straightforward task to restore the native look for Qt5 apps on a Linux distribution such as Ubuntu 18.04.

As for FreeCAD stylesheets. Using things like OpenBox, FreeCAD Snap package ... You quickly learn to appreciate such option exist. But yes it comes down to personal taste and being able to customize the experience. But sure you don't have to if you don't want to and prefer the native look and feel.
User avatar
NormandC
Posts: 16801
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Python 3/Qt 5 package uploaded to daily PPA

Postby NormandC » Sun Aug 19, 2018 4:53 pm

triplus wrote:
Sun Aug 19, 2018 4:08 pm
Note that to get the native look back for Qt5 apps it's still rather easy to achieve that:

https://www.linuxuprising.com/2018/05/g ... le-in.html
I had found a similar procedure on a French forum but it was a lot more convoluted. This is much simpler with a single package to install and one terminal command. Thanks. Applied it, and it works.

triplus wrote:
Sun Aug 19, 2018 4:08 pm
But sure you don't have to if you don't want to and prefer the native look and feel.
The problem is that I wanted only to style a very specific part of FreeCAD's GUI, the Model tree, and keep everything else as per the desktop theme. But only copying that part of one of the existing stylesheet shot the whole FreeCAD GUI to hell. I had to painstakingly go through a lot of the original stylesheet and copy more of it and modify it to my needs, and yet I was left with some glitches (a much wider About FreeCAD dialog). Years ago I dabbled a little with .css sheets for websites, and they only override display of the elements they specify. I wish it would work the same for Qt stylesheets.

Anyway, this is off topic...
Attachments
FC017_Model_tree_std_vs_custom.png
Left the tree on Ubuntu with standard desktop theme; right, the tree from one of FreeCAD's stylesheets.
FC017_Model_tree_std_vs_custom.png (69.79 KiB) Viewed 289 times
User avatar
NormandC
Posts: 16801
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Python 3/Qt 5 package uploaded to daily PPA

Postby NormandC » Sun Aug 19, 2018 5:14 pm

triplus wrote:
Sun Aug 19, 2018 3:11 pm
This is related to QGtkStyle being removed from Qt5.7+.
More info: https://lists.debian.org/debian-qt-kde/ ... 00219.html
looo
Posts: 2003
Joined: Mon Nov 11, 2013 5:29 pm

Re: Python 3/Qt 5 package uploaded to daily PPA

Postby looo » Sun Aug 19, 2018 10:33 pm

wmayer wrote:A possibility might be pivy's sogui. At least in the past it tried to load sip and PyQt when working with soqt.
The py3-compatible pivy uses PySide2 instead of PyQt. I don't think this is the problem here.
triplus
Posts: 7321
Joined: Mon Dec 12, 2011 4:45 pm

Re: Python 3/Qt 5 package uploaded to daily PPA

Postby triplus » Mon Aug 20, 2018 10:16 pm

NormandC wrote:
Sun Aug 19, 2018 4:53 pm
Thanks. Applied it, and it works.
You're welcome.
The problem is that I wanted only to style a very specific part of FreeCAD's GUI, the Model tree, and keep everything else as per the desktop theme. But only copying that part of one of the existing stylesheet shot the whole FreeCAD GUI to hell. I had to painstakingly go through a lot of the original stylesheet and copy more of it and modify it to my needs, and yet I was left with some glitches (a much wider About FreeCAD dialog). Years ago I dabbled a little with .css sheets for websites, and they only override display of the elements they specify. I wish it would work the same for Qt stylesheets.
Kudos to @pablogil (quickly tested on FreeCAD 0.18 and it seems to work OK):

Code: Select all

/*==================================================================================================
Branch system for QTreeViews
==================================================================================================*/
QTreeView::branch  {
    background: transparent;
}

QTreeView::branch:has-siblings:!adjoins-item  {
    border-image: url(qss:images_dark-light/branch_vline_dark.svg) 0;
}

QTreeView::branch:has-siblings:adjoins-item  {
    border-image: url(qss:images_dark-light/branch_more_dark.svg) 0;
}

QTreeView::branch:!has-children:!has-siblings:adjoins-item  {
    border-image: url(qss:images_dark-light/branch_end_dark.svg) 0;
}

QTreeView::branch:closed:has-children:has-siblings  {
    border-image: url(qss:images_dark-light/branch_more_closed_dark.svg) 0;
}

QTreeView::branch:has-children:!has-siblings:closed  {
    border-image: url(qss:images_dark-light/branch_end_closed_dark.svg) 0;
}

QTreeView::branch:open:has-children:has-siblings  {
    border-image: url(qss:images_dark-light/branch_more_open_dark.svg) 0;
}

QTreeView::branch:open:has-children:!has-siblings  {
    border-image: url(qss:images_dark-light/branch_end_open_dark.svg) 0;
}
P.S. Don't forget to download (and provide in/at the appropriate folder/path) corresponding images.
User avatar
NormandC
Posts: 16801
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Python 3/Qt 5 package uploaded to daily PPA

Postby NormandC » Wed Sep 19, 2018 3:30 am

Belatedly returning to this topic...

triplus wrote:
Mon Aug 20, 2018 10:16 pm
Kudos to @pablogil (quickly tested on FreeCAD 0.18 and it seems to work OK):
Thanks for bringing to my attention that changes were made to stylesheets between v0.17 and v0.18. Images were switched from png to svg, I still had the png ones. Other changes were made. I think it may be the reason for my trouble.

But, this changes nothing to my theming issue. As I wrote, as soon as I set this stylesheet that should only modify the appearance of the Document tree, other GUI elements are affected, notably the Tasks tab and the About FreeCAD dialog.


Default:
FC_Tasks_PartDesign_default_Ubuntu_01.png
FC_Tasks_PartDesign_default_Ubuntu_01.png (10.78 KiB) Viewed 104 times
After use of limited custom stylesheet:
FC_Tasks_PartDesign_custom_stylesheet_01.png
FC_Tasks_PartDesign_custom_stylesheet_01.png (10.25 KiB) Viewed 104 times
About FreeCAD default:
FC_About_FreeCAD_default_01.png
FC_About_FreeCAD_default_01.png (195.9 KiB) Viewed 104 times
With custom stylesheet:
FC_About_FreeCAD_custom_stylesheet_01.png
FC_About_FreeCAD_custom_stylesheet_01.png (210.9 KiB) Viewed 104 times

So I end up having to style back these GUI elements as well, trying my best to get something as near default theme.
triplus
Posts: 7321
Joined: Mon Dec 12, 2011 4:45 pm

Re: Python 3/Qt 5 package uploaded to daily PPA

Postby triplus » Fri Sep 21, 2018 1:20 am

Tasks panel uses QSint based widget and some styling is applied by default. Likely here for Linux:

https://github.com/FreeCAD/FreeCAD/blob ... scheme.cpp

What likely happens is when you set a custom stylesheet such styling gets removed. And therefore indeed the custom stylesheet needs to provide the styling for it. ATM i don't have more time to extract the stylesheet from code and test the theory. And provide it as a snippet to be included in your custom stylesheet. If that is desired i can take a look in about 3 days time.

P.S. As for the FreeCAD Info dialog. The size is bigger then usual? Maybe FreeCAD is trying to tell you look this is what happens if you put too much emphasis to this area. No pun intended.
oddtopus
Posts: 87
Joined: Tue Sep 20, 2016 6:17 pm

Re: Python 3/Qt 5 package uploaded to daily PPA

Postby oddtopus » Sat Sep 22, 2018 1:44 pm

Hi Kurt,
today I installed freecad-python3 on a Mint19-64bit system to find out the necessary to upgrade flamingo w.b. to Py3 and Qt5.
From the addon-manager I downloaded the workbench, then exit.
After I reopen FC I don't see "flamingo" in the wb list: not in the combo on the toolbar and neither in the list of "Preferences"->"Environments".
Despite that the addon-manager had actually downloaded the files in /home/myHome/.FreeCAD/Mod/flamingo.
What could it be?
Does this package lookup for the installed addons in a different folder?