Last active
September 27, 2015 23:08
-
-
Save danadam/1346485 to your computer and use it in GitHub Desktop.
Qt Terminus font test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QApplication> | |
#include <QWidget> | |
#include <QScrollArea> | |
#include <QGridLayout> | |
#include <QLabel> | |
#include <QPushButton> | |
#include <QFont> | |
#include <QVBoxLayout> | |
#include <iostream> | |
int main(int argc, char * argv[]) | |
{ | |
QApplication app(argc, argv); | |
std::cout << "compiled with Qt " << QT_VERSION_STR << ", run with Qt " << qVersion() << std::endl; | |
QScrollArea * scrollArea = new QScrollArea(); | |
QWidget * container = new QWidget(scrollArea); | |
scrollArea->setWidget(container); | |
scrollArea->setWidgetResizable(true); | |
QGridLayout * layout = new QGridLayout(container); | |
for (int i = 0; i <= 11; ++i) | |
{ | |
const int size = i + 8; | |
QLabel * label = new QLabel(QString("size %1:").arg(size)); | |
QPushButton * button = new QPushButton(QObject::trUtf8("aAcCeElLnNoOsSzZzZ\nąĄćĆęĘłŁńŃóÓśŚźŹżŻ")); | |
// QPushButton * button = new QPushButton(QObject::trUtf8("aAeEoO\näÄëËöÖ")); | |
button->setFont(QFont("Terminus", size)); | |
layout->addWidget(label, i, 0); | |
layout->addWidget(button, i, 1); | |
} | |
QWidget widget; | |
QVBoxLayout * outerLayout = new QVBoxLayout(&widget); | |
outerLayout->addWidget(scrollArea); | |
widget.resize(400, 400); | |
widget.show(); | |
return app.exec(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment