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. [SOLVED] Window Title Disappearing on Mac after Hide in 5.2.0, didn't happen in 5.1.2

[SOLVED] Window Title Disappearing on Mac after Hide in 5.2.0, didn't happen in 5.1.2

Scheduled Pinned Locked Moved General and Desktop
9 Posts 2 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.
  • E Offline
    E Offline
    EricRFMA
    wrote on last edited by
    #1

    This could be related to this issue here: "https://bugreports.qt-project.org/browse/QTBUG-33011
    ":https://bugreports.qt-project.org/browse/QTBUG-33011

    I create a dialog box, which displays properly with the window title (and minimize, maximize and close buttons).
    After I hide it, change its location, then change its colors, set the window flags, and after I show it again with window title bar is gone.

    This wasn't a problem in 5.1.2, but appeared in 5.2.0. In 5.1.2 I set the window flags like this:

    @setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint);@

    and I had no problems until 5.2.0. I tried 5.2.1 (current stable branch), and the problem is still there. But if I set the window flags like this:

    @setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);@

    then I get the title bar back.

    So I have a workaround, but it seems like a regression to me.

    I can come up with a (hopefully) small test case if needed. I'm running on Mac OS 10.8.5.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Yes, a test case would be very good

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • E Offline
        E Offline
        EricRFMA
        wrote on last edited by
        #3

        (I tried posting this reply once, and it disappeared into the ozone... hope this attempt fares better)

        I got a simple test case :) I built it with 5.2.1 (stable) and the problem occurs. If I build it with 5.1.0, no problem (the window title stays put).

        @#include <QApplication>
        #include <QDialog>
        int main(int argc, char *argv[])
        {
        QApplication a(argc, argv);

        QDialog *dialog = new QDialog();

        dialog->show(); // appears with window title

        dialog->hide();

        dialog->setWindowFlags(
        Qt::Dialog |
        Qt::CustomizeWindowHint |
        Qt::WindowStaysOnTopHint);

        dialog->show(); // in 5.1, window title is there but not in 5.2.1 (or 5.2.0)

        return a.exec();
        }
        @

        That should reproduce the problem... please let me know if it doesn't or if there's anything else I can do.

        Thanks!

        -Eric

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Don't worry, it does show the behavior.

          Looking at the sources, I can't say it's a regression, in fact it looks like it's 5.1 that didn't have the correct behavior.

          Qt::CustomizeWindowHint means "turn off the default window title hints" From there you can customize it to your liking (title, button etc.) Something that it seem you could not do in 5.1

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • E Offline
            E Offline
            EricRFMA
            wrote on last edited by
            #5

            Ah, OK, so it was an intentional change in behavior from 5.1 to 5.2? Was it a bug fix?

            Thanks for the clarification!

            -Eric

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              As far as I can tell, yes.

              The log says:

              bq.
              This ensures that the possible window flag combinations are respected
              where possible in Cocoa.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • E Offline
                E Offline
                EricRFMA
                wrote on last edited by
                #7

                Great... thanks!

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  You're welcome !

                  If this answers your question, please update the thread title prepending [solved] so other forum users may know it's all good :)

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • E Offline
                    E Offline
                    EricRFMA
                    wrote on last edited by
                    #9

                    Done!

                    And I tagged it "solved" as well :)

                    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