Well , I've another inquiry .
- After I've opened a new widget , I 've put Button + QLineEdit @ the new open Widget just to test it .
- What I 've found out is that ctrls @ the new open widget don't call the slots I implement ?!!
- @ the new widget it's supposed when the user press the button , a text 'll be printed into QLineEdit .
- When I Put the code that print some text into QLineEdit into Constructor , it Works .
- Also when I use the built in slots (e.g. showMaximized() ) , it works .
- My Question : Why don't the ctrls @ the new open Widget call the slots I implement ?!!
N.B. : I've a Header + .cpp file to each form I've in order to implement my own slots .
The code which I use to open my new widget that's located @ the first .cpp which I implement into it the slots of the 1st widget :
CustomSlot2* widget = new CustomSlot2;
widget->setAttribute(Qt::WA_DeleteOnClose);
widget->show();
CustomSlot2* widget = new CustomSlot2;
widget->setAttribute(Qt::WA_DeleteOnClose);
widget->show();
To copy to clipboard, switch view to plain text mode
----------------------------------------------------------------------
My .cpp file 's code , which I implement the slots of ctrls of 2nd new open widget :
#include"CustomSlot2.h"
#include "ui_Form2.h"
{
formTwo.setupUi(this);
}
void CustomSlot2::PrintTxt
{
formTwo.txtData->setText("Alooooooo") ;
}
#include"CustomSlot2.h"
#include "ui_Form2.h"
CustomSlot2::CustomSlot2(QWidget *parent): QWidget(parent)
{
formTwo.setupUi(this);
}
void CustomSlot2::PrintTxt
{
formTwo.txtData->setText("Alooooooo") ;
}
To copy to clipboard, switch view to plain text mode
Thanks
Bookmarks