I can imagine that there might be quite a few of them depending on the event, but at the same time, I guess this can be a best way to debug, and an interesting lesson.
Why would I need it? I'm using some custom class based on the QWidget, which does not expand when I de-attach a QDockWidget based in the same window. Knowing what signals...
What does it mean to move a object from one thread to another in Qt using moveToThread? Everything seems to work even before using moveToThread, which moves the object from one thread (GUI thread) to a another thread ( worked) and Qt:connect calls the appropriate slot on object.
Is there any difference because of where the object lives,...
I'm a c++ developer having used signals & slots in c++ which to me seems to be analogous to delegates in c#. I've found myself at a loss in searching for the functionality provided by "bind", and feel I must be missing something.
I feel like that something like the following, which is possible in c++ should be possible in c# with delega...
Let's say I have an event and the corresponding function is called. This function interacts with the outside world and so can sometimes have long delays. If the function waits or hangs then my UI will freeze and this is not desirable. On the other hand, having to break up my function into many parts and re-emitting signals is long and...
In QT4.5,
I use a QTableWidget, and I have connected the signal QTableWidget::itemClicked() to a custom slot like this:
connect(_table, SIGNAL(itemClicked(QTableWidgetItem*)), item, SLOT(sloItemClicked(QTableWidgetItem*)));
I create such a connection for each row I add to the table.
The problem is that the slot sloItemClicked get ca...
I am working on an application using PyQt4 and the designer it provides. I have a main window application that works fine, but I wanted to create custom message dialogs. I designed a dialog and set up some custom signal/slot connections in the __init__ method and wrote an if __name__=='__main__': and had a test. The custom slots work ...
I'm trying to keep track of the textChanged() signal on for handful of QTextEdits. I want to do the same thing regardless of the text edit emitting the signal: uncheck its associated checkbox in a QListWidget if it becomes empty and leave it checked otherwise. The function I have so for is as follows:
void MainWindow::changed()
{
QS...
I am creating a small PyQt application and got stuck up in MouseOver effect.
I have a QMainWindow which has three buttons named createProfileButton, downloadPackagesButton and installPackagesButton. All these are of type QPushButton
Now I have created a Label which will hold the text when someone hovers the mouse over any of these butt...
I'm writing a simplified calculator using Qt with C++, for learning purposes. Each number is a QPushButton that uses the same slot to modify the text in a lineEdit widget being used as a display.
The slot uses the sender() method to figure out which button was pressed, so the correct number would be written on the display widget.
In or...
Suppose I have a QPushButton widget that is connected to a slot by its clicked() signal. This first slot in turn calls another slot by the emit keyword. The second slot takes an argument from the first slot and do something with it. It worked, but from what I understand of the signals-slots pattern, it only makes sense to emit a signal. ...
I am looking for Qt's implemention of the function QObject::qt_metacall(_c, _id, _a); this is where a given function name is converted into index. But I am not able to find the function implementation anywhere in their source code.
int ssObject::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _...
Hi all,
I have a Qt application that uses OpenCV for image processing.
Everything was working fine with OpenCV 1.0 but when I upgraded to
OpenCV 2.0 it started crashing.
I noticed that it only crashes whenever OpenCV functions are called
inside Qt slots.
For instance, the following slot:
void TestClass::on_testButton_clicked() {
I...
We're using Qt that offers signals and slots which I find really convenient. However, with great power comes great responsibility and I think it's very easy too misuse this feature.
Are there any best-practices for signal-slot usage? I'm having a hard time to find some general guidelines in this manner. Some questions (I have clear opi...
Hi I've got a spare moment so decided to look at QT and how easily I can port my windows applications to Qt.
My only real problem is a couple of controls that will need re-implementing under QT. I've already handled the basic drawing of the control but my control creates a child scroll bar. The problem is that this scrollbar is crea...
Hi,
I have installed Qt and Qt for VS plugin. Everything works fine, UI applications compile and run that's ok, but connecting signals and slots doesn't. I have Q_OBJECT in my class and for connecting I am using this code in constructor:
connect(ui.mainTableView, SIGNAL(activated(const QModelIndex &)),
this, SLOT(showDetail(con...
Hi there,
I know that the question has already been asked and answered, but it was more than one year ago and it looks like there are new alternatives out there.
So I'm coding a game with the SFML library (which I'm starting to find pretty much cool actually) and I'm looking for a light and fast event/delegate library.
After doing som...
I am learning QT and trying out some examples.
I am trying to make a dialog that disappears a label when a button is pressed and makes it appear when the same button is pressed again.
Below is the code.
#include <QApplication>
#include <QPushButton>
#include <QLabel>
#include <QDialog>
#include <QObject>
#include <QHBoxLayout>
int ma...
I currently have a program which use busy pooling and a bunch of thread to monitor states of object, process data, and pass data.. This is all very hard to manage/waste cpu time. I am looking at removing thread and using signal / slot as there is none of my code which "block".
So I will signal states of my object, which is easy. What's ...
I am going to pass data up/down a 5-10 layered object using signals and slots. Which should result in a few thousand signal per sec. Which is far form "I clicked a button". All my object will also signal them self on a timer about every 100ms so they can do some processing.
What would be the fastest C++ Signal/Slot implementation which ...
Is there best practice for managing Object shared by 2 or more others Object. Even when running on different thread?
For example A is created and a pointer to it is given to B and C.
ObjA A = new ObjA();
B->GiveObj(A);
C->GiveObj(A);
Now how can I delete objA?
So far what I though about is A monitor how many ref there are to it and w...