Better_Software_Header_MobileBetter_Software_Header_Web

Find what you need - explore our website and developer resources

Adapting SlideViewer to Qt Quick Controls

    MenuBar {
        id: menuBar

        Menu {
            title: "&File"
            MenuItem { text:"Open" }
        }

        Menu {
            title: "&Go"

            MenuItem {
                text: "&Next slide"
                shortcut: "Right"
                onTriggered: _slideDeckController.incrementPage(1)
            }

            MenuItem {
                text: "&Last slide"
                shortcut: "End"
                onTriggered: _slideDeckController.gotoSlide(_slideDeckController.total,0)
            }
        }
    }
Item {
  id: rootWindow
  Item {
    id: content
    // .... all the SlideViewer window content
  }
}
ApplicationWindow {
  id: rootWindow
  Item {
    id:content
    // .... all the SlideViewer window content
  }
  MenuBar {
    Menu {
      ...
    }
  }
}
QQmlApplicationEngine appEngine;
appEngine.addImportPath(":/qml");
appEngine.load(QUrl("qrc:///qml/SlideViewer/SlideViewerWindow.qml"));
Q_ASSERT(!appEngine.rootObjects().isEmpty());
QQuickWindow * const rootWin = qobject_cast<QQuickWindow*>(appEngine.rootObjects().front());
Q_ASSERT(rootWin);
Action {
  id: printAction
  text: "Print"
  shortcut: "Ctrl+P"
  onTriggered: _printer.start()
}
MenuBar {
  Menu {
    ...
    MenuItem { action:printAction }
    ...
  }
}
ApplicationWindow
{
  ColumnLayout {
    anchors.fill: parent
    Checkbox { id:skipHandoutPages; text: "Skip handout pages" }
    Checkbox { id:showClock; text: "Show clock" }
    RowLayout {
      anchors: { bottom: parent.bottom; right:parent.right}
      Button {
        text: "OK"
        onTriggered: ....
      }
    }
  } // of column layout
}

1 Comment

16 - Jul - 2014

Emmanuel

JamesTurner

James Turner

Senior Software Engineer & Teamlead