Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
19.8k Topics 76.7k Posts
  • 0 Votes
    1 Posts
    91 Views
    No one has replied
  • MapItemView and resizing

    Unsolved
    1
    0 Votes
    1 Posts
    104 Views
    No one has replied
  • Dynamically add point to LineSeries of QML Qt Graphs

    Solved
    8
    0 Votes
    8 Posts
    603 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
    408 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())
  • 0 Votes
    1 Posts
    91 Views
    No one has replied
  • Adding jpg files on GUI

    Unsolved
    2
    0 Votes
    2 Posts
    169 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
    161 Views
    Axel SpoerlA

    Which Qt Version are you using?

  • 0 Votes
    3 Posts
    221 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
    425 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.

  • 0 Votes
    2 Posts
    157 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).

  • 0 Votes
    12 Posts
    544 Views
    GrecKoG

    In some Qt Quick Controls styles the icon are rendered in monochrome. Linux has a different default style than window.

  • 0 Votes
    3 Posts
    209 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
    326 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
    328 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
    2k 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.

  • 0 Votes
    6 Posts
    330 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
    196 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
    244 Views
    No one has replied
  • Delegate creation and multithreaded property updating

    Solved
    47
    0 Votes
    47 Posts
    5k 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
    147 Views
    SGaistS

    Hi,

    I think that's a question better asked directly to the GammaRay authors