How to make QtQuick2.0 application window not resizable?

S.M.Mousavi picture S.M.Mousavi · Sep 10, 2013 · Viewed 10.2k times · Source

I have a QtQuick2.0/QtQuick2.1 application with following default codes on main.cpp:

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/WikiTransferor2/mainMode3.qml"));
    viewer.showExpanded();
    return app.exec();
}

How can i make this window not resizable?

Answer

Ayberk Özgür picture Ayberk Özgür · Jul 26, 2016

On (at least) KDE the other answers don't work. The following QtQuick solution worked for me:

ApplicationWindow{
    width: ...
    height: ...

    maximumHeight: height
    maximumWidth: width

    minimumHeight: height
    minimumWidth: width
}