How to remove the bottom panel with buttons?

314 Views Asked by At

I was able to customize my installer based on Qt Installer Framework to some degree.

I was able to automate button click to advance to next page

gui.clickButton(buttons.NextButton)

hide the back button (by removing previous pages) and even disable the next button

Controller.prototype.DynamicMyPageCallback = function()
{
    var currentWidget = gui.currentPageWidget();
    if (currentWidget != null)
    {
        currentWidget.complete = false
    }
}

Next thing I would like to do is to remove the bottom panel which contains Next and Quit buttons. Is that possible?

enter image description here

2

There are 2 best solutions below

0
On

You can use the code below in the constructor of the class to delete the buttons. If you would like something else to be triggered when the user presses, take a look at the docs.

ui->buttonBox->clear();
0
On

In the C++ world every QWidget provides access to its children.

https://doc.qt.io/qt-5/qobject.html#children

You can shotgun blast via QObjectList *widgetList = findChildren();

step through in debugger to see what each child is

You are looking for a buttonGroup or buttonBox. Once you have a pointer to it you can simply ->hide()

You can remove some of the mystery if you create a QPoint() object known to be within the "panel at the bottom" but not in a button.

https://doc.qt.io/qt-5.14/qwidget.html#childAt-1

Qt is OpenSource. You can pull down the code

https://download.qt.io/archive/qt/

Find the source file that constructs the page you want, and look at its constructor. That will tell you what button box/group is and if it got a name.

Most likely there is something simple like buttons.hide or buttons.visible = false

I don't use QML or JavaScript

I ass-u-me your "buttons" are coming from a ButtonGroup https://doc.qt.io/qt-5/qml-qtquick-controls2-buttongroup.html

So you just need to find the ID assigned your ButtonGroup on that page and buttonGroupId.visible = false

If you want real help you have to post a link to complete code that compiles and runs. You also need to indicate what platform you are on.

Edit after doing some more digging:

You still need to post full code via some zip file or something, but here is the documentation trail.

https://doc.qt.io/qt-5/qml-qtquick-controls2-buttongroup.html#buttons-prop

https://doc.qt.io/qt-5/qml-qtquick-controls2-abstractbutton.html

https://doc.qt.io/qt-5/qml-qtquick-controls2-abstractbutton-members.html

When you track it all the way back to AbstractButton you come to what should be good enough for you.

parent : Item

https://doc.qt.io/qt-5/qml-qtquick-item.html#parent-prop

If buttons.NextButton.parent != null then you can buttons.NextButton.parent.visible = false