Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • Create attached properties in c++

    Solved
    2
    0 Votes
    2 Posts
    227 Views
    N
    i was suggested in dicord by @GrecKo to change: Component.onCompleted: {console.log("isCurrentPAge", a.SideMenu.isCurrenPage)} to: Component.onCompleted: {console.log("isCurrentPAge", a.T.SideMenu.isCurrenPage)} apparently the alias is not just for object instantiating..
  • ScrollView: only get visible drawing area?

    Solved
    2
    0 Votes
    2 Posts
    252 Views
    T
    To solve this, I use a ListView to divide the area in segments, 8.000 pixel each. ListView { id: graphicView anchors.fill: parent orientation: Qt.Horizontal spacing: 0 // always repaint items on scroll reuseItems: false // the width of the scrollable area readonly property real displayWidth: 64000 // define a max width for segmentation to avoid the contentWidth limitation of qml readonly property int segmentWith: 8000 readonly property int segmentCount: Math.max(1, Math.round(displayWidth / segmentWith)) onSegmentCountChanged: { console.log("OsziGraphic: displayWidth = " + displayWidth + ", segmentCount = " + segmentCount); } model: graphicView.segmentCount delegate: OsziGraphicViewModel { height: ListView.view.height width: graphicView.displayWidth / graphicView.segmentCount segmentIndex: index } } In the backend I inherit from QQuickPaintedItem to add properties for the current segment index and the render area to draw in. I translate the rendered coordinates to draw as if the entire area is used. void QQuickSegmentedPaintedItem::paint(QPainter *painter) { if (m_segmentIndex == -1) return; // calculate the current render rect inside the drawing area m_renderRect = QRect(m_segmentIndex * boundingRect().width(), 0, boundingRect().width(), boundingRect().height()); // move the drawing area relative to the current render area painter->translate(-m_renderRect.left(), 0); } This works nicely for my needs. I hope you get the idea. cheers!
  • Open a secondary window ans sent messages to it

    Solved qml window messages
    3
    0 Votes
    3 Posts
    468 Views
    GrecKoG
    You can check the status of component with its status property and the errorString() method.
  • Override CloseEvent for qml file in Qt Creator and python

    Solved
    4
    0 Votes
    4 Posts
    607 Views
    ndiasN
    @JustAbhi said in Override CloseEvent for qml file in Qt Creator and python: So now I am facing a new bug (I think its a bug). Your Answer is correct it does what I want but then the Qt Creator has a problem with the above mentioned line. The error pops up in Qt Creator when editing the qml file and prevents the design tab to open. The error goes something like: Invalid property name "onClosing". (M16) Yes it is a QT Creator issue. This issue has already been reported in: https://bugreports.qt.io/browse/QTCREATORBUG-13347
  • Compiled qml sources visible inside executable

    Unsolved
    23
    0 Votes
    23 Posts
    7k Views
    K
    As a workaround we can use QMAKE_RESOURCE_FLAGS += -threshold 0 for QMake projects. All the files from resources will be compressed and most part of the QML code will be hidden. The reason why all QML files are included to the final executable when QtQuickCompiler is turned on is described here.
  • Custom streamer pipeline in QML

    Unsolved qml gstreamer gstreamer video video udp stream
    15
    0 Votes
    15 Posts
    4k Views
    JoeCFDJ
    @vicky_mac said in Custom streamer pipeline in QML: module org.freedesktop.gstreamer.GLVideoItem if vaapi is used in the pipeline on linux, install libva-dev
  • How to import an existing (singleton) c++ object to QML?

    Solved
    2
    0 Votes
    2 Posts
    264 Views
    X
    Sorry, I misunderstood some concepts. Now running with: Backend backend; QQmlApplicationEngine engine; engine.rootContext()->setContextProperty("backend", &backend); class Backend : public QObject { Q_OBJECT QML_ELEMENT
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Cannot run static qmake with qt qml and quick plugins

    Unsolved
    1
    0 Votes
    1 Posts
    109 Views
    No one has replied
  • Determining properties of an item in a ListView given other items in the ListView

    Unsolved
    2
    0 Votes
    2 Posts
    136 Views
    fcarneyF
    I think you will have to use https://doc.qt.io/qt-5/qml-qtquick-listview.html#itemAtIndex-method to get the Item before and after the current item. I think if it is not rendered it may return null. But if that is the case it should be off screen. let beforeitem = <listviewid>.itemAtIndex(index-1) let afteritem = <listviewid>.itemAtIndex(index+1) Probably need to do check with isChecked to trigger changes. Might need to be tricky and fire off events or create a signal that fires anytime any isChecked changes. You can use Qt.callLater to make sure the event is not called for every item all the time.
  • Extending networking/socket programming functionality of a qml project

    Unsolved
    92
    0 Votes
    92 Posts
    19k Views
    SGaistS
    You should setup wireshark and check what happens exactly. At some point you wrote you had a timeout error, that's one of the thing you should resolve first it means that one side fails to connect to the other. Don't forget one important thing: your server needs to be accessible from outside of your network especially if you connect to it from a mobile device. You will have lots of items between your server and client like firewalls, NAT layers and whatnot.
  • How to set boundsBehavior for ScrollView?

    Unsolved
    1
    0 Votes
    1 Posts
    152 Views
    No one has replied
  • How can I solve the "QML module not found (QtQuick.Controls.Styles)

    Unsolved
    2
    0 Votes
    2 Posts
    601 Views
    M
    I have QT Creator in Windows and Ubuntu, the version is 7.0.2, and both occurs the same problem.
  • Hi, I have a qml integrate problem

    Unsolved
    4
    0 Votes
    4 Posts
    231 Views
    SGaistS
    There's no data because there's nothing using your CommSerial object on the QML side. By the way, calling a C++ class QmlWorker and then naming it Dlg in your QtQuick code does not make your code easy to understand.
  • Stop camera without going to Camera.LoadedStatus?

    Unsolved
    1
    0 Votes
    1 Posts
    116 Views
    No one has replied
  • 0 Votes
    4 Posts
    2k Views
    T
    Hello guys, I'm quite often facing the same problem. Who to fix this problem?
  • Google Map api metrics (api key) not working with vladest plugin

    Unsolved
    1
    0 Votes
    1 Posts
    217 Views
    No one has replied
  • 0 Votes
    1 Posts
    150 Views
    No one has replied
  • send data from QUDPsocket c++ to QML UI fail

    Unsolved qml qnetwork qqmlcontext
    1
    0 Votes
    1 Posts
    302 Views
    No one has replied
  • how to add virtual keyboard for qlineedit

    Unsolved
    1
    1 Votes
    1 Posts
    314 Views
    No one has replied