You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.5 KiB
C++
62 lines
1.5 KiB
C++
#include "cmainwindow.h"
|
|
#include "./ui_cmainwindow.h"
|
|
|
|
|
|
#include "ifontprovider.h"
|
|
#include "cfont.h"
|
|
|
|
#include <QApplication>
|
|
#include <QPluginLoader>
|
|
#include <QDir>
|
|
|
|
|
|
cMainWindow::cMainWindow(QWidget *parent)
|
|
: QMainWindow(parent)
|
|
, ui(new Ui::cMainWindow) {
|
|
ui->setupUi(this);
|
|
|
|
ui->m_label1->setText("blabla");
|
|
|
|
cFont font2(QUrl("https://fonts.gstatic.com/s/abeezee/v22/esDR31xSG-6AGleN6tKukbcHCpE.ttf"));
|
|
ui->m_label2->setFont(font2);
|
|
ui->m_label2->setText("blabla");
|
|
|
|
cFont font3(QUrl("https://fonts.gstatic.com/s/akshar/v9/Yq6I-LyHWTfz9rGoqDaUbHvhkAUsSZECy9CY94XsnPc.ttf"));
|
|
ui->m_label3->setFont(font3);
|
|
ui->m_label3->setText("blabla");
|
|
|
|
// QList<cFontInfo> fonts;
|
|
|
|
// QDir pluginsDir = QDir(QApplication::applicationDirPath());
|
|
|
|
// const auto entryList = pluginsDir.entryList(QDir::Files);
|
|
// for (const QString &fileName : entryList) {
|
|
// QPluginLoader loader(pluginsDir.absoluteFilePath(fileName));
|
|
// QObject *plugin = loader.instance();
|
|
// if (plugin) {
|
|
// auto *interface = qobject_cast<IFontProvider *>(plugin);
|
|
// if (!interface)
|
|
// return;
|
|
// qDebug() << "API Version: " << interface->pluginAPIVersion();
|
|
// qDebug() << "Name: " << interface->name();
|
|
// qDebug() << "Version: " << interface->version();
|
|
|
|
// // fonts = interface->search("");
|
|
// // qDebug() << fonts.count();
|
|
|
|
// // fonts.clear();
|
|
// fonts = interface->search("Roboto");
|
|
// qDebug() << fonts.count();
|
|
|
|
// }
|
|
// #if 0
|
|
// else
|
|
// qDebug() << loader.errorString();
|
|
// #endif
|
|
// }
|
|
}
|
|
|
|
cMainWindow::~cMainWindow() {
|
|
delete ui;
|
|
}
|