Pyside fail to show tooltip and specific events in Linux - python-2.7

I wrote a PySide application that should run on python2.7, on window,Linux and Docker container. The application contains Qtooltip and specific eventFilter that catches HoverEnter\HoverLeave.
The application works well on windows 10 and ubuntu 14.04 desktop but when trying to run it inside Ubuntu 14.04 container both features didn't work well:
The tooltip - It would seem that the text is covered by other tooltip text or totally black.
The eventFilter - The application can't get the hover event (didn't appear).
The main difference that I saw was that when running on Ubuntu desktop, some GTk libraries are loaded to the python process (according to the maps files).
I tried reproduce the problem by installing everything on Ubuntu server (without Gtk), and got the same effect as inside the container.
Even after installing Gtk on the server, still no change.
I think that I might have missed some dependencies, but can't find any documentation on the issue.
Thanks in advance,

Ok, after several days of trying figure that this is what was needed:
For the tooltip problem:
Adding WA_AlwaysShowToolTips
Change the stylesheet show that the transparent feature will work only for the QPushButton background and not the entire widget.
For the event problem:
Add the attribute: WA_Hover
Everything worked as should be after that

Related

Wrong coordinates in a Qt Application

I created a Qt Application with Qt Creator 3.3.1, using Qt embedded 4.8.6 for a Cortex A5.
It runs on a board with Linux embedded and a touchscreen.
The filesystem was created with Buildroot 2015.08.
I'm using a resistive touchscreen calibrated with ts_calibrate.
The Qt Application works, but I often get the wrong coordinates. For example, when I push on a button, sometimes the program takes the coordinates related to another point of the touchscreen, giving the idea that the button pushed doesn't work properly.
My Qt enviroment variable are:
export TSLIB_CALIBFILE='/etc/pointercal'
export TSLIB_CONFFILE='/etc/ts.conf'
export TSLIB_PLUGINDIR='/usr/lib/ts'
export TSLIB_TSDEVICE=`cat /etc/ts.dev 2>/dev/null`
export QWS_DISPLAY=LinuxFB:mmWidth=800:mmHeight=480
export QWS_MOUSE_PROTO=Tslib:/dev/input/event0
If I try to use another Qt Application (for example the Qt demos created with Buildroot) I get the same problem.
Is it a bug of Qt 4.8.6 or something?
Can anyone help me? Thank you
Sounds like playing with your activated filters or their parameters in ts.conf might help.
Since you asked your question, there is tslib 1.2 and (if you need multitouch) tslib 1.3-rc3, both with new and improved filters, see tslib's project page

xdotool cannot find Qt application window, where wmctrl can

I want to detect a Qt5 QWidgets application from its
window title using xdotool to test the GUI under GNU/Windows with the latest Xubuntu LTS distro.
When I create any minimal Qt application, with wmctrl -l I can detect it,
with xdotool it cannot be found, as shown here:
(note that searching for Enter s also fails)
Does anybody have a good experience with using xdotool on Qt QWidget applications,
without using tricks like grepping through the wmctrl scripts?
AFAIKS, I am not the only
one that has problems with this combination.
Sadly, I do not know which update caused this, but one day after the question, suddenly everything works as expected:
xdotool can detect Qt windows with spaces in its name as expected.

How can I get the figures from matplotlib on top of the windows with spyder?

I am using spyder with python to plot some images with matplotlib. When I generate a figure it is not showed on top of the windows, but hidden.
How can I get the figures on top?
I have this problem in Windows and Linux.
This is the code:
plt.figure(0)
plt.imshow(img)
Thanks for your help !
I had the same problem, with Spyder 3.3.2, (python 3.7) and QT5 backend.
The answer in this older query says you may use a trick with TkAgg backend. (at least, the trick does not work with my QT5 backend)
So I switched the backend in Spyder preferences (Tools==> Preferences ==> Ipython ==> Graphis ==> backend).
and now, my windows already comes on top without any other tricks...
Unfortunately there is no way to do what you're asking for because Matplotlib doesn't have the functionality to make it possible. See this issue for more details.
This has been bugging me for a while and I've discovered an answer in an older query
Basically, make window "always on top", then undo that so that other windows can then come on top again.
Code to add after your plot:
#Put figure window on top of all other windows
fig.canvas.manager.window.attributes('-topmost', 1)
#After placing figure window on top, allow other windows to be on top of it later
fig.canvas.manager.window.attributes('-topmost', 0)
I met the same problem yesterday. but I found that if you open the Ipython qtconsole at the same time, the figure window will turn out

Error executing cross-compiled codes in raspberry pi

I am having problems with a Qt GUI application I created. Basically I created the application in my ubuntu to check if it compiles and works properly, however, if I set up the cross compiler (followed a tutorial and tried a hello world which works properly) and execute my code in the pi the UI does not display properly and basically I cant do anything:
· Text disappears from buttons
· Mouse disappears from screen (therefore cant click buttons)
· Cant navigate buttons using tab key
Any clues? maybe I cant use .ui files in the pi and have to use qml? Thank you in advance.
2 Screenshots of what I get with the pi and what the program should actually look like (ignore the second LCD display):
what I get http://imageshack.us/a/img17/9986/img20130508093318.jpg
I’ve been told that Qt5 has different rendering platforms, the standard for my compiled version is “eglfs”, which is fullscreen EGL accelerated mobile application style. I need to run it another platform for example xcb or x11 with the command “./myprogram -platform xcb”. Unfortunatelly i only have the following platform options and none of them work: eglfs,linuxfb,minimal,minimalegl,offscreen. I dont now how to install these, i’ll google it see if i can find anything.
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=26590&p=321556

Qt Deployment - QGraphicsView not displaying on other machines

So I've been making a program for my company using Qt 4.8.4 (required). When deploying the project to a different machine, the program runs fine (I included Qtgui4.dll and Qtcore4.dll). However, when trying to view a print preview image using QGraphicsView, no other machine will show it. I even tried installing Qt 4.8.4 on the other machine and building it there to no avail. I use MSVC to compile and have installed Visual Studio on the new machine as well. I also include the imageformats folder when deploying the .exe to other machines.
I am at a loss here. I've researched this for days. I don't understand why it runs perfectly fine on my machine but will not run on others even when I replicate the development environment.
I have attached a picture of it actually working.
On all other machines, the preview image shows blank/white. However, I noticed that the image is built and that it will print. It just will not preview.
I know I haven't included any code but I won't be able to include much as it's for my company. But I have included what I could related to the QGraphicsView.
// Create a handle for the graphics view; fix bug where preview would disappear
// on first view; winId() creates the winId; Needed to initialize first
ui->graphicsView->winId();
/************************************/
if (preview)
preview(ui->graphicsView->winId(), &err);
No solution was found on my end. I finished the application with the stipulation that the OS could not be XP.