My Qt 4.8 application runs on a Windows 7 touch screen. I'm not using the QTouchEvent capabilities. In this case and following the documentation, touch events should appear as normal mouse events. Unfortunately, this is not the case for all widgets.
The tabs of QTabWidgets can't be switch by touching them. It works via keyboard inputs. Other widgets work as the should (QPushButton, QLineEdit), interpreting the touch as mouse event.
The widgets are created using the Designer.
Despite the answer might not, my question is simple:
How can this happen, resp. how to fix this?
Thank's in advance...
Update:
Just figured out that it seems to be a compiler issue. Compiling With msvc2010 SP1 under Windows 8 causes the problem.
Compiling using WinXP and mingw results in a correct behavior.
Unfortunately, I would like to use MS Speech SDK, so I need Win7+ and msvc...
Update 2:
It's getting worse: Using a normal mouse everything reacts as aspected. But touching the screen is ignored. At least on the top half of the screen.
To be even more confusing: Using Qt 4.8 classic widgets does not react (QPushButtin, QLineEdit) but links in a QWebView react. Using Qt 5 it's vice versa.
You can find the application on source forge: httpplayer
http://sourceforge.net/projects/httpplayer/
Related
I have some legacy code made with Borland C++ Builder 6 that I have to port from Windows XP embedded to Windows 10 IoT.
It all seems to run properly, except dialog forms which aren't drawn properly. When I call ShowModal on the forms to show them, they flash quickly and then seems to disappear. However they are not gone, instead they are just not drawn and the form behind the dialog is seen. The dialog form buttons can still be pressed (if we know where they are).
I have tried all possible redrawing, refresh, repaint and update functions I could find, but nothing seems to work.
To make matters worse, dialogs containing actual control elements (like one containing a set of TSpeedButton elements) the controls are redrawn when moving the mouse over them, but anything else are not redrawn.
I have tried to search for similar issues but can't find anything for this.
Could this be solved? Or do we have to update to a newer Embarcadero version of the IDE to be able to solve it (which is a lot or work and not really something we can do at the moment)?
The problem was the use of a Billenium Software (now defunct) package for "fancy" transitions.
The transition in question "zooms" a dialog open, and it just doesn't seem to work. Disabling this transition will solve the problem of the disappearing dialogs.
I still don't know if it's a problem with the components Windows 10 compatibility, or with its 64-bit system compatibility.
I want to save the focused window's title, i made this part but i dont know is there any QEvent which catches all (non-application) focusChanged event? Like switching from Chrome to Qt Creator. I made an alternative solution that checks in every second if the topmost window title has changed but this is so rude. I need cross-platform solution if possible.
EDIT
I am using QT 5.9.0
Quick answer:
Qt only has focus events for it's own windows and widgets. See http://doc.qt.io/qt-5/qfocusevent.html#details for start point.
There is no event for focus in other applications.
Details:
For multi-platform solution is needed to have more general point of view. On some (X window) systems where keyboard focus is in window under mouse. But that window becomes topmost only after click. On Mobile platforms there is only one active application. And application is not allowed seeing when other applications are activated. So in my understanding there is no full multi-platform solution.
Windows only extensions are in the Qt Windows Extras. http://doc.qt.io/qt-5/qtwinextras-overview.html. But there is nothing focus change related unfortunately.
I have a UI written in Qt that makes extensive use of dock widgets, primarily so that end users can customize which which docks are available, and how they are arranged.
We recently upgraded to Qt 5.6.1, and the dock widgets can no longer be rearranged on Ubuntu, although they still work on windows and other OS's. When you try to move the docks, the rubber band still appears as usual showing the new location, but when dropped the dock just snaps back into whichever position it started in, which is always tabbed somehow.
After several hours of searching, I think the problem is related to QTBUG-54185, and I'm wondering if there is any way to work around the bug while we wait for the Qt 5.6.2 release which fixes it.
The bug is related to having the AnimatedDocks property disabled. QDockWidget rearranging still works, even in spite of the bug, for dock widgets which are animated.
The problem was that in the code, the main window was setting the dock options manually as
mainWindow->setDockOptions(AllowTabbedDocks);
Since DockOptions are OR'd, what is happening here is that the AnimatedDocks property, which is enabled by default, is being unintentionally disabled. The solution for me was to delete the offending line, since the default options are AllowedTabbedDocks|AnimatedDocks, which is actually what I wanted all along.
still relatively new to Qt (and to stackoverflow as well) but succeeded over the last weeks to replace our old obsolete-when-new GUI code with Qt and improve several things along the way as well. Now however I am running into a problem I so far have not been able to google my way out of.
Some background:
Application has an opengl main window which is created outside Qt (most of this application is completely outside Qt), Qt windows are only used for (development) subfunctionality, just GUI.
I am calling processEvents() from the main loop each frame.
Using locally built Qt 4.7.4 on both platforms.
Everything works fine on linux. The Qt windows behave properly and I can interact with the application/simulation in the main opengl window through mouse and keyboard just as was always possible.
However, when I applied the same changes to incorporate Qt on windows the mouse no longer works in the main window. Keyboard does, but our mouse code never seems to get any WM_INPUT events. When I disable calling processEvents() the mouse works fine again. (but then obviously the Qt windows won’t work properly)
It seems Qt is catching mouse events intended for the main window and throwing them away/forgetting them instead of delivering them to the main window.
Unfortunately I haven’t found anything that points to this being a common occurrence (with a common simple solution).
I did find http://qt-project.org/forums/viewthread/502 referencing an issue with mouse events but the resolution mentioned there of compiling Qt with _WIN32_WINNT=0×501 defined does not make any difference.
Any insights would be highly appreciated!
I noticed that the sample apps from QT show their menu bar as opaque, and with a color that doesn't match any of the styling on the window. It seems as if the windows being created by QT when running on Vista or Windows 7 don't pick up the translucency that are no the mainstay of the new Windows look and feel. Is there a way to override this in QT, or even have a custom painted menu?
On Windows 7 there is a special flag that activates the "Glass" Look&Feel:
Here is some more detailed information:
http://labs.trolltech.com/blogs/2009/09/15/using-blur-behind-on-windows/
Screenshot http://labs.trolltech.com/blogs/wp-content/uploads/2009/09/blurbehind2.png
From what I see, only the Qt::WA_TranslucentBackground flag is involved.
All of my Qt applications look native on Vista/Win7, including the "glass" frame. This is all by default.
I must admit I don't know where you got this idea that they don't. Here's what the Browser demo that comes with Qt looks like on my Win7 machine.
alt text http://img28.imageshack.us/img28/5535/qtacrossplatformapplica.png
I can't see anything wrong with it.