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. QMessageBox error
QtWS25 Last Chance

QMessageBox error

Scheduled Pinned Locked Moved General and Desktop
9 Posts 5 Posters 3.9k 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.
  • I Offline
    I Offline
    issam
    wrote on 8 Oct 2012, 15:13 last edited by
    #1

    Hi,
    I put a QMessageBox in a QMainwindow sub-class:

    @
    QMessageBox::StandardButton action = QMessageBox::warning(this, "Save", " ",
    QMessageBox::Save | QMessageBox::Discard , QMessageBox::Save);
    @

    When I run the application, and exactly every-time the message widget is shown, I get the following error message:

    @
    X Error: BadWindow (invalid Window parameter) 3
    Major opcode: 20 (X_GetProperty)
    Resource id: 0x780967c
    @

    The application, despite, still run.
    Has someone a solution for this problem ?

    http://www.iissam.com/

    1 Reply Last reply
    0
    • I Offline
      I Offline
      issam
      wrote on 9 Oct 2012, 20:25 last edited by
      #2

      Ooops :)

      http://www.iissam.com/

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mlong
        wrote on 10 Oct 2012, 14:43 last edited by
        #3

        Oops? Does that mean that you figured out the problem? If so, please let us know what it was so that others facing the same issue might be able to learn from your experience. (And be sure and mark the thread as [Solved] if so.)

        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
        • I Offline
          I Offline
          issam
          wrote on 10 Oct 2012, 17:56 last edited by
          #4

          Unfortunately ... no :(
          I am waiting for a solution :)

          http://www.iissam.com/

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Jeroentjehome
            wrote on 11 Oct 2012, 08:20 last edited by
            #5

            Maybe a suggestion, but try this:
            @
            int selection = msgBox.exec();
            if(selection == QMessageBox::Yes)
            @
            the enum StandardButtons might cause the problem. Normally the compiler should allocate enough memory space to hold the returned enum, but you never know ;-)
            Also the text (third part) can be set with "".
            Don't know what might go wrong otherwise.
            Does the program stops when the dialog is opened, or closed? At opening it would seem that the dialog has improper arguments, on close it might have to do with the return value.
            Greetz

            Greetz, Jeroen

            1 Reply Last reply
            0
            • U Offline
              U Offline
              uranusjr
              wrote on 11 Oct 2012, 08:41 last edited by
              #6

              The code itself has no problem. What you get is an X error — an error in the X Window System. Most likely there is a bug somewhere else. You might need to specify your environment (OS and Qt version, etc.).

              1 Reply Last reply
              0
              • I Offline
                I Offline
                issam
                wrote on 11 Oct 2012, 14:57 last edited by
                #7

                The method is a static member so I don't have to create a QMessageBox object ! And so I can't use
                QMessageBox::exec(). If you mean that I have to create a custom QDialog this is a point of view, but - as uranusjr said- it seems to be an X Window problem.
                I didn't understand what you mean by "You might need to specify your environment".

                http://www.iissam.com/

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  butterface
                  wrote on 11 Oct 2012, 22:19 last edited by
                  #8

                  He wants to know which operating system you use, which version of Qt and so on. Everything which might help to track down the problem on your specific or a more general environment.

                  1 Reply Last reply
                  0
                  • I Offline
                    I Offline
                    issam
                    wrote on 12 Oct 2012, 10:40 last edited by
                    #9

                    Ok :

                    • OS : GNU/Linux OpenSUSE 11.4 (32-bit)
                    • architecture : i686
                    • kernel 2.6.37.6-0.20-desktop
                    • KDE : 4.7.4
                    • Compiler : gcc 4.5.1
                    • Qt version : 4.7.4

                    Is this enough ?

                    http://www.iissam.com/

                    1 Reply Last reply
                    0

                    9/9

                    12 Oct 2012, 10:40

                    • Login

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