How to transffer QImage or QPixmap from one window to another using signals and slots
-
@KroMignon yes i am using right class instance . i have pasted my code
-
@swansorter said in How to transffer QImage or QPixmap from one window to another using signals and slots:
yes i am using right class instance . i have pasted my code
Your code seem at little bit confusing to me.
Why do you use old connect syntax here:connect(obj,SIGNAL(Mouse_Left(QString)),this,SLOT(Mouse_Left(QString)));
and not new syntax?
connect(obj,&my_qlabel::Mouse_Left,this, &MainWindow::Mouse_Left);
Where did you add obj to the layout?
-
@swansorter And please be so kind and format your code properly to make it easier for others to read it...
-
@swansorter
This is hardly the minimal example I asked for....Do not use
SIGNAL
/SLOT
macros if you are to have any chance of debugging what is going on. You do not even check yourconnect()
s return result. Use the new syntax only.You declare
Mouse_Left
as a signal, yet you provide your own implementation of a method with that name. I don't know that you can do that.I'm quite mixed up about what are signals and what are slots in main window vs the label.
If you want me to look further: Name your slots differently from your signals, else it's too confusing. Reduce to a minimal example. And enclose blocks of code with the form posts' Code tag.
UPDATE
Crossed with your latest post. Advice: get rid ofSIGNAL
/SLOT
in all your code, only use new style, to help both you and others. -
@swansorter said in How to transffer QImage or QPixmap from one window to another using signals and slots:
do you have the link for the new style SIGNAL/SLOT Diclaration
Easy to find with Google: https://doc.qt.io/qt-5/signalsandslots.html
-
@swansorter
Additionally to @jsulm, you originally had it with yourconnect(test_label,&my_qlabel::sendImage,this,&MainWindow::onGetImage);
You then changed over to
SIGNAL
/SLOT
, for no discernible reason, which may be a clue as to why it went wrong....