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. Windowflags for QInputDialog
Forum Updated to NodeBB v4.3 + New Features

Windowflags for QInputDialog

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 2.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.
  • chaf1984C Offline
    chaf1984C Offline
    chaf1984
    wrote on last edited by chaf1984
    #1

    Hi
    I want to remove the Contexthelp button in the toolbar. I have tried with the following code but it doesnt do anything.

    Qt::WindowFlags flags;
    flags = flags & ~Qt::WindowContextHelpButtonHint;
    QString text = QInputDialog::getText(this, tr("Rename page"),tr("Page Name:"), QLineEdit::Normal, tab->tabText(i),&ok,flags);
    

    Are there another way to remove the contexthelp button?

    RatzzR 1 Reply Last reply
    0
    • chaf1984C chaf1984

      Hi
      I want to remove the Contexthelp button in the toolbar. I have tried with the following code but it doesnt do anything.

      Qt::WindowFlags flags;
      flags = flags & ~Qt::WindowContextHelpButtonHint;
      QString text = QInputDialog::getText(this, tr("Rename page"),tr("Page Name:"), QLineEdit::Normal, tab->tabText(i),&ok,flags);
      

      Are there another way to remove the contexthelp button?

      RatzzR Offline
      RatzzR Offline
      Ratzz
      wrote on last edited by Ratzz
      #2

      @chaf1984
      you may try this

          QString text = QInputDialog::getText(this, tr("Rename page"),tr("Page Name:"), QLineEdit::Normal, tab->tabText(i),&ok,(this->windowFlags() & ~Qt::WindowContextHelpButtonHint));
      

      or

          Qt::WindowFlags flags = windowFlags();
      flags = flags & ~Qt::WindowContextHelpButtonHint;
      QString text = QInputDialog::getText(this, tr("Rename page"),tr("Page Name:"), QLineEdit::Normal, tab->tabText(i),&ok,flags);

      --Alles ist gut.

      1 Reply Last reply
      0
      • chaf1984C Offline
        chaf1984C Offline
        chaf1984
        wrote on last edited by
        #3

        @Ratzz said:

        (this->windowFlags() & ~Qt::WindowContextHelpButtonHint)

        The problem is when I use (this->windowFlags() & ~Qt::WindowContextHelpButtonHint) it gets the windowsflags from the mainwindow with mini and max buttons.
        But got what I wanted with this code

        (this->windowFlags() & ~Qt::WindowContextHelpButtonHint & ~Qt::WindowMinMaxButtonsHint)
        

        Are there a better way to do this?

        RatzzR 1 Reply Last reply
        0
        • chaf1984C chaf1984

          @Ratzz said:

          (this->windowFlags() & ~Qt::WindowContextHelpButtonHint)

          The problem is when I use (this->windowFlags() & ~Qt::WindowContextHelpButtonHint) it gets the windowsflags from the mainwindow with mini and max buttons.
          But got what I wanted with this code

          (this->windowFlags() & ~Qt::WindowContextHelpButtonHint & ~Qt::WindowMinMaxButtonsHint)
          

          Are there a better way to do this?

          RatzzR Offline
          RatzzR Offline
          Ratzz
          wrote on last edited by
          #4

          @chaf1984 said:
          May be from your code.

              Qt::WindowFlags flags = windowFlags();
              Qt::WindowFlags helpFlag =   Qt::WindowContextHelpButtonHint| Qt::WindowMinMaxButtonsHint;
              flags = flags & (~helpFlag);
          
            QString text = QInputDialog::getText(this, tr("Rename page"),tr("Page Name:"), QLineEdit::Normal, tab->tabText(i),&ok,flags);

          --Alles ist gut.

          1 Reply Last reply
          2
          • chaf1984C Offline
            chaf1984C Offline
            chaf1984
            wrote on last edited by
            #5

            Thanks for the help, got it working. The solution works and I can get going with the other stuff :)

            RatzzR 1 Reply Last reply
            0
            • chaf1984C chaf1984

              Thanks for the help, got it working. The solution works and I can get going with the other stuff :)

              RatzzR Offline
              RatzzR Offline
              Ratzz
              wrote on last edited by
              #6

              @chaf1984
              Glad it helped.
              Once your problem is solved use the Topic Tools button to mark as Solved.
              Thank you.

              --Alles ist gut.

              X 1 Reply Last reply
              1
              • RatzzR Ratzz

                @chaf1984
                Glad it helped.
                Once your problem is solved use the Topic Tools button to mark as Solved.
                Thank you.

                X Offline
                X Offline
                xamax
                wrote on last edited by xamax
                #7

                default constructor of Qinputdialog use Qt:WindowFlags() as default argument for window hint, then :
                Qt:WindowFlags(Qt:Dialog) & (~Qt::WindowContextHelpButtonHint)
                should work but it does not ...

                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