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. Window Flags in Red Hat 6
QtWS25 Last Chance

Window Flags in Red Hat 6

Scheduled Pinned Locked Moved Unsolved General and Desktop
redhat 6windowflags
3 Posts 2 Posters 1.2k 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.
  • S Offline
    S Offline
    scassedy
    wrote on last edited by scassedy
    #1

    I have two objectives. First, to change the window title bar to only have the close button, so remove the minimize and maximize button. Second, get all of my application dialogues to appear in the task bar. I have done this successfully in a CentOS environment. The same code does not seem to work in Red Hat 6 as the minimize and maximize buttons remain in the title bar. The window flags used are as follows:

    Qt::WindowFlags flags = Qt::Window; //ensures my dialogues appear in the task bar.
    flags |= Qt::CustomizeWindowHint; //required to change some window settings
    flags |= Qt::WindowTitleHint; //adds the window title bar
    flags |= Qt::WindowCloseButtonHint; //adds the close button
    dialog.setWindowFlags(flags); //sets the window flags for the dialog

    The minimize and maximize buttons should not be appearing as I have not added the hints for them. Could this be an issue caused by the window manager ignoring/overriding the Qt window flags? I am struggling to find a solution using solely Qt code. I have tried adding the following to the flags in desperation attempts:

    flags &= ~(Qt::WindowMinimizeButtonHint); //attempt to remove minimize button
    flags &= ~(Qt::WindowMaximizeButtonHint); //attempt to remove maximize button

    I am using Qt 5.6.1. Any thoughts or solutions would be appreciated. Thanks.

    A 1 Reply Last reply
    0
    • S scassedy

      I have two objectives. First, to change the window title bar to only have the close button, so remove the minimize and maximize button. Second, get all of my application dialogues to appear in the task bar. I have done this successfully in a CentOS environment. The same code does not seem to work in Red Hat 6 as the minimize and maximize buttons remain in the title bar. The window flags used are as follows:

      Qt::WindowFlags flags = Qt::Window; //ensures my dialogues appear in the task bar.
      flags |= Qt::CustomizeWindowHint; //required to change some window settings
      flags |= Qt::WindowTitleHint; //adds the window title bar
      flags |= Qt::WindowCloseButtonHint; //adds the close button
      dialog.setWindowFlags(flags); //sets the window flags for the dialog

      The minimize and maximize buttons should not be appearing as I have not added the hints for them. Could this be an issue caused by the window manager ignoring/overriding the Qt window flags? I am struggling to find a solution using solely Qt code. I have tried adding the following to the flags in desperation attempts:

      flags &= ~(Qt::WindowMinimizeButtonHint); //attempt to remove minimize button
      flags &= ~(Qt::WindowMaximizeButtonHint); //attempt to remove maximize button

      I am using Qt 5.6.1. Any thoughts or solutions would be appreciated. Thanks.

      A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      @scassedy Since linux uses window managers and they can be customized by each distro it's hard to do stuff like this.

      What window manager/version are you using in red hat 6? What window manager/version are you using in centos?

      First things to do is determine that and then try to match them up. So match red hat to centos and try again. If you still have the issue then it is some setting that red hat has done differently. But that should give you an idea where to look for the solution.

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      S 1 Reply Last reply
      2
      • A ambershark

        @scassedy Since linux uses window managers and they can be customized by each distro it's hard to do stuff like this.

        What window manager/version are you using in red hat 6? What window manager/version are you using in centos?

        First things to do is determine that and then try to match them up. So match red hat to centos and try again. If you still have the issue then it is some setting that red hat has done differently. But that should give you an idea where to look for the solution.

        S Offline
        S Offline
        scassedy
        wrote on last edited by
        #3

        @ambershark Thanks for the input. I was afraid the window manager changes might be the issue. We are using KDE as our window manager. I have limited control on what I am allowed to change unfortunately. For now, I will likely move forward with work around. Since the applications dialogues now appear in the task bar, there is little downside to minimizing them. The issue was they would simply get "lost" when they were minimized. I was able to remove the maximize button by setting fixed size restraints on the dialogues. I will update the post if I ever figure out how to get the KDE settings and the Qt Window Flags to play nicely together. I have been investigating the kwindecorations settings, but had no luck yet.

        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