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. How do I create a modeless message box?
Forum Updated to NodeBB v4.3 + New Features

How do I create a modeless message box?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 433 Views 2 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.
  • K Offline
    K Offline
    Knj.Tkm
    wrote on last edited by
    #1

    I want to create a modeless message box.

    There are no buttons or progress bars to display, only messages.
    I would also like the system to terminate when the work is completed or when it fails.

    Is it possible to create such a message box?

    sierdzioS 1 Reply Last reply
    0
    • K Knj.Tkm

      I want to create a modeless message box.

      There are no buttons or progress bars to display, only messages.
      I would also like the system to terminate when the work is completed or when it fails.

      Is it possible to create such a message box?

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @Knj-Tkm said in How do I create a modeless message box?:

      Is it possible to create such a message box?

      Yes. Solution depends on whether we are talking about QtWidgets or QtQuick, but in general:

      • make a custom dialog, without buttons
      • set it to be application modal
      • reimplement close event to prevent users from closing the dialog with Alt+F4

      I would also like the system to terminate when the work is completed or when it fails.

      Solution depends on the operating system, but in general you need to use QProcess::startDetached and run system command to shut down or reboot the device.

      (Z(:^

      JonBJ 1 Reply Last reply
      1
      • sierdzioS sierdzio

        @Knj-Tkm said in How do I create a modeless message box?:

        Is it possible to create such a message box?

        Yes. Solution depends on whether we are talking about QtWidgets or QtQuick, but in general:

        • make a custom dialog, without buttons
        • set it to be application modal
        • reimplement close event to prevent users from closing the dialog with Alt+F4

        I would also like the system to terminate when the work is completed or when it fails.

        Solution depends on the operating system, but in general you need to use QProcess::startDetached and run system command to shut down or reboot the device.

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @sierdzio said in How do I create a modeless message box?:

        set it to be application modal

        How does this address OP's request for a modeless message box? Seems to me to be the opposite. Why not a modeless one? setModal(false), use show() instead of exec()?

        sierdzioS 1 Reply Last reply
        0
        • JonBJ JonB

          @sierdzio said in How do I create a modeless message box?:

          set it to be application modal

          How does this address OP's request for a modeless message box? Seems to me to be the opposite. Why not a modeless one? setModal(false), use show() instead of exec()?

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @JonB you're right, I somehow assumed such a message box should not be possible to hide behind other windows.

          (Z(:^

          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