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. Disable window maximizing/showing in QML
Forum Updated to NodeBB v4.3 + New Features

Disable window maximizing/showing in QML

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 2.2k 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.
  • N Offline
    N Offline
    Noturnoz
    wrote on last edited by
    #1

    I have an application in the QML/C++ that shouldn't be able to be maximized/showed by user. It should stay minimized in taskbar whole time and when it receives a message from a server then it should maximize itself. Is it possible to do it in the QML? I was looking everywhere and I was not able to find anything similar to my issue.

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      If you are using Window then set Window visibility to Maximized and then call requestActivate() when messaged is received from server.

      157

      1 Reply Last reply
      0
      • O Offline
        O Offline
        onek24
        wrote on last edited by
        #3

        Hey,

        like p3c0 already said; the window visibility should do the trick. Example code with a Window-type Component:
        @import QtQuick 2.2
        import QtQuick.Window 2.1

        Window {
        visible: true
        visibility: "Minimized"
        }@

        For the cpp part where a user shouldn't be able to maximize your application:

        @void MyApplication::changeEvent(QEvent *e)
        {
        if(e->type() == QEvent::WindowStateChange) {
        e->ignore();
        } else {
        e->accept();
        }
        }@

        This should ignore the event by default, i haven't tested it out so you might play around with it a little bit to get it work properly.

        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