XdgMenuWidget::XdgMenuWidget(const XdgMenu& xdgMenu, const QString& title, QWidget* parent): QMenu(parent), d_ptr(new XdgMenuWidgetPrivate(this)) { d_ptr->init(xdgMenu.xml().documentElement()); setTitle(title); }
ConfigPaneModel(): QAbstractListModel() { QString menuFile = XdgMenu::getMenuFileName("config.menu"); XdgMenu xdgMenu; xdgMenu.setEnvironments(QStringList() << "X-LXQT" << "LXQt" << "LXDE"); bool res = xdgMenu.read(menuFile); if (!res) { QMessageBox::warning(0, "Parse error", xdgMenu.errorString()); return; } DomElementIterator it(xdgMenu.xml().documentElement() , "Menu"); while(it.hasNext()) { this->buildGroup(it.next()); } }