Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Dynamically allocating images

    2
    0 Votes
    2 Posts
    819 Views
    S
    Try repeater, ListView or other view according to your need //pseudo codes @ ListModel{ id: photoModel ListElement{name: "movie_list1"} //....and so on } ColumnLayout{ Repeater { model: photoModel Image { width: 100; height: 40 x: -342; y: 502 source: name } } } @ or a more simple one @ property var names : {"movie1", "movie2"} ColumnLayout{ Repeater { model: names Image { width: 100; height: 40 x: -342; y: 502 source: modelData } } } @
  • 3 pages circular ListView

    1
    0 Votes
    1 Posts
    776 Views
    No one has replied
  • [Solved]What is the data type of list<string> on c++ site?

    4
    0 Votes
    4 Posts
    2k Views
    S
    Whatever, the document of the FileDialog and FileDialog itself are mismatch. document @ filePath : string filePaths : list<string> @ But in Qt5.1RC, I have to use fileUrl or fileUrls to access the address of the files.Maybe this is because this is RC but not a formal release
  • [SOLVED]Segmentation fault on QQuickView::rootObject()

    10
    0 Votes
    10 Posts
    6k Views
    T
    Well, I'm finding this new issue to be increasingly difficult to fix, but because my original issue was resolved, I'm going to go ahead and label this thread as solved, the issue was that qmlGui was NULL, and therefore didn't have the QQuickView member. The next issue I'm having I'm experimenting with a different solution other than using QQuickView::rootObject() to connect to the signal, instead I'm working on using Q_PROPERTY(READ and NOTIFY) instead.
  • Qt Run Time Error-Error code 3

    3
    0 Votes
    3 Posts
    2k Views
    W
    I have encountered the same problems, even run the program created by qt wizard. The problem only happens in QtQuick 2.0, and does not appear in QtQuick 1.1. Thank you!
  • 0 Votes
    18 Posts
    12k Views
    S
    I am glad that lots of informative stuff is shared here! I am a beginner and in web development and I have some doubts regarding them! Can you suggest the best ways to change the visual layouts? In addition please tell me how style sheets operation change in two mark ups? http://www.outlookrepairhelp.com
  • Sending Email to any server in Qt

    12
    0 Votes
    12 Posts
    9k Views
    A
    Thanks sir, I came to understand your thoughts......TLS means Transport Layer Security protocol,Ok now wat i need to do....How can we send the mail by inserting that STARTTLS command.....could you please explain it in technical way(in coding style)..Please favour me an example..thanks in advance
  • QML designer is very slow

    3
    0 Votes
    3 Posts
    2k Views
    L
    Try start twice QtCreator. In my case second process running well.
  • Breaking up QML into different files. [solved]

    7
    0 Votes
    7 Posts
    4k Views
    G
    Are you using absolute path or relative path? Be also aware which qml file is loading the other qml file. I have encountered this problem sometimes, you find the file using Qt Creator, but when you are running the application it might be that the main.qml file is using a Component from another qml file ( that is also in another directory), and that Component is using a JS from another directory again.
  • [SOLVED} filling a ListView with a custom Model?

    11
    0 Votes
    11 Posts
    7k Views
    M
    hah I got it to work! The problem was one of the functions of util.cpp was not working as intended which is used to get role names. some posts before, i mentioned overriding QAbstractListModel::setRoleNames is depracted as of Qt5.. so overriding QAbstractListModel::roleNames() is the new way to go.. it all happens in the constructor of GenericModel util.cpp - not in use anymore @ void extractObjectProperties(const QMetaObject *object, QStringList *list, bool cleanup, const char *prefix) { QStringList &properties = *list; const int count = object->propertyCount(); for (int i = 0; i < count; ++i) { QString propertyName = object->property(i).name(); if (propertyName.startsWith(prefix)) { properties << propertyName; } } if (cleanup) { properties.replaceInStrings(prefix, ""); } } @ genericmodel.cpp - before, little bit modified from the example @ template <class ModelTemplate> GenericModel<ModelTemplate>::GenericModel(QObject *parent, bool cleanupPrefix) : GenericModelBase(parent), m_cleanup(cleanupPrefix), m_propertyCount(0) { //const ModelTemplate object; QStringList properties; ModelTemplate tmp; Utils::extractObjectProperties(tmp.metaObject(), &properties, m_cleanup); m_propertyCount = properties.count(); } ... template <class ModelTemplate> QHash<int, QByteArray> GenericModel<ModelTemplate>::roleNames() const{ QHash<int, QByteArray> roles; QStringList properties; ModelTemplate tmp; Utils::extractObjectProperties(tmp.metaObject(), &properties, m_cleanup); for (int i = 0; i < properties.count(); ++i) { roles[i] = properties[i].toUtf8(); //qDebug() << roles[i] << "hello"; } return roles; } @ it's rather self explanatory, all the Q_PROPERTIES i defined at project.h get collected and should be returned by that function, so qml knows about the properties properly using the QAbstractListModel::roleNames() so the huge key thing here was understanding that: roles (cpp) = properties (qml). or it wont work. the function provided in the example had some sort of filter for whatever reason, i just copy/cut/pasted my version without that filter and voila, it worked. here is the proper function for the genericmodel class which got it to work for me :) genericmodel.cpp - after @ template <class ModelTemplate> GenericModel<ModelTemplate>::GenericModel(QObject *parent, bool cleanupPrefix) : GenericModelBase(parent), m_cleanup(cleanupPrefix), m_propertyCount(0) { ModelTemplate tmp; m_propertyCount = tmp.metaObject()->propertyCount(); for (int i = 0; i < m_propertyCount; ++i) { QString propertyName = tmp.metaObject()->property(i).name(); m_roles[i] = propertyName.toUtf8(); } } ... template <class ModelTemplate> QHash<int, QByteArray> GenericModel<ModelTemplate>::roleNames() const{ return m_roles; } @ as you can see i have added also a member variable called QHash<int, > m_roles for storing. oh btw, dont be confused about the product / project thing.. if someone in the future has a similar problem i'm glad to provide further code/explanations so dont hesitate to grave dig it up or PM me. thanks for your help gennon
  • Signal from C++ in QML

    3
    0 Votes
    3 Posts
    2k Views
    T
    So I did. @ //interfaceqml.cpp InterfaceQML::InterfaceQML(QObject *parent) : QObject(parent) { t = 0; emit newSignal(t); } ... @ @ //mainwindow.cpp MainWindow::MainWindow(QObject *parent) : QObject(parent) { timer = new QTimer; view = new QQuickView; qmlRegisterType<InterfaceQML>("Interface", 1, 0, "Interface"); view->setSource(QUrl("file:/main.qml")); view->show(); QObject *pObject = view->rootObject(); InterfaceQML *interface = pObject->findChild<InterfaceQML *>(); connect(timer, SIGNAL(timeout()), interface, SLOT(newSlot())); timer->start(500); } @ Thanks
  • How to display raw image data with qml?

    3
    0 Votes
    3 Posts
    4k Views
    L
    Thanks, it seems is what i need.
  • Inserting and pulling images from sql [solved]

    3
    0 Votes
    3 Posts
    2k Views
    P
    I am not sure if it is a good practice to store images into database. You should define your column as BLOB. You will need to write some C++ class to get binary data of image you want to save. and to display image from binary data retrieved from DB. As for me I would save images in file system and store their paths in database, I think that it is better and more simple solution.
  • Flickable interface with snapping to certain spots

    2
    0 Votes
    2 Posts
    964 Views
    P
    Maybe "PathView":http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-pathview.html will help you.
  • I need help for finish task. can pay

    3
    0 Votes
    3 Posts
    1k Views
    J
    Development for project application need. the project is write in qml. 1- Integrate maliit keyboard on screen at project. 2- List info from mysql database in qml interface. similar to mobile. best regards!
  • [SOLVED] Can't set the window icon for QML application

    11
    0 Votes
    11 Posts
    15k Views
    L
    It works so I don't dare mess with it further. Marking this as solved.
  • Plug and paint example in Qt5 [SOLVED]

    6
    0 Votes
    6 Posts
    4k Views
    A
    Thank you Mr.Guigui ...compiled successfully..
  • 0 Votes
    5 Posts
    4k Views
    T
    Ok, cool, this is putting me in the right direction, thanks for the help. And that was actually a typo when I added the '()' on the 'onReady', I already knew about that syntax :P But I wouldn't have thought about passing the dialog as a property.
  • Qml2 camera crash on wni7 64bits(simple codes)

    1
    0 Votes
    1 Posts
    824 Views
    No one has replied
  • [PROBLEM]::can't find a way to cooperate with .cpp file

    6
    0 Votes
    6 Posts
    2k Views
    J
    thank you SO MUCH!!!