Questions tagged [signals-slots]

Signals and slots is a mechanism for implementing the observer pattern.

Signals and slots is a mechanism for implementing the observer pattern. It has many implementations in various languages:

See also:

1653 questions
0
votes
2 answers

Connect slots QAction dynamically to a function

I want to add some QAction dynamically from settings file : _settings.beginGroup("openRecent"); QStringList recentList = _settings.childKeys(); foreach(QString recentFile, recentList) { QAction * action = new QAction(_settings.value(recentFile,…
Thomas Ayoub
  • 29,063
  • 15
  • 95
  • 142
0
votes
1 answer

unable to bind a signal to a slot in QT

I just started with QT and I know the concept of signal/slot but in implementing it I have problem. take a look at my code : #include "test.h" #include test::test() { // TODO Auto-generated constructor…
Vahid Hashemi
  • 5,182
  • 10
  • 58
  • 88
0
votes
1 answer

Where to declare object returned from Qt SIGNAL/SLOT?

I've got a FTP application written in c++. Now I'm adding a simple GUI to my project via the Qt plugin for VS2010. The mechanism to connect to the server is very simple. After typing both IP and PORT the connection is stablished and an object is…
karl71
  • 1,082
  • 2
  • 18
  • 29
0
votes
1 answer

PySide: How Could I trigger the current clicked QPushbutton, not other later added

I am new to PySide. In my program, I encountered a problem that when I click one button, it triggers other button later added. Thanks! self.addContentButton = QtGui.QPushButton('Add') …
tao4yu
  • 316
  • 1
  • 5
  • 16
0
votes
1 answer

Connect listwidgetitem clicked to customwidget pushbutton

I am using a QProcess to scan the available bluetooth devices. The QProcess uses command line commands like hcitool scan to check for available devices. The output is parsed using regular expressions and I have cells(equal to number of devices…
gfernandes
  • 1,156
  • 3
  • 12
  • 29
0
votes
2 answers

Slot of inherited class not recognized

I'm trying to implement a custom class of QTcpSocket but it seems that my slots are not recognized at run time I always get: Object::connect: No such slot QTcpSocket::timeoutSlot() Here is my code: my header: #ifndef CUSTOM_SOCKET_H #define…
rednaks
  • 1,982
  • 1
  • 17
  • 23
0
votes
3 answers

Qt Signals and slots mechanism blocked by a loop in main

I have a following situatuion. 2 Socket objects are created in the main in a for loop (the original problem has 1000 objects). Upon creation the start() method is invoked. start() creates a QTcpSocket which tries to connect to some host. Socket has…
TheMeaningfulEngineer
  • 15,679
  • 27
  • 85
  • 143
0
votes
2 answers

why a connection's signal have argument but slot doesn't have one?

Qt 4.8.1,The original code just like this: connect(this->m_CodeMemoryComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(updateCodeMemoryFormate())); This really confuse me,[question]Can I pass an argument to the slot function when…
Zhang LongQI
  • 494
  • 1
  • 11
  • 25
0
votes
0 answers

Efficiently managing large number of boost signals in class

I have a class containing a large number (~100 or more) signals with varying signatures: class MyClass { public: boost::signals2::signal& Signal1(); boost::signals2::signal& Signal2(); …
cdoubleplusgood
  • 1,309
  • 1
  • 11
  • 12
0
votes
2 answers

Qt Architecture Advice Needed

iI have a Qt application using QGLWidget for drawing (simply a Viewport for 3D drawing etc...) There is two main classes in the application. MainWindow Inherits from QWidget which holds many GUI widgets (menubar, toolbars, viewport,…
0
votes
1 answer

how i find out uset check and unchecked checkboxes?

My program have a set of checkbox, When user check a checkbox, i should call slot1() and user uncheck checkbox, i should call slot2(),But i can't understand when user checks and when unchecked. My questions is, How can i find out user check and…
PersianGulf
  • 2,845
  • 6
  • 47
  • 67
0
votes
3 answers

Qt tells me that my SLOT doesnt exist, but with a make clean, make it doesnt complain anymore

when i download a fresh copy from our SVN, make then run my program, Qt tells me that one of my SLOTS doesn't work but with a handy-dandy make clean then make, it seems to solve the problem. i continue to make changes in the code on my PC and that…
TheFuzz
  • 2,607
  • 6
  • 29
  • 48
0
votes
2 answers

Simple digital clock by using Qt and QThread

I want to create a program by using Qt framework. The aim is to write a program which uses QThread to show a simple digital clock. but nothing happened when running. This is the subclass of Qthread for running paytamtimers.h #ifndef…
paytam
  • 327
  • 6
  • 15
0
votes
2 answers

How to know the slot connected to specific qobject&signal?

Is it possible, given an object derived from qobject and a specific signal, to dynamically know the slot connected to that signal?
Guido Ranzuglia
  • 371
  • 2
  • 13
0
votes
3 answers

Is it safe to call a signal function of a widget class in Qt from multiple threads in C++?

Is it safe to call widget's signal function from multiple threads simultaneously? Will Qt use some kind of internal mutex to provide security of its own data structures when multiple threads call some widget's signal simultaneously? As i understand,…
pavelkolodin
  • 2,859
  • 3
  • 31
  • 74
1 2 3
99
100