Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Dynamically add point to LineSeries of QML Qt Graphs

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    W
    It's okay, it fixed itself ! The move to Qt6.8 has taken QtGraphs out of Technology Preview status, and functions like append(x,y) that weren't accessible in QML now are.
  • scintilla

    Unsolved
    6
    0 Votes
    6 Posts
    615 Views
    SGaistS
    I found a simpler way to do it, see the following: import pathlib import sys from PyQt5.QtGui import QFont, QFontMetrics, QColor from PyQt5.QtWidgets import QApplication from PyQt5.Qsci import QsciScintilla, QsciLexerPython class SimplePythonEditor(QsciScintilla): def __init__(self, parent=None): super().__init__(parent) # Set the default font font = QFont() font.setFamily("Courier") font.setFixedPitch(True) font.setPointSize(10) self.setFont(font) # Margin 0 is used for line numbers fontmetrics = QFontMetrics(font) self.setMarginsFont(font) self.setMarginWidth(0, fontmetrics.width("00000") + 6) self.setMarginLineNumbers(0, True) self.setMarginsBackgroundColor(QColor("#cccccc")) lexer = QsciLexerPython() lexer.setDefaultFont(font) self.setLexer(lexer) if __name__ == "__main__": app = QApplication(sys.argv) editor = SimplePythonEditor() editor.show() editor.setText(pathlib.Path(sys.argv[0]).read_text()) sys.exit(app.exec())
  • Two USB camera sessions not loading simultaneously - QT 6, Camera (QTMultimedia)

    Unsolved
    1
    0 Votes
    1 Posts
    134 Views
    No one has replied
  • Adding jpg files on GUI

    Unsolved
    2
    0 Votes
    2 Posts
    244 Views
    JonBJ
    @JLouis56 Not 100% sure what you are saying, but the The Qt Resource System allows you to embed resources like JPG files inside your executable. Then there is nothing to store externally, when you run the program outside Creator or release it to someone else the images are accessed by your application inside itself.
  • 0 Votes
    2 Posts
    238 Views
    Axel SpoerlA
    Which Qt Version are you using?
  • 0 Votes
    3 Posts
    377 Views
    M
    I understand. From now on, we will not add photos and will display it as text. Thanks for your reply.
  • how to use QML ListModel in C++?

    Unsolved
    7
    0 Votes
    7 Posts
    875 Views
    mzimmersM
    @flaudio I could do that, but I greatly want to keep that second parameter a QVariant. This function is eventually going to be used for a variety of purposes, and I'll need to convert that argument to several different things.
  • How to add animation to Canvas for multiple dynamic corrdinates

    Unsolved
    2
    0 Votes
    2 Posts
    236 Views
    F
    Hi @KeshavJ, I don't think that there are other ways to use animation in canvas. Using canvas you can handle pixel by pixel movement using a Timer (very ugly alternative). Instead of using canvas, have you tried a Shape component? It could be a valid alternative. Advantages: use declarative programming (real qml power) and higher performance (test with a qml profiler). Disadvantages: less flexible (i.e. fixed number of points to draw).
  • When I pass the code to Windows the icons are black and white

    Moved Solved
    12
    0 Votes
    12 Posts
    1k Views
    GrecKoG
    In some Qt Quick Controls styles the icon are rendered in monochrome. Linux has a different default style than window.
  • Needle trailing color/glow effect using Shader Effect on Qt6 QML

    Solved
    3
    0 Votes
    3 Posts
    364 Views
    D
    Yea exactly @Lord_Naikon thank you for your support I just made two uniform buf with same set of data as mentioned now its working. Thank you soo much
  • show scrollbar by default - ScrollView

    Solved
    3
    0 Votes
    3 Posts
    491 Views
    A
    could u add the example code for this
  • I want to see map with cmake, qml. But it's not working

    Solved
    6
    0 Votes
    6 Posts
    546 Views
    D
    MinGW perfectly works now !!!! If anyone moving MSVC->MinGW you should check project cmake's "Current Configuration". which would be set to C:/Qt/5.15.2/msvc2019_64/ ~~~. It must be changed to C:/Qt/5.15.2/mingw81_64/~~~ And in QML file, Map field should have "achors.fill: parent" All fixed well. super thanks to @SGaist you saved my life
  • how to cause view to update based on model change?

    Solved
    31
    0 Votes
    31 Posts
    5k Views
    mzimmersM
    Thanks for all the help, guys. I was able to get this working like so: GridView { required property Space space property var spaceFeatureList: sceneModel.featureUuidList(false, space.uuid) ListModel { id: spaceFeatureListModel } Component.onCompleted: { spaceFeatureListModel.clear() for (var i = 0; i < spaceFeatureList.length; i++) { spaceFeatureListModel.append({ "uuid": spaceFeatureList[i] }) } } model: spaceFeatureListModel Connections { target: sceneSetupPane function onFeatureListChanged(spaceId, activityId, status) { if (spaceId.localeCompare(space.uuid) === 0) { if (status) { var i for (i = 0; i < spaceFeatureListModel.count; i++) { if (spaceFeatureListModel.get(i).uuid === activityId) { break } } if (i >= spaceFeatureListModel.count) { spaceFeatureListModel.append({ "uuid": activityId }) } } else { for (i = 0; i < spaceFeatureListModel.count; i++) { if (spaceFeatureListModel.get(i).uuid === activityId) { spaceFeatureListModel.remove(i) break } } } } } } The function could probably use some optimizing, but it works. Thanks again.
  • LineSeries in ChartView only visible on my machine with OpenGL enabled

    Unsolved
    6
    0 Votes
    6 Posts
    673 Views
    SGaistS
    IIRC, the app version and driver version might not be linked. As for Qt Graph, AFAIK, the goal is for it to replace Qt Charts in an improved way but I haven't had the occasion to use it yet so I am sorry I can't be of more use on that front.
  • How to click (pick) a 3D object?

    Unsolved
    3
    0 Votes
    3 Posts
    295 Views
    Anton1978A
    the question is resolved - you can delete it, the problem is that for some reason the model 3d inside Node does not respond to clicks. I will find out why.
  • QtWebEngineProcess stays alive after QML scene destruction

    Unsolved
    4
    1 Votes
    4 Posts
    360 Views
    No one has replied
  • Delegate creation and multithreaded property updating

    Solved
    47
    0 Votes
    47 Posts
    9k Views
    A
    I prefer less logic in when I call a function, and more logic where the function simply exits when some parameters are still missing, but that's a...philosophical difference.
  • GammaRay and secondary windows

    Unsolved
    2
    0 Votes
    2 Posts
    208 Views
    SGaistS
    Hi, I think that's a question better asked directly to the GammaRay authors
  • Android emulator blank screen and 0x502 error

    Unsolved
    10
    1 Votes
    10 Posts
    4k Views
    M
    I don't know whats happened. But after trying today, the problem perished. Maybe an sdk update did it. Don't hope it will get back. Problem solved for now.
  • This topic is deleted!

    Solved
    1
    0 Votes
    1 Posts
    16 Views
    No one has replied