Beispiel #1
0
 void EventHandlerList::remove(EventHandler* handler) {
   if (handler == firstHandler_)
     firstHandler_ = handler->next_;
   else
     handlerBefore(handler)->next_ = handler->next_;
   if (handler == nextHandler_) nextHandler_ = handler->next_;
   handler->next_ = 0;
 }
int main(int argc, char *argv[])
{
    qmlRegisterType<GridEqualizer>("mbrdna.qml.components", 1, 0, "GridEqualizer");
    qmlRegisterType<BeforeRenderItem>("mbrdna.qml.components", 1, 0, "BeforeRenderItem");

    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;
    viewer.setSurfaceType(QWindow::OpenGLSurface);

    QSurfaceFormat format;
    format.setSamples(8);
    viewer.setFormat(format);
    viewer.setMainQmlFile(QStringLiteral("qml/GridVisualization/main.qml"));
    viewer.showExpanded();

    //Connect Before RenderItem
    QObject::connect(&viewer, SIGNAL(beforeRendering()), BeforeRenderGlobal::Instance(), SLOT(handlerBefore()), Qt::DirectConnection);
    QObject::connect(&viewer, SIGNAL(afterRendering()), BeforeRenderGlobal::Instance(), SLOT(handlerAfter()), Qt::DirectConnection);

    return app.exec();
}