506 questions
0
votes
0
answers
46
views
Sending a signal from a QThread closes the program [duplicate]
Python 3.11, PyQT6 GUI app, testing on Windows 10. I have a QThread doing some background work, and I'm trying to report progress back via a custom signal:
class TheWindow(QMainWindow):
#...
...
1
vote
1
answer
332
views
Qt signals and slots: simplified connect syntax?
The Qt documentation gives the following example for connecting a signal to a slot:
QObject::connect(lineEdit, &QLineEdit::textChanged, label, &QLabel::setText);
However, the syntax is ...
0
votes
1
answer
164
views
How to send a message from a client to a server using Qt WebSockets
I am using the webclient and webserver from the Qt examples
echoclient.cpp - https://pastebin.com/z8bgfQzE
client main.cpp - https://pastebin.com/g1DtjjYa
echoserver.cpp - https://pastebin.com/...
1
vote
0
answers
92
views
A slot connected to QCombox::currentIndexChanged signal does not get triggered
Qt version: 5.6.
connect(ui.m_projectList, SIGNAL(currentlndexChanged(const QString&)), this, SLOT(OnProjectListChange(const QString&)));
void RunTestUI::OnProjectListChange(const QString&...
-2
votes
2
answers
130
views
Send signal from QSlider to QLineEdit slot [duplicate]
I have a horizontal slider, and I want a line edit updated when the slider value is changed.
I wrote this, but nothing happens:
connect(ui->horizontalSlider1, SIGNAL(&QSlider::valueChanged), ui-...
-1
votes
1
answer
69
views
connect function fails because the signal cannot find the object [closed]
When calling QObject::connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type = Qt::AutoConnection), I get the error "cannot call a ...
0
votes
1
answer
60
views
How may I call a GUI function from an external thread on QT Creator?
I read some topics, and now I know I have to use Signals and Slots, but I'm having some trouble doing it.
At my user interface I have a Q List Widget and I need to add items to it from another thread; ...
1
vote
1
answer
117
views
Coupling slider and dial widgets in PyQt5. Solving inconsistent results
I am working on a small widget. It has a dial and a slider and both modify the same number, although I want the slider to have a higher changing rate than the dial. Think of it as the dial being the ...
0
votes
0
answers
92
views
Qt3D signal not sent or not caught
Based on the official example given in Qt, I try to catch keys inputs using Qt3DInput::QKeyboardHandler.
So after the following piece of code:
Qt3DCore::QTransform *sphereTransform = new Qt3DCore::...
0
votes
1
answer
85
views
Why is clicking a QPushButton causing the program to crash?
I've attached a code snippet to a C++ program I am working on Qt Creator. The goal of this snippet is to provide the user with a means to enter a custom temperature value and then save this value.
//...
-1
votes
1
answer
34
views
Why does the same signal need to be connected to the main circuit slot method to be triggerable?
I have two threads, a main thread and a sub-thread, and a signal in the main thread that's connected to the slot method in the main thread and the sub-thread respectively.
I emit this signal in the ...
1
vote
0
answers
46
views
Communication via Signals between two seperate classes
I am currently working on a Project in which I have to process data from measurements.
This data will be stored in a list, that I emit as a Signal using pyqtSignal. This List is emited constantly in a ...
0
votes
3
answers
602
views
How to get the text of dynamically added QPushButton when clicked
I have added a set of pushbuttons inside a QScrollarea dynamically , but I want to get the text of that particular button either by click or touch.
button = new QPushButton("someText");
...
1
vote
0
answers
28
views
QTableWidget of one window to other window
I want to show my table which is in mainWindow to other window. I stuct there. Please give me a proper solution in python.
I am doing this in QT Creator. I have tried slots and signals but can't do ...
0
votes
0
answers
61
views
In the following scenario: why isn't the slot function being called?
the following example has a working connection (i.e., it returns true), but the slot itself just isn't getting called/executed. I don't understand why this is the case:
// main.cpp
#include <...
0
votes
1
answer
77
views
Why is the QPushbuttons not interacting with the Slot function
Im trying to create an tic tac toe game, where buttons are used for the positions of where the knaughts and crosses are to be used. When I move the buttons into their respective places, the slot is ...
0
votes
2
answers
472
views
Qt GUI C++ How to wait for a button click input inside a function
So I am programming a Poker game im C++ and first it was done with terminal only where I would get the input from cin (check or fold or ...) and program reacts based on the input in a while(true) loop....
1
vote
1
answer
492
views
Non-mutually-blocking ROS and Qt event loops in the same program
I am developing a multithreaded ROS application involving Qt::QThread-inherited objects producing signals triggering ROS publishers in the ROS node activated in the main() function. Qt signals and the ...
1
vote
2
answers
779
views
Qt connect signals and slots of different windows/ mirror a lineEdit text on two windows
I'm new to any form of programming but have to do a project with Qt for my "programming for engineers" course where we simultaneously learn the basics of c++.
I have to display a text from ...
0
votes
1
answer
999
views
pyqt5 connecting button press to a stackedWidget
I just converted my .ui file into the py file and tried to link a QPushButton to a QStackedWidget using the signals and slots system. This is what I attempted to do:
self.createButton.clicked.connect(...
0
votes
0
answers
243
views
QObject singleton living on main thread, invoke it's signal from another thread, is it thread safe?
as the title says,
I have a Core singleton that inherits from QObject that is constructed on the main thread.
I also Have a QTcpServer that is creating a new QThread for each new connection, that is ...
0
votes
2
answers
626
views
Qt slot still receives signals after disconnecting
I have such problem. In my threaded application I need to disconnect slot and reconnect signal to another slot. Unfortunately if new signals send before disconnecting it will be handled in the old ...
0
votes
0
answers
104
views
PyQt Signals not reaching outter class
I am trying to write a code related to a QComboBox widget.
The ComboBox class is a nested/inner class inside the MyTreeAutoDisplay class (for this particular case, the TreeAutoWidget would be out init ...
0
votes
1
answer
277
views
Q_OBJECT causes a parse error in my QQuickApp
I'm working on a class derived from QObject, I'm compiling for android and using android qt6.2.2 Clang arm64_v8a kit. To the default QQuickApp in qt creator I just added the following header file
...
1
vote
0
answers
73
views
Is it safe to call disconnect with a deleted object as sender or receiver argument?
I have an application with a QMdiArea. There's some incoming and outgoing signals connected to the widget in the currently active subwindow. Whenever the active subwindow changes I want to disconnect ...