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. Subclassing QMessageBox [Solved]
Forum Updated to NodeBB v4.3 + New Features

Subclassing QMessageBox [Solved]

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.8k 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.
  • G Offline
    G Offline
    go4sri
    wrote on last edited by
    #1

    I need to customize QMessageBox. I need to remove the Window Manager's title bar, and have one of my own. I am using "this ":http://qt-project.org/faq/answer/how_can_i_handle_events_in_the_titlebar_and_change_its_color_etc to create my own title bar, but how do I insert it into the message box's layout? I also need to replace the standard buttons and probably redo the background color of the box.

    Is it possible to subclass QMessageBox and achieve the above? is there any example anywhere for this?

    Or, should I just subclass Dialog and create my own message box?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      If you want to do that, take care of the side effects:

      If you remove the window managers title bar on windows, you loose all things like automatic full screen on double click of title bar, display in the task bar etc.

      And I do not think that deriving from QMessageBox and insert something in the layout at the top will work properly. I would create my own dialog or use OS things to achieve this (at least on windows :-) ).

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        go4sri
        wrote on last edited by
        #3

        Thank you. I implemented my own messagebox by subclassing QDialog

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mlong
          wrote on last edited by
          #4

          Be sure and edit your original post and add [Solved] to the title of the thread. Thanks!

          Software Engineer
          My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

          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