Questions tagged [slot]

slot is a method callback used to handle a signal in some gui frameworks like QT

slot is a method callback used to handle a signal in some gui frameworks like QT - see for instance: http://doc.qt.io/qt-4.8/signalsandslots.html

445 questions
3
votes
1 answer

Why main event loop gets frozen if private slot is called from background thread?

I'm developing GUI application using python and PySide. I need to run long backgroung task in a separate thread. For threading I decided to use QThread according to the 'correct' approach without subclassing from if (see…
Roman
  • 515
  • 5
  • 16
3
votes
1 answer

Qt connect without SLOT macro

Let's say I have a string containing "function()", where function() is a slot in a class, and I would like to connect that slot with any signal, but using that string. Neither QString f="function()"; connect (randomobject, SIGNAL(randomsignal()),…
rndm
  • 137
  • 1
  • 9
3
votes
1 answer

Qt Signal from QRunnable not received/not connecting

I'm writing a Qt Application in C++. I have a QRunnable running in a QThreadPool, and it sends a signal to the main thread. The problem is, the connection doesn't work: the signal is never received by the main thread, even though I've verified that…
Karl Arsenault
  • 147
  • 1
  • 1
  • 9
3
votes
3 answers

How to make a function to be a slot temporally in Qt?

To make a function of a class to be a slot, the class has to inherit from QObject. However, QObject takes up a quite large amount of memory. I am not sure how much it is and if the memory is for each class or each object. My code has many small data…
user1899020
  • 13,167
  • 21
  • 79
  • 154
3
votes
3 answers

Qt::QueuedConnection invoke at most once per event loop iteration

Consider the following situation: class Foo : public QObject { Q_OBJECT public: void set_A(int a) { emit updated(this); } void set_B(int b) { emit updated(this); } signals: void updated(Foo*); } Foo f; connect(&f,…
qdot
  • 6,195
  • 5
  • 44
  • 95
3
votes
1 answer

Qt Signal and slot

i have two functions and one of them call the other one. I want to use one of them as a slot to the signal clicked() in a pushbutton so here's part of my planevolume.h code so you can understand: #ifndef PLANEVOLUME_H #define PLANEVOLUME_H #include…
SamuelNLP
  • 4,038
  • 9
  • 59
  • 102
2
votes
1 answer

How to dynamically load datatypes during runtime through a plugin mechanism

Since Qt doesnt allow templates in their slots, I tried to do the following solution without success. First a would like to create a list like this: list commands = 0, "MyDashboard", DashBoard0 1, "MomsDashboard", Dashboard1 Dashboard 0 and 1 are…
chikuba
  • 4,229
  • 6
  • 43
  • 75
2
votes
1 answer

Can I modify a public function in base class to public slots in derived class in Qt?

I'm using Qt now. I've written a C++ class A and there are some public functions in it. And now, I'm writing a Qt class B which has multiple inheritences from both QObject and A. And I want to change one public function in A to public slots in B.…
Rubbish_Oh
  • 155
  • 1
  • 7
2
votes
1 answer

How to handle slots in Vue3 & Storybook 7

I am trying to pass in a component (UIButton) as a slot in another component (UICard) in ButtonAsSlot story. In the ButtonAsSlot story, I am passing default: '
user16589580
  • 103
  • 8
2
votes
2 answers

best alternative for in