Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Disable minimize
Qt 6.11 is out! See what's new in the release blog

Disable minimize

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 1.9k Views 4 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.
  • D Offline
    D Offline
    DonMirkoni
    wrote on last edited by
    #1

    I want create desktop app like gadget.
    Need disable minimaze when press "Show desktop" or "Winodws Key + D".
    My simple app code
    main.cpp

    #include <QtGui>
    #include <QApplication>
    #include "MyWindow.h"
    
    int main(int argc, char *argv[])
    {
      QApplication a(argc, argv);
    
      MyWindow w;
      w.show();
    
      return a.exec();
    }
    

    MyWindow.h

    #ifndef MYWINDOW_H
    #define MYWINDOW_H
    
    #include <QWidget>
    #include <QApplication>
    #include <QPushButton>
    #include <QFrame>
    
    class MyWindow: public QWidget
    {
    Q_OBJECT
    
    public:
      MyWindow(QWidget *parent = 0);
      ~MyWindow();
    
    private:
      QPushButton *buttonExit;
    
    };
    
    #endif // MYWINDOW_H
    

    MyWindow.cpp

    #include "MyWindow.h"
    
    MyWindow::MyWindow(QWidget *parent) : QWidget(parent)
    {
        buttonExit= new QPushButton(this);
        buttonExit->setText("Exit");
        this->resize(500,500);
    
        setWindowFlags(Qt::FramelessWindowHint);
        setMouseTracking(true);
        setAttribute(Qt::WA_Hover);
    
        connect(buttonExit,SIGNAL(clicked()),qApp,SLOT(quit()));
    }
    
    MyWindow::~MyWindow()
    {
     delete buttonExit;
    }
    

    Any help will be nice :)

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi! Are you sure that this is even possible?

      A 1 Reply Last reply
      2
      • ? A Former User

        Hi! Are you sure that this is even possible?

        A Offline
        A Offline
        ambershark
        wrote on last edited by
        #3

        @Wieland I don't think so.. At least not with Win+D. You could maybe disable Win+M and the minimize for the window but Win+D is like, you're all going to the taskbar RIGHT NOW!

        My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          Blocking the OS is not easy but its possible when using a kiosk system
          https://en.wikipedia.org/wiki/Kiosk_software
          You can block such stuff via registry on windows but its not something a single app can do.
          Its must be set up.

          Its not easy to do
          ms.codeguru.com/showthread.php?403011-Detect-Show-Desktop

          So if you really need this, please consider a premade kiosk system.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DonMirkoni
            wrote on last edited by DonMirkoni
            #5

            I found app Calendar Gadget, in code they use windows.h for that.
            But that is problem when want create Cross-platform (Windows, Linux, MAC).
            https://www.codeproject.com/Articles/63646/Calendar-Gadget-Using-Qt-Framework.

            Will be nice QT create new WindowFlags CannotMinimize, with this flag we get easy tool for create gadgets :)
            Where we can request new feature for QT?

            A 1 Reply Last reply
            0
            • D DonMirkoni

              I found app Calendar Gadget, in code they use windows.h for that.
              But that is problem when want create Cross-platform (Windows, Linux, MAC).
              https://www.codeproject.com/Articles/63646/Calendar-Gadget-Using-Qt-Framework.

              Will be nice QT create new WindowFlags CannotMinimize, with this flag we get easy tool for create gadgets :)
              Where we can request new feature for QT?

              A Offline
              A Offline
              ambershark
              wrote on last edited by
              #6

              @DonMirkoni You could always use the native toolkits to deal with this on each platform you support.

              It should be possible on all 3. You'd have to write your own code natively though like the calendar gadget does for windows.

              My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

              1 Reply Last reply
              1

              • Login

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