15,789,360 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Python questions
View PHP questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by JohnnyG62 (Top 13 by date)
JohnnyG62
4-Jun-17 22:46pm
View
Some one showed me a solution for this. I want to document in case this will help others.
I changed the PIC for the input file
LASTSALEAMTIN TO PIC X(13).
Then I added a field in working storage
01 LASTSALE PIC 9(9)V99.
Then added this to the procedure division
MOVE FUNCTION NUMVAL(LASTSALEAMTIN) to LASTSALE
JohnnyG62
10-Jan-17 16:07pm
View
This still didn't work but Richard's suggestion works
JohnnyG62
10-Jan-17 16:06pm
View
yes that works !
JohnnyG62
10-Jan-17 14:44pm
View
I pasted the rest of the code.
JohnnyG62
1-Dec-16 14:11pm
View
I tried the non c++11 suggestion and that worked great ! Now I trying to remove a string from a vector.
For example:
v.remove(it);
but get this compile error
‘class std::vector<std::basic_string<char> >’ has no member named ‘remove’
JohnnyG62
30-Dec-15 13:25pm
View
So where would I put the code to set the text of the dialog fields (or the debug statements) since it cant be done in the constructor?
JohnnyG62
17-Dec-15 13:04pm
View
Well that didn't work. I have a cognitive issue (brain injury), so It's probably me. I may be overlooking something. Below is the revised code based on your suggestions. Perhaps I made a mistake? If you don't have time to waste on this anymore, I understand. Thanks for all your help
-----------------------------------------------------
void LoginDialog::on_btnLogin_clicked()
{
if (!db.open()) {
if (QMessageBox::question(this, "Login Failed",
"Login Failed Retry?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
{
done(QMessageBox::Retry);
}
else
{
delete con;
reject(); // same as done(QDialog::Rejected)
}
}
else
{
accept(); // same as done(QDialog::Accepted)
}
}
-----------------------------------------------------
void MainWindow::showDialog()
{
this->hide();
int result = QMessageBox::Retry;
while (result == QMessageBox::Retry)
{
LoginDialogNew *login = new LoginDialogNew(this);
result = login->exec();
delete login;
}
if (result == QDialog::Rejected)
qApp->closeAllWindows();
else{
this->show();
}
}
JohnnyG62
16-Dec-15 21:05pm
View
Getting very close. I understand your code and like the design. One issue, When I click on the retry button, the result passed back to MainWindow is zero not QMessageBox::Retry = 524288. Here is the output of some debug staments
Inside MainWindow
QMessageBox::Retry = 524288
Inside LoginDialog
done(QMessageBox::Retry) = 524288
back in MainWindow
result from login->exec() = 0
I really appreciate your help thus far :-)
JohnnyG62
16-Dec-15 16:20pm
View
I'm sorry if I didn't respond correctly. I'm using the "Have Question or Comment" link. I didn't see a reply button next to the posters name. Anyway. I tied your suggestion but got the folloing compile errors.
The login dialog:
error: 'Retry' is not a member of 'QDialog'
done(QDialog::Retry);
^
error: 'StandardButton' is not a member of 'QDialog'
QDialog::StandardButton result = QDialog::Retry;
^
error: 'Retry' is not a member of 'QDialog'
while (result == QDialog::Retry)
^
error: 'Cancel' is not a member of 'QDialog'
if (result == QDialog::Cancel)
JohnnyG62
15-Dec-15 23:38pm
View
Okay. thanks for the tip !
I'm sorry, I'm not sure what you mean by calling accept(), reject(), or done(int r) can you elaborate? Also what does the 100 returned from m_Login->exec() mean? did you mean QDialog::Done ?
JohnnyG62
15-Dec-15 16:33pm
View
Thanks Jochen, I am new to C++ & QT. This is the first time I've written a class. I thought there could be more other errors. This worked perfectly ! I can't believe I missed calling the QWidget constructor instead of QObject. .This defintely help.
JohnnyG62
2-Dec-15 17:00pm
View
Yes this helped. Thank you
JohnnyG62
29-Nov-15 17:36pm
View
I looked at your link and tried the code example and got many compile errors. I had to remove QT then I reinstalled it using these instructions
http://zetcode.com/gui/qt5/introduction/
then the code I posted above worked.
I guess installing QT from apt-get doesn't install a unusable mysql environment.
Show More