Qt6 integration of 3dconnexion spacemouse devices - qt

hope this finds you well.
I have been wondering if there are any updates regarding qt integration of the spacemouse sdk.
I found this old post https://forum.3dconnexion.com/viewtopic.php?f=19&t=4968 but all the source code files are not present anymore and I don't think I'm skilled enough to rewrite it given the information present in the forum (here's the updated link to the post https://www.codegardening.com/post/2011/2011-02-05-using-the-3dconnexion-mouse-with-a-qt-application/) and honestly it looks strange to me that Qt has not yet made any integration packages for 3d connexion devices.
I am using Visual Studio 16 on a Windows machine in a Qt6 VTK9.2 OpenCV project
I have tried the basic windows way using window handlers but I can't make it work (no input read) as soon as I pass the handler to the qMainWindow as HWND(mainWindow.winId()), while it works fine if I create a dedicated window to read the data.
Could you please give me some suggestions or point me to some resources?

Related

How to remove QOpenGLContext::swapBuffers() called without corresponding makeCurrent()

How can I stop this warning in Qt 5.4.1 in Debug/Release mode.
QOpenGLContext::swapBuffers() called without corresponding makeCurrent()
It only appears in debug mode, but release mode is fine with VS2010.
It appears in both modes (Debug & Release) with QtCreator.
I have tried so many ways to remove it but no success, searched google but couldn't find any useful info.
Plateform: Windows 8.1- VS2010- Qt_Creator Nvidia GTX 765
Thanks.
Serious answer: By filing a bug report with the Qt developers. Calling SwapBuffers on a drawable without a OpenGL context bound to it is perfectly fine. Actually SwapBuffers does not belong to the OpenGL context but to the window, so having that method placed in QGLContext is a big design failure itself.
Personal rant (in the hope some Qt devs are going to see it, eventually):
These guys (like every other toolkit developer community I got the impression) really need some summer school in how OpenGL works and what you should and should not do. I know of no toolkit that gets OpenGL context management right. If developing a toolkit wasn't such a huge amount of work I'd go "Fine, I'll develop my own GUI toolkit, with Blackjack and hookers…"
You should fix your code, instead of suppressing warning. You may show an SSCCE, if you want some hints from community.
But if you still want to suppress warnings, you need to follow Qt documentation

MvvmCross, SQLite, Store App?

