Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#include <QApplication>
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include <QScreen>
|
||||
#include <QRect>
|
||||
#include <QSize>
|
||||
#include <QFont>
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
QList<QScreen *> screenList = QApplication::screens();
|
||||
|
||||
qWarning() << "screen count" << screenList.count();
|
||||
|
||||
for (int i = 0; i < screenList.count(); i++)
|
||||
{
|
||||
QScreen *screen = screenList.at(i);
|
||||
QRect screenGeo(screen->geometry());
|
||||
|
||||
qWarning() << "screen" << i << "at" << screenGeo;
|
||||
|
||||
QWidget *widget = new QWidget(nullptr);
|
||||
|
||||
QLabel *label = new QLabel(QString::number(i), widget);
|
||||
label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
|
||||
QFont font(label->font());
|
||||
font.setBold(true);
|
||||
font.setPointSize(120);
|
||||
label->setFont(font);
|
||||
|
||||
widget->setGeometry(QRect(screenGeo.topLeft(), QSize(200, 200)));
|
||||
widget->activateWindow();
|
||||
widget->show();
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
Reference in new issue
Block a user