#include <QDesktopServices>
#include <QSignalMapper>
#include <QUrl>
+#include <QEventLoop>
TransactionView::TransactionView(QWidget *parent) :
QWidget(parent), model(0), transactionProxyModel(0),
break;
case LastMonth:
transactionProxyModel->setDateRange(
- QDateTime(QDate(current.year(), current.month()-1, 1)),
+ QDateTime(QDate(current.year(), current.month(), 1).addMonths(-1)),
QDateTime(QDate(current.year(), current.month(), 1)));
break;
case ThisYear:
if(!selection.isEmpty())
{
TransactionDescDialog dlg(selection.at(0));
- dlg.exec();
+ dlg.setWindowModality(Qt::ApplicationModal);
+ dlg.show();
+
+ // This loop will wait for the window is closed
+ QEventLoop loop;
+ connect(&dlg, SIGNAL(stopExec()), &loop, SLOT(quit()));
+ loop.exec();
}
}