Relative Content

Tag Archive for c++qt

Ctrl+Left mouse click event capture Qt

How can one get Ctrl+Left mouse click event in Qt widget. I am able to get key event from QObject::keyPressEvent() and mouse click from QObject::mousePressEvent(). But I need to capture both in the same function. Can someone give some pointer to right direction. Thanks.

QtMsBuild -> Qt::BuildLock

We have a fairly large solution (>200 projects) and recently switched to VS2019. We are using Qt 5.14 with Qt Visual Studio Tools 2.7.1.18 and QtMsBuild. After we started using VS 2019 we get the following warning multiple times when we build the solution:

Using qvector in q_property and accesing each data

I would like to update weekKm and weekTime to update automatically when I change any value in m_weekKmAndTime, but I am struggling with that. I would like to acces it just like DbModel.weekKm(0) and have value, not struggle with vars in qml and trying to get value there.

Why doesn’t changing the parent object’s properties in Qt affect the same-named properties of its child objects?

QWidget *widget; QLineEdit *text; widget->addWidget(text); widget->setEnabled(false); qDebug()<<widget->isEnabled(); // false qDebug()<<text->isEnabled(); //true In a QWidget, there are multiple child widgets, including QLabel and QTextEdit. Now I want to change the style in QSS based on the QWidget’s enabled value. For example: QTextEdit:enabled { background-color: lime; } QTextEdit:disabled { background-color: red; } However, this approach doesn’t seem […]

Does embedding Qt resources affect RAM consumption?

I’m working on a Qt application where I’m embedding all resources by default into the binariy files using the Qt Resource System. I understand that this approach can simplify distribution by bundling resources with the executable. However, I’m concerned about its impact on RAM consumption at runtime.