[SOLVED] flipable in Qt C++



  • How to create a new Flipable element with C++?



  • Very easy to do in QML :)



  • I have done it, but i cannot open the qml file, which i insercted in a resource file.
    See at here:
    @
    <RCC>
    <qresource prefix="/bandiere">
    <file>Immagini/Deutschland.png</file>
    <file>Immagini/España.png</file>
    <file>Immagini/France.png</file>
    <file>Immagini/Italia.png</file>
    <file>Immagini/UK.png</file>
    </qresource>
    <qresource prefix="/QML">
    <file>QML/flipableCard.qml</file>
    </qresource>
    </RCC>
    @

    where the qml file' s path is [project path]/QML/flipableCard.qml

    and in the code to open it i wrote:
    @
    this->rootContext()->setContextProperty(QString("modelSezioni"), QVariant::fromValue(listaSezioni));
    this->setSource(QUrl("qrc:/QML/flipableCard.qml"));
    QObject v = this->rootObject();
    QObject::connect(v, SIGNAL(selected(QString)), this, SLOT(open(QString)));
    @
    where listaSezioni is a QList<QObject
    > variable.
    The application return the error:
    @
    qrc:/QML/flipableCard.qml: File not found
    QObject::connect: Cannot connect (null)::selected(QString) to Widget1::open(QString)
    @



  • i think i just solved it:
    @
    this->rootContext()->setContextProperty(QString("modelSezioni"), QVariant::fromValue(listaSezioni));
    this->setSource(QUrl("qrc:/QML/QML/flipableCard.qml"));
    QObject *v = this->rootObject();
    QObject::connect(v, SIGNAL(selected(QString)), this, SLOT(open(QString)));
    @



  • -Or are you talking about a flippable widget - not QML ?-

    -here is an "example":http://qt-apps.org/content/show.php/QFlipWidget?content=98337-

    Edit:- Sorry I checked later



  • thank you equally Sam! =)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.