Michaël Lemaire
1a193f4e78
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@563 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
47 lines
920 B
C++
47 lines
920 B
C++
#include "tools.h"
|
|
|
|
#include <QEvent>
|
|
#include "basepreview.h"
|
|
|
|
DialogWithPreview::DialogWithPreview(QWidget* parent) : QDialog(parent)
|
|
{
|
|
}
|
|
|
|
bool DialogWithPreview::event(QEvent* event)
|
|
{
|
|
if (event->type() == QEvent::WindowActivate)
|
|
{
|
|
BasePreview::reviveAll();
|
|
}
|
|
|
|
return QDialog::event(event);
|
|
}
|
|
|
|
QString getHumanMemory(qint64 memused)
|
|
{
|
|
if (memused >= 1024)
|
|
{
|
|
memused /= 1024;
|
|
if (memused >= 1024)
|
|
{
|
|
memused /= 1024;
|
|
if (memused >= 1024)
|
|
{
|
|
memused /= 1024;
|
|
return QObject::tr("%1 GB").arg(memused);
|
|
}
|
|
else
|
|
{
|
|
return QObject::tr("%1 MB").arg(memused);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return QObject::tr("%1 kB").arg(memused);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return QObject::tr("%1 B").arg(memused);
|
|
}
|
|
}
|