I can get MvvmCross working with a Windows 8.0 Store App.
I can get SQLite working with a different Windows 8.0 Store App.
I cannot figure out how to get MvvmCross + SQLite working on a Store app.
I always get this Exception:
Failed to construct and initialize ViewModel for type Flux.Core.ViewModels.TestViewModel from locator MvxDefaultViewModelLocator - check MvxTrace for more information
I've spent the entire day searching with google, hoping to solve this myself. The KittenDb example is about as close as I've come, but there's no Store app example in there. (I got the Kitten example working no problem on Android.)
Is there any working example out there?
Thanks!
SQLite for Windows Store is a C++ component and comes in separate ARM, x86 and x64 binaries.
To install it, you need to add a Visual Studio extension - instructions in http://blogs.msdn.com/b/robertgreen/archive/2012/11/13/using-sqlite-in-windows-store-apps.aspx - and then reference that extension from your UI project.
To then link the correct platform version of the Cirrious.MvvmCross.Plugins.Sqlite.WindowsStore.dll assembly to your UI project, you further need to adapt your .csproj file with a <Choose> block a bit like the one in https://nuget.codeplex.com/discussions/446656
There is an open issue within MvvmCross to make SQLite easier to use from nuget (see https://github.com/MvvmCross/MvvmCross/issues/307) but I don't know if anyone is actively working on addressing this issue currently - currently users seem to be just putting up with challenges of different processor architectures and following the manual steps to adapt their projects.

Embedding PCL Viewer on a Qt GUI Main Window

I am trying to develop a user interface using QtCreator on a Windows 7 64-bit machine. This user interface will be deployed on a 32-bit Windows 7 machine, and will control a projector and a camera for a structured-light application. For reasons beyond my control (compatibility with camera and projector's APIs), I will use the MS VS 2010 32bit compiler for this. After a couple of weeks trying to have everything I need working together (Qt 4.8.4, QtCreator and Point Cloud Library), I am now facing a slight problem.
Is there a way that I can embed the PCL Point Cloud Viewer inside my main Qt GUI window? The problem is that when I use the PCL viewer, it brings up a separate window. I want this window to be embedded inside my main window, and I want to still be able to interact with it (rotate, pan, zoom, etc.).
As you may be able to tell from my post, I am a newbie on Qt/PCL/etc., so any example with minimal code to do this would be greatly appreciated. I have done weeks of research on this and I have not been able to find a solution, although I get the impression that a Qt Widget might be the way to go.
You can simply use PCL's PCLVisualizer, which is extensively described here, via the QVTKWidget. This is the setup I'm currently running. So you would end up doing something along the lines of the following (pseudo-)code:
In your header:
class PointCloudWidget : public QVTKWidget
{
//Whatever comes before (constructor, methods, etc.)
private:
pcl::visualization::PCLVisualizer m_visualizer;
};
And in your cpp:
PointCloudWidget::PointCloudWidget(QWidget *parent) : QVTKWidget(parent)
{
this->SetRenderWindow(m_visualizer.getRenderWindow());
}
You can then use the visualizer to achieve the same functionality as the PCL viewer has.
Look at the kind of minimal code I put here (PCL Viewer with Qt GUI minimal code).
There are some redundancies, but the code I believe is pretty straightforward.
The main idea is to put the files in the one folder and start project from CMakeLists.txt (Qt cmake wizard).
I use build directory inside project dir. (this is important, because in pclwindow.cpp I hardcoded the path to the generated file #include "build/ui_pclwindow.h"
If app builds, but crashes you'll probably need to add some dependencies (e.g. dll files on Win platform)
I hope it will give you fast and simple start!

Can I port a C++ project to QT and then use QTWebKit to create a HTML5 front end?

please bear in mind I am not a GUI programmer.
As the title says but to give a little more details:
I have a very large C++ application which I would like to upgrade the GUI for. There is an SDK that we can attach a new GUI onto and I would like to make it look as modern and fancy as possible, I have been advised to use HTML5 for this.
We build and link the project using in house bat files which I have hooked into MSDEV to save me going back to the console every time I want to build the project. I also use MSDEV to attach to the programs when they are running to debug.
Can I also do this in QT?
(I cannot download it and try as I need to have a business case for downloading new software and investigation is a hard one to get approved).
If I did this in QT, could I then use Webkit to create a HTML 5 front end or is there more work required?
What Does Qt Look Like
http://www.youtube.com/watch?v=bVQ0S-b5lDs
The demo program that comes with the Qt SDK shows off quite a bit of what you can do with the GUI programming. You can build almost anything you can imagine!
It looks native to the operating system it is running on, Windows 7, Mac OSX, Ubuntu, etc.
I believe most of the Linux KDE GUI is now done through Qt.
Running Console Applications
If you need to run things from the console, you can manage that in C++ pretty easily.
system("run_this.bat");
In Qt, if you don't need to see the console window, you can run most things as a QProcess.
There are ways to hook the stderr and see what is going on as well.
HTML 5
Something written in HTML 5 shows up in a browser, and there are a number of slick graphics and effects that can be used with it, but using the QtWebKit, will only ensure that the webpage you are rendering looks the same on every computer you run it on. Most modern browsers are becoming HTML 5 compliant, so relying on the HTML 5 out of Qt shouldn't be necessary.
W3Schools gives a pretty good introduction into what HTML 5 adds to websites:
http://www.w3schools.com/html/html5_intro.asp
Using HTML 5 or C++
Writing a web application that uses HTML 5 versus writing a Desktop application that uses a native GUI are two very different things.
Running files on a local machine is pretty sandboxed when going through a browser with HTML 5. If you are okay with running something remotely on your own server, then it shouldn't be too bad.

Adding Qt Sources to QtCreator 2.4.1

I am currently using QtCreator 2.4.1 with Qt 4.7.4 development libraries (in Ubuntu) and am trying to track down a bug which after profiling with valgrind seems to occur internally within QGraphicsView::paintEvent(…) method
To help isolate this problem I would like to step into the Qt sources. Having done some searching through both the Qt forums and stack overflow and have not being able to find a way to integrate the sources with my version of QtCreator.
I have currently tried downloading the sources via the QtSDK manager and adding a “Source Path Mapping” within Tools->Options->Debugger. I am sure that this step is where I am making a mistake as I am unable to even switch to source when viewing internal Qt header files i.e. from QGraphicsView.h
I have so far tried adding the following Source Path Mappings
Source Path=/var/tmp/qt-src
TargetPath=/home/paul/QtSDK/QtSources/4.7.4
and
Source Path=/var/tmp/qt-src
TargetPath=/home/paul/QtSDK/QtSources/4.7.4/src
Neither works.
I have also tried building Qt directly from source, adding this to my "Qt versions" list within Qt Creator and creating a new project configuration using this version. This also did not work.
Likewise I have tried adding the src folders to my gdbinit file. This also fails to work.
I am completely lost with this.
Paul
Someone asked a similar question here: Need to step into Qt sources (my IDE is Qt Creator).
Someone else asked about Valgrind errors with Qt here: Suppression files for Qt memory leaks with Valgrind
And here is a little more info about Using Valgrind with Qt Creator along with some explanation about how to read the results. Its a little dated from late 2010.
Related Suggestions
I wouldn't debug the QGraphicsView class just because of all the effort to make it work or find the problem might be for nothing... Qt is moving to using the SceneGraph as the backend for QML and the rendering engine for QGraphicsView might become obsolete.
Updating to the latest stable build of the Qt libraries may make a big difference for QGraphicsView.
If you post the valgrind error you are getting to the Qt Trolls, someone might be able to explain what is going on for you.
There are other debugging techniques besides the traditional debugger. I've been programming in Qt in Windows (without valgrind) and with a large multi-threaded application, that loads a bunch of Dll's. I've had to put some faith into the Object Tree Model clean up and work on all the new calls I put in. Most of the time I just use QDebug to find errors. Then I am also using a combination of qInstallMessageHandler() with QDebug to implement decent logging for the hard to track bugs.
See also Qt Debugging Techniques.

Resources