Windowflags for QInputDialog
Solved
General and Desktop
-
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?
-
@chaf1984
you may try thisQString 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);
-
@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?
-
@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);