Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. can i add a checkbox just above the buttons in a QMessageBox ?
Forum Updated to NodeBB v4.3 + New Features

can i add a checkbox just above the buttons in a QMessageBox ?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
6 Posts 4 Posters 1.1k 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by
    #1

    i know you can add buttons into the button bar but what about a check box just above it? how ?

    jsulmJ kshegunovK 2 Replies Last reply
    0
    • D davecotter

      i know you can add buttons into the button bar but what about a check box just above it? how ?

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @davecotter You can subclass QMessageBox and add what ever you want there

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • D Offline
        D Offline
        davecotter
        wrote on last edited by
        #3

        okay is there an example for this? i want to put it just above the row of buttons at the bottom, how do i ensure the dialog will expand to accommodate?

        jsulmJ D 2 Replies Last reply
        0
        • D davecotter

          okay is there an example for this? i want to put it just above the row of buttons at the bottom, how do i ensure the dialog will expand to accommodate?

          jsulmJ Online
          jsulmJ Online
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @davecotter said in can i add a checkbox just above the buttons in a QMessageBox ?:

          how do i ensure the dialog will expand to accommodate?

          Using layouts.

          I'm not aware of such examples.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • D davecotter

            okay is there an example for this? i want to put it just above the row of buttons at the bottom, how do i ensure the dialog will expand to accommodate?

            D Offline
            D Offline
            Devopia53
            wrote on last edited by
            #5

            @davecotter

            Why not use QMessageBox::setCheckBox()? If you do not use it, you must use layout(QGridLayout) as @jsulm mentions.

            1 Reply Last reply
            1
            • D davecotter

              i know you can add buttons into the button bar but what about a check box just above it? how ?

              kshegunovK Offline
              kshegunovK Offline
              kshegunov
              Moderators
              wrote on last edited by kshegunov
              #6

              @davecotter said in can i add a checkbox just above the buttons in a QMessageBox ?:

              i know you can add buttons into the button bar but what about a check box just above it? how ?

              It is in principle possible with some black magic incantations. However, if you want to customize it further than already suggested, I advise you to make your own custom message box dialog in designer and take it from there.

              Read and abide by the Qt Code of Conduct

              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