Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Struggling to remove toolbar [N9]



  • Hello,

    I am trying to remove the toolbar from an (otherwise) working application. My QML looks like this:

    @import QtQuick 1.1
    import com.nokia.meego 1.0

    PageStackWindow {
    id: rootWindow
    initialPage: mainPage
    showStatusBar: false
    showToolBar: false

    Page {

        id: mainPage
        orientationLock: PageOrientation.LockPortrait
        ...QML describing the page here...
    

    @

    I have also tried to use this:
    @PageStackWindow {
    id: rootWindow
    initialPage: mainPage
    showStatusBar: false

    ToolBarLayout {
    id: commonTools
    visible: false
    }

    Page {

    tools: null
    id: mainPage
    orientationLock: PageOrientation.LockPortrait
    @

    But to no avail. I'm pulling my hair out: how do I remove the toolbar?

    Many thanks,

    Robert



  • My template looks different than yours. Mine looks like this:

    @PageStackWindow {
    id: window
    initialPage: MainPage {tools: toolBarLayout}
    showStatusBar: false
    showToolBar: false@

    where the toolBarLayout is defined after this block. By commenting out the "{tools: toolBarLayout}" I'm able to get it to disappear.

    like so:

    @PageStackWindow {
    id: window
    initialPage: MainPage //{tools: toolBarLayout}
    showStatusBar: false
    showToolBar: false@

    probably not the most elegant solution :P let me know if you figure it out, thanks :)



  • Reptile,

    Thanks for your response - and I actually just figured it out. I was starting my app running .show(), when I should have been using showFullScreen(). In showFullScreen() my code (and yours) actually does what it's supposed to do...

    Oh well, glad it's working now :-)

    Cheers, Robert



  • rcs1000,

    Thanks very much for this - I was getting the toolbar in a non-QML application (just Qt and C++) and wasn't sure how to get rid of it.

    I replaced my show() and showMaximised() statements with showFullScreen() as you suggested and it works well.

    Thanks again!!


Log in to reply