Questions tagged [qobject]

QObject is a Qt class which serves as a base class for all Qt objects.

QObject is the center of Qt object model. QObjects are organized as trees, where one objects can become parents to others, taking ownership for them, and being responsible for freeing heir children's resources on deletion.

Each QObject has a name, which can be accessed. It also provides a way to search in, or to iterate through it's children. Objects can also receive and filter events.

When deriving a class from QObject, one must remember to include a special Q_OBJECT macro in a private section of the class, which is a mandatory for every class that uses signals and slots, or any other features of Qt's meta-object system.

A QObject instance is said to have a thread affinity, or that it lives in a certain thread. When a QObject receives a queued signal or a posted event, the slot or event handler will run in the thread that the object lives in.

Official documentation of QObject can be found here.

410 questions
-1
votes
1 answer

How can I make a QMap object emit a signal when `QMap::insert(...)` is called?

Pretty straightforward question. QMap does not inherit QObject, so I'd like to know if there is an easy Qt Way of making it emit mySignal(MyEnum state). If you are asking why I do not just emit a signal in my code when I call the function…
Anon
  • 2,267
  • 3
  • 34
  • 51
-1
votes
1 answer

How to create a Global image using QML?

Currently developing a QML project with a set of images, I am currently using the function: function imageDeselection() { imageSelect.visible = false imageInitial.visible =…
-1
votes
1 answer

QFileDialog - need correct

I'm new to "C++ with Qt" programming, so I need help. #include #include #include #include #include #include #include #include #include…
newfag
  • 19
  • 4
-1
votes
2 answers

assignment of two QObject

i have two class names "mamad" and "student" and both of them are inherit from my class "Base" that "Base" inherit from QObject in Student Class i have a field : "subject" that is a mamad and i have a function (setsubject) that take a newsubject…
Erfan Tavakoli
  • 336
  • 1
  • 6
  • 14
-2
votes
1 answer

Qt (4.8) simplest way to call slot with AutoConnection behavior

I have something like this: class Thing : public QObject { ... public slots: void doSomething (); ... }; I then have an object that manages Things, like this: class ManyThings : public QObject { ... public: void…
Jason C
  • 38,729
  • 14
  • 126
  • 182
1 2 3
27
28