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. Can't resize window
Forum Updated to NodeBB v4.3 + New Features

Can't resize window

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 822 Views 1 Watching
  • 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.
  • F Offline
    F Offline
    fraz
    wrote on last edited by
    #1

    I've got a window but I can't drag to resize it. Also, the usual 'X' close button is not there so I have to close the application through the debugger. I think these are probably related.

    I think I have used the correct Window flags but seems to have no effect.

    import QtQuick 2.9
    import QtQuick.Window 2.2
    import QtQuick.Controls 2.2
    import QtQuick.Layouts 1.3
    import QtQuick.Controls.Styles 1.4
    
    Window {
        id: window
        visible: true
        width: 900
        height: 900
        flags: Qt.Window | Qt.WindowTitleHint | Qt.WindowCloseButtonHint
        title: qsTr("SLD Quick")
    
    

    Can anyone help?

    raven-worxR 1 Reply Last reply
    0
    • F fraz

      I've got a window but I can't drag to resize it. Also, the usual 'X' close button is not there so I have to close the application through the debugger. I think these are probably related.

      I think I have used the correct Window flags but seems to have no effect.

      import QtQuick 2.9
      import QtQuick.Window 2.2
      import QtQuick.Controls 2.2
      import QtQuick.Layouts 1.3
      import QtQuick.Controls.Styles 1.4
      
      Window {
          id: window
          visible: true
          width: 900
          height: 900
          flags: Qt.Window | Qt.WindowTitleHint | Qt.WindowCloseButtonHint
          title: qsTr("SLD Quick")
      
      

      Can anyone help?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @fraz
      how exactly are you displaying this QML code? Meaning how does your main() look like?

      flags: Qt.Window | Qt.WindowTitleHint | Qt.WindowCloseButtonHint

      Also those extra provided flags are already contained in the Qt.Window flag, so actually you can leave the whole property definition out. Or do you have anything special in mind?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fraz
        wrote on last edited by
        #3

        The current program is very barebones at the moment as I'm just starting to learn how to use Qt Quick. Here's what main.cpp looks like:

        #include <QGuiApplication>
        #include <QQmlApplicationEngine>
        #include <QQuickStyle>
        
        int main(int argc, char *argv[])
        {
        #if defined(Q_OS_WIN)
            QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
        #endif
        
            QGuiApplication app(argc, argv);
            QQmlApplicationEngine engine;
            QQuickStyle::setStyle("Fusion");
            engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
            if (engine.rootObjects().isEmpty())
                return -1;
        
            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