Categories
Mastering Development

Why QGraphicsProxyWidget does not resize properly after dropping into QGraphicsView?

I have a QListWidget and a QGraphicsView both subclassed to overwrite some of their members. I prepared a minimal verifiable example showing the problem I have. From the QListWidget I can drag and drop specific field represented by a QTableWidget and drop them into a QGraphicsView and in order to do that I am using […]

Categories
Mastering Development

Create a QObject in another thread and retrieve it to the current thread = ASSERT failure in Debug on msvc16

#include <QApplication> #include <QDebug> #include <QThread> #include <QTimer> class Thread : public QThread { public: Thread::Thread(QObject *parent = nullptr) : QThread(parent){ } std::function<void()> todo; protected: virtual void run() override{ todo(); } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); QObject mainObj; Thread thread; thread.todo = [&](){ //QObject *obj = new QObject(&mainObj); //"QObject: Cannot […]

Categories
Mastering Development

How to make a QGraphicsView background blinking in R – G – B every second

As the title says I am trying to have my QGraphicsView blinking 1 second in red, 1 second in green and 1 second in blue and after that the loop start over again. After doing a lot of research in the past couple of days I didn’t have a lot of luck as the main […]

Categories
Mastering Development

How can I send a signal from a thread to the main window

I am trying to change the UI in the main window from a thread that I have running. This thread does the calculations and then sends it to the mainwindow, but nothing is working. The specific part I don’t understand is in the main.cpp. I am note sure if that is the correct way of […]

Categories
Development

QObject::connect: Parentheses expected, signal QSerialPort::readyRead in ..\voltage_sensor\dialop.cpp:41

I am not sure why Qt is outputting this to me. The code compiles, and all the syntax is formatted correctly. I have tried looking at different forum posts, but I am unable to pinpoint the error. I am currently testing with a breadboard, circuit, and light bulb; all the hardware works and I am […]

Categories
Development

Why the texture created from the framebuffer is not mapping correctly

I am creating a custom framebuffer of size 1920 X 1080 and then mapping the texture of this frame buffer to a full screen rectangle in default frame buffer of size 800 X 600. I had drawn a rectangle in the center of the screen in the custom frame buffer and after mapping the texture […]

Categories
Development

Cannot get camera list by android NDK(camera2 api)

Trying to build an app with Qt5.12.3 and android ndk, but cannot get camera list by “ACameraManager_getCameraIdList”. Mobile : Sony xperia XA1 Ultra Qt: 5.12.3 NDK : r19c minimum target: 24 maximum target: 28 Android library link to : libcamera2ndk.so and libmediandk.so, I link to the libs of api 28, not 24(android-28\arch-arm\usr\lib) permissions: uses-permission android:name=”android.permission.CAMERA”/ […]

Categories
Development

QTextEdit ExtraSelection unable to set font weight

I am unable to set the font weight (or italic style for that matter) via an ExtraSelection in a QTextEdit. Having stolen example code for a MSCCE from Nice text formatting in QTextEdit, like Qt Creator does, I would like to ask why the font weight is not bold on this example: #include <QApplication> #include […]

Categories
C++ Development

How do I create and load lib dynamically in Qt C++

As described on https://wiki.qt.io/How_to_create_a_library_with_Qt_and_use_it_in_an_application I would like to create dll (Windows 10) and load it dynamically be using QLibrary as plugin. In Dependency Walker I see that exports and dll could be loaded. But resolve gives me always 0. I tried several examples and hinds in web, but no success. What do I wrong? .pro […]

Categories
Development

Regarding Projector Programming using QT

I am connecting the projector to Quectel QCOM application. Now I want to skip that application and create my customized application to control the projector. I wrote a program based on the guidelines of Quectel to switch off the projector. Following is the code. Even I used the QSerialPort code. But the projector couldn’t switch […]