Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Solved]Creating Custom MessageBox

[Solved]Creating Custom MessageBox

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 4.3k Views
  • 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
    dreamerindia
    wrote on last edited by
    #1

    Dear all,

    I created the customized message box, like changing the color of text displayed,size of button,size if message window etc...

    How to make it as class so that i can access it similar to @#include <QMessageBox>@ like @#include<CustomMessageBox>@

    or can we change the font,size,color parameter of existing messageBox?

    Suggestions are welcome.

    ~Ravivarman~

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AcerExtensa
      wrote on last edited by
      #2

      If you have created your custom message box, it should be already an class, isn't it?
      Just pack it into the header & source files and use it....

      <QMessageBox> is just an text file with reference to qmessagebox.h

      For example you have called your class CustomMessageBox and have header and source file like:
      custommessagebox.h & custommessagebox.cpp (maybe custommessagebox.ui to)
      just create simple text file CustomMessageBox without extension and add include in this file:

      file CustomMessageBox
      @
      #include <custommessagebox.h>
      @

      thats all...

      you can then include your CustomMessageBox file and use your class:
      @
      #include <CustomMessageBox>

      CustomMessageBox box(...);
      box.exec(); //etc...
      @

      God is Real unless explicitly declared as Integer.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AlekseyOk
        wrote on last edited by
        #3

        You can change colors, alignment, font's parameters and etc. via Qt style sheets...

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dreamerindia
          wrote on last edited by
          #4

          yea dear AcerExtensa & AlekseyOk. tried both and both are working fine.thanks a lot.

          ~Ravivarman~

          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