Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt for uwp Set size
Forum Updated to NodeBB v4.3 + New Features

Qt for uwp Set size

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 135 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Soniko
    wrote on last edited by
    #1

    I created simple project QtQuick and want to set minimum size of window. When i build and run it like desktop application all works right. But for UWP it ignore my sizing parametrs. How to fix it?

    import QtQuick 2.13
    import QtQuick.Controls 2.13
    import QtQuick.Window 2.13
    
    ApplicationWindow {
        id: mainWindow
        visible: true
        title: qsTr("Hello World")
    
        height: 700
        width: 700
        minimumWidth: 700
        Rectangle {
            id: rectangle
            x: 50
            y: 50
            width: 542
            height: 200
            color: "#d81f1f"
            border.color: "#ea7777"
        }
    }
    
    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    
    int main(int argc, char *argv[])
    {
    #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
        QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    #endif
    
    
        QGuiApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
        const QUrl url(QStringLiteral("qrc:/main.qml"));
        QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                         &app, [url](QObject *obj, const QUrl &objUrl) {
            if (!obj && url == objUrl)
                QCoreApplication::exit(-1);
        }, Qt::QueuedConnection);
        engine.load(url);
    
        return app.exec();
    }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved