I'm pretty new to Qt and C++ so I'm probably missing something obvious, but for the life of me I can't figure out what is going wrong. One of the classes in a program I wrote is causing a crash whenever I try to do a basic string assignment. See below (slightly pared down).
Qt Code:
  1. class AutochargeData : public QWidget
  2. {
  3.  
  4. public:
  5. AutochargeData(appData *appInfo, QWidget *parent = 0);
  6.  
  7. QString orderNum;
  8. QString paymentMethod;
  9. QString total;
  10.  
  11. void setPayment(QString payment);
  12. void setOrderID(QString orderID);
  13. void setTotal(QString total);
  14.  
  15. void getPaymentData(QString orderID);
  16.  
  17. private:
  18. appData *appInfo;
  19.  
  20. };
To copy to clipboard, switch view to plain text mode 

So in the below code, I have tried many variations. I know the query is fine because I've used qDebug() to check the output. I have tried skipping the set functions and doing a direct assignment, I have tried using the "this" keyword, and I have even tried just assigning a random string directly to the variables.

Qt Code:
  1. AutochargeData::AutochargeData(appData *appInfo, QWidget *parent) :
  2. QWidget(parent)
  3. {
  4. this->appInfo = appInfo;
  5. }
  6.  
  7. void AutochargeData::getPaymentData(QString orderID)
  8. {
  9. QString queryString = "SELECT order_payment.method, order.increment_id, order.grand_total FROM order JOIN order_payment ON sales_flat_order.entity_id = order_payment.parent_id WHERE order.increment_id = '" + orderID + "';";
  10.  
  11. QSqlQuery query(queryString, QSqlDatabase::database("db"));
  12. query.exec();
  13.  
  14. while (query.next()) {
  15. setOrderID(query.value("increment_id").toString());
  16. setPayment(query.value("method").toString());
  17. setTotal(query.value("grand_total").toString());
  18. }
  19. }
  20.  
  21. void AutochargeData::setPayment(QString payment)
  22. {
  23. paymentMethod = payment;
  24. }
  25.  
  26. void AutochargeData::setOrderID(QString orderID)
  27. {
  28. orderNum = orderID;
  29. }
  30.  
  31. void AutochargeData::setTotal(QString grandTotal)
  32. {
  33. total = grandTotal;
  34. }
To copy to clipboard, switch view to plain text mode 

Any time I tried to assign a string to the orderNum, paymentMethod, or total variables, the program crashes. The debugger is ending on
Qt Code:
  1. QString::operator=(const char*)
To copy to clipboard, switch view to plain text mode 
in the qstring.h file. As I mentioned, I am relatively new at this so it may be something obvious that I am missing. But after multiple hours of googling and trying different variations, I am stumped. Any thoughts would be much appreciated, and please let me know if there's more information that would be helpful.