summaryrefslogtreecommitdiffstats
path: root/gui/CustomMessageBox.cpp
blob: e55ebbbba346d83e4d6caa09e7e0546977499172 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "CustomMessageBox.h"

namespace CustomMessageBox
{
	QMessageBox *selectable(QWidget *parent, const QString &title, const QString &text,
							QMessageBox::Icon icon,	QMessageBox::StandardButtons buttons,
							QMessageBox::StandardButton defaultButton)
	{
		QMessageBox *messageBox = new QMessageBox(parent);
		messageBox->setWindowTitle(title);
		messageBox->setText(text);
		messageBox->setStandardButtons(buttons);
		messageBox->setDefaultButton(defaultButton);
		messageBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
		messageBox->setIcon(icon);

		return messageBox;
	}
}