Questions tagged [qt-connection]
23 questions
35
votes
3 answers
My signal / slot connection does not work
I repeatedly see people having problems with slots not being called. I would like to collect some of the most common reasons. So maybe I can help people and avoid a lot of redundant questions.
What are reasons for signal / slot connections not…

Silicomancer
- 8,604
- 10
- 63
- 130
9
votes
1 answer
use of undeclared identifier 'connect'
I'm trying to write a simple downloader in qt. It's based on this example: http://www.ggkf.com/qt/qnetworkrequest-to-download-an-image
downloader.cpp:
void Downloader::GetImage( QString _url, QNetworkAccessManager *qnam ) {
connect( qnam,…

btzs
- 1,048
- 3
- 14
- 17
3
votes
1 answer
Qt Subclassing and "No matching function for call to connect"
I am trying to encapsulate table view behavior and I am starting with connecting the table view header signals to table view slots defined in the subclass. I can get the behavior I'm looking for without subclassing, but that defeats the purpose.…

Jason deMello
- 35
- 1
- 7
2
votes
2 answers
How does Qt::DirectConnection act when used in multi-threaded environment?
Though Qt::QueuedConnection or Qt::AutoConnection (in certain cases) are preferred in a multithreaded environment, I am asking this question for my understanding purpose.
If signal MySignal() is emitted in thread A & slot MySlot() belongs to object…

iammilind
- 68,093
- 33
- 169
- 336
1
vote
1 answer
How to call defined slots from keypress event in qt / How to connect keypressed event with QPushbutton on gui?
I am beginner to qt. I was working on calculator gui application, I have already defined slots like numPressed() when any of the number pushbutton is pressed on the calculator that will be displayed on the lineEdit.
void Calculator::numPressed(){
…

Karthikgr
- 81
- 13
1
vote
1 answer
How to pass a std::function or a function pointer into qtconnect?
This is mainly to clean up a bunch of code from my constructor. I have around 20+ lines of connect(object, func1, this, func2) in the constructor alone and I am trying to clean up the code by having a…

Sailanarmo
- 1,139
- 15
- 41
1
vote
1 answer
QT connect no matching function to call to
I know there are already some threads for this question but I think I made none of the mistakes others did which led to the problem. So here is my code:
#include "consolerender.h"
consoleRender::consoleRender(QObject *parent) :
QObject(parent)…

ShivaDef
- 13
- 3
1
vote
2 answers
Qt - modify slot's parameter of previous connected signal using lambda function
I'm trying to reconnect a signal to the same slot but with a different parameter. This would work if I just wanted to reconnect the same signal to a diferent slot without using parameters or lambda functions but I need to do it this way.
At first I…

RubenC
- 496
- 1
- 5
- 15
1
vote
2 answers
c++ qt QObject:: connect: No such slot
I have defined my slot like this:
void choixPoints:: prendpixel1(Pixel depart)
{
//...
}
and I want to execute the following sentence:
Pixel depart= picmou->define(); //definition of a pixel, well defined
connect(chp3, SIGNAL(clicked()), this,…

user2269556
- 143
- 2
- 2
- 11
0
votes
1 answer
My QT connect works from parent to child, but not vice versa
I am making a QT application. I have a MainWindow1 class and a FirstTab class. The MainWindow1 class is a QMainWindow and inside I created this signal ->
mainwindow1.h
signals:
void loadDateSig(QString strDate);
And in FirstTab I created this…

Xenomorphing
- 3
- 2
0
votes
2 answers
Can't use Qt::UniqueConnection in Qt Connect
I have a connect statement that compiles fine, with the connection type QueuedConnection. Once I OR it with UniqueConnection, it refuses to compile. I had to re-cast it back to Qt::ConnectionType for it to run. Is this normal/expected…

TSG
- 4,242
- 9
- 61
- 121
0
votes
3 answers
How to connect two QComboBox so that the second shows only certain items?
I have two QComboBoxes to connect with each other.
In particular, I'd like that if a scaling is made in the first QComboBox, this is not also shown in the second QComboBox and vice versa.
This is my code:
auto lingua_originaleT = new…

Gretaas
- 31
- 5
0
votes
1 answer
I cannot use the pointer from QMainWindow as argument in connect for QT5
This code creates a thread and connect it to MainWindow in QT.
void UI_handling::create_thread_for_looping_terminal(){
loop_terminal_thread = new Loop_terminal_thread(mainWindow, &j1939);
loop_terminal_thread->start();
…

euraad
- 2,467
- 5
- 30
- 51
0
votes
2 answers
Qt | C++ connect not being triggered
I'm trying to play with basic signal/slot in C++.
Here is my Network-Manager, which will trigger the event:
class NetworkManager : public QObject {
Q_OBJECT
public:
explicit NetworkManager(QApplication* application);
void…

Maifee Ul Asad
- 3,992
- 6
- 38
- 86
0
votes
1 answer
Problem with connecting QLabel to QSlider
I have a problem. I've created a class, in which I have a slider and a label. I want to connect these with the QObject::connect, but when I do it, nothing happens. Can you tell me what am I doing wrong?
My class:
class Loads :public QObject
{
…

donefun
- 51
- 5