From 74cecb25d32fe024a8b6cebac67c53cd35feb34d Mon Sep 17 00:00:00 2001 From: laserpants Date: Thu, 28 Apr 2016 11:02:56 +0300 Subject: [PATCH] use Roboto font --- main.cpp | 9 +++++---- qt-material-widgets.pro | 3 +++ resources.qrc | 10 ++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 resources.qrc diff --git a/main.cpp b/main.cpp index 02829c1..1a5e660 100644 --- a/main.cpp +++ b/main.cpp @@ -1,16 +1,17 @@ #include "mainwindow.h" #include -#include +#include #include "style.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); -// QCommonStyle *style = new QCommonStyle; -// a.setStyle(style); + int id = QFontDatabase::addApplicationFont(":/fonts/Roboto-Regular.ttf"); + QFont font(QFontDatabase::applicationFontFamilies(id).at(0)); + font.setPixelSize(14); -// a.setStyle(&Style::instance()); + a.setFont(font); MainWindow w; w.show(); diff --git a/qt-material-widgets.pro b/qt-material-widgets.pro index aa5eda4..b5e7ca3 100644 --- a/qt-material-widgets.pro +++ b/qt-material-widgets.pro @@ -96,3 +96,6 @@ HEADERS += mainwindow.h \ lib/style.h \ examples/iconmenuexamples.h \ lib/scaleeffect.h + +RESOURCES += \ + resources.qrc diff --git a/resources.qrc b/resources.qrc new file mode 100644 index 0000000..bd08aa0 --- /dev/null +++ b/resources.qrc @@ -0,0 +1,10 @@ + + + Roboto-Black.ttf + Roboto-Bold.ttf + Roboto-Light.ttf + Roboto-Medium.ttf + Roboto-Regular.ttf + Roboto-Thin.ttf + +