Top "Qtcore" questions

Questions related to the QtCore module that provides core non-graphical classes used by other modules.

QString replace only first occurrence

Is there simple way of replacing only first occurrence of some substring by other substring in QString? It can be …

c++ qt qstring qtcore
How to use qSort with custom types in QList?

I have a problem with sorting a QList containing instances of a struct: class modelHeuristic { typedef struct { QString c; QString …

c++ qt sorting qtcore qlist
Difference between QObject::connect vs connect methods

I am a newbie with Qt. Most of the times Qt developers need to use signals and slots for object …

c++ qt qobject qtcore qt-signals
How can I update the value of QHash for a specific key?

I am using QHash in C++ to store some simple key and value pairs. In my case the key is …

c++ qt qtcore qhash
How to Compress Slot Calls When Using Queued Connection in Qt?

After reading some articles like this about Qt Signal-Slot communications I still have a question concerning the queued connection. If …

c++ qt qthread qtcore qt-signals
is there a method to check if a QJsonObject object contains specific attribute?

there is a QJsonObject { "a":"...", "b":"...", "c":"..." } is there a method to check if this object contains "a"?

c++ json qt qtcore qjsonobject
'QObject' is an ambiguous base of 'Recorder'

I'm trying to use QTimer, which inherits QObject, in my newly created class. However I try it I keep getting …

c++ qt qthread qtcore qobject
Qt list.clear() does it destroy the object's?

Let's say I have the following list: QList<Type*> list; list.add(new Type()); list.add(new Type()); …

c++ qt qtcore qlist
How to detect Windows shutdown or logoff in Qt

I am porting a Linux app to Windows written in Qt. The application needs to save some settings before closing. …

c++ windows qt qt-signals qtcore
From QVariant to Integer and String

The user's entered value can be both: a string or an integer. QAbstractTableModel's setData() method always gets this value as …

c++ qt pyqt qtcore qvariant