Unsolved Signal doesn't work properly
-
the contents of review.h should be enough
-
@VRonin
review.h
review.cpp
mainwindow.cpp
Thank you. -
@VRonin
sIDReview (QString)
nameReview (QString)
fileByteArray (QByteArray)
descriptionReview ((QString))
monthReview (QString)
dayReview (QString)
yearReview (QString)
historyReview (QString)
ageReview (QString)
notesReview (QString)
colorReview (QString)
materialReview (QString)
SignedbyReview (QString)
whatReview (QString) -
What's the link between Review and MainWindow?
-
@VRonin
In Review the data added to the database and I want to update the table in MainWindow using the record just added to the db. -
@gabor53 Sorry, I did not explained myself. Review is a Dialog, where do you make this dialog appear?
-
@VRonin
In MainWindow line 75void MainWindow::on_actionAdd_a_Friend_triggered() { Additem *mAddItem = new Additem; mAddItem->exec (); }
-
Now you lost me completely.
typedef Review Additem;
?? I guess not becausevoid Review::on_pushButton_Fix_clicked() { Additem *mAdditem = new Additem(this);
-
@VRonin
Originally, after main.cpp MainWindow.cpp loads. MainWindow has the tableview that displays 4 columns from the database. The user can call Additem.cpp from MainWindow to add more items to the db. After data entry Review.cpp is called where the user can review the data he/she entered. Here there are two choices: either click PushButton_fix to correct errors (this takes back to Additem.cpp) or if all correct you can click Add_to_Db and the item is added to the db. After adding RecAdded signal emitted to add the new record to the tableview in MainWindow. I hope this helps. -
Ok, your design is "borderline". Could you please post additem.h and additem.cpp too please?
-
Thank you for your help.
-
Unrelated to main topic but I just took a glimpse at your code:
QString date = QDate::currentDate().toString (); list = date.split (QRegExp("\\s+")); int size = list.size (); QString sYear = list.at (size-1); yeark = sYear.toInt ();
do you mean?
yeark = QDate::currentDate().year();
-
Yes. I was complicated.
-
Hai....
you just try by this line of code instead of your connect statement
connect(this,&Review::RecAdded,this,&Review::updateTable,Qt::UniqueConnection);
It may help you.. -
Hi @Venkatesh-V
It didnt do the trick. -
No, clearly not. I'm working on the solution, I'll post it shortly. I'm trying to find the time and avoid to correct too much
-
@VRonin
Thank you. I appreciate it. -
@gabor53
When you have time please let me know how can I improve the design. -
Hai..@gabor53
Can you share your whole code? so that i can try to resolve. -
@Venkatesh-V See above