UserInterfaceUtility.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include "UserInterfaceUtility.h"
  2. #include <QFile>
  3. #include <QDataStream>
  4. QTime UserInterfaceUtility::time;
  5. QBrush UserInterfaceUtility::listViewItemBrush()
  6. {
  7. return QBrush(QColor(0, 94, 187));
  8. }
  9. QColor UserInterfaceUtility::customBlackColor()
  10. {
  11. return QColor(0, 0, 1);
  12. }
  13. QColor UserInterfaceUtility::videoColor()
  14. {
  15. return QColor(0, 0, 0);
  16. }
  17. QColor UserInterfaceUtility::mainWidgetBackgroundColor()
  18. {
  19. return QColor(16, 6, 119);
  20. }
  21. QColor UserInterfaceUtility::multimediaAlphaColor()
  22. {
  23. return QColor(0, 94, 187);
  24. }
  25. void UserInterfaceUtility::startTime()
  26. {
  27. time.restart();
  28. }
  29. void UserInterfaceUtility::elapsed(const QString &str)
  30. {
  31. qWarning() << "UserInterfaceUtility::elapsed" << time.elapsed() << str;
  32. }
  33. bool UserInterfaceUtility::loadFromdata(const QString &path, QByteArray &data)
  34. {
  35. bool ret(false);
  36. QFile file(path);
  37. if (file.open(QIODevice::ReadOnly)) {
  38. QDataStream stream(&file);
  39. data.clear();
  40. stream >> data;
  41. file.close();
  42. ret = true;
  43. }
  44. return ret;
  45. }