Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
19.8k Topics 76.6k Posts
  • Cannot load pdf in the app works only for the single file

    Unsolved
    8
    0 Votes
    8 Posts
    355 Views
    R

    I made a minimal app to test this that can be used in Qt Creator.
    https://send.trom.tf/f.php?h=2oDBNgjD&d=1&k=9971ab3cdf02f0eccc0869282e76a147

    Running

    qml6 Main.qml

    works but running the app has status 0.

  • Issue with Shadow Blur Rendering in MultiEffect (Qt 6.7.1)

    Unsolved
    1
    0 Votes
    1 Posts
    19 Views
    No one has replied
  • QML Map in a scrollview

    Unsolved
    1
    0 Votes
    1 Posts
    20 Views
    No one has replied
  • 0 Votes
    6 Posts
    5k Views
    RokeJulianLockhartR

    From what I see, the vertical line is a QFrame element with VLine settings.

    Using stackoverflow.com/review/suggested-edits/36711790, that:

    separator_line = PyQt6.QtWidgets.QFrame() separator_line.setFrameShape(PyQt6.QtWidgets.QFrame.Shape.HLine) separator_line.setFrameShadow(PyQt6.QtWidgets.QFrame.Shadow.Sunken)

    ...seems to render in the correct orientation for me:

    Before

    0dd1b2f4-2c92-4fd0-8f95-d070c0a84640-Screenshot_20250209_190842.png

    Afterward

    ...albeit invisibly (it should be between "Modify" and "Overflow"):

    62ba634c-b9d0-4bb7-9169-c8332fa1aa65-Screenshot_20250209_193706.png

  • custom style for virtual keyboard

    Unsolved
    7
    0 Votes
    7 Posts
    510 Views
    mzimmersM

    I bet you guys thought I'd forgotten about this...

    So, I've added this to my CMakeLists.txt file:

    add_compile_definitions( CMAKE_BINARY_DIR="${CMAKE_BINARY_DIR}" CMAKE_PROJECT_NAME="${CMAKE_PROJECT_NAME}" )

    And, in my main.cpp:

    QString stylePath = CMAKE_BINARY_DIR; stylePath.append("/"); stylePath.append(CMAKE_PROJECT_NAME); stylePath.append("/QtQuick/VirtualKeyboard/Styles/test"); stylePath = QDir::toNativeSeparators(stylePath); qputenv("QT_VIRTUALKEYBOARD_STYLE", stylePath.toUtf8()); QGuiApplication app(argc, argv); QQmlApplicationEngine engine; engine.addImportPath(":/QtQuick/VirtualKeyboard/Styles/test");

    But at runtime, I get a warning:

    WARNING: Cannot find style "C:\\Users\\michael.zimmers\\Qt_projects\\keyboard\\build\\Desktop_Qt_6_8_1_MinGW_64_bit-Debug\\keyboard\\QtQuick\\VirtualKeyboard\\Styles\\test" - fallback: "default"

    Does anyone have an idea as to what am I missing?

    Thanks...

  • QML TextArea performance with large data buffers

    Unsolved
    6
    0 Votes
    6 Posts
    301 Views
    B

    @afalsa thanks for those links. I have only looked at the first one and skim read it, but it seems like they ended up with a very similar solution to mine. That is reassuring in the sense that there doesn't seem to be a much simpler approach that I missed. I don't recall finding that page when I had the issue, but I suspect I was grappling with it a year or two before that was written.

  • Why is setPreeditText not directly available in QML?

    Unsolved
    3
    0 Votes
    3 Posts
    102 Views
    jeremy_kJ

    According to the documentation, https://doc.qt.io/qt-5/qml-qtquick-virtualkeyboard-inputcontext.html#preeditText-prop:

    preeditText : string

    This property sets the pre-edit text.

    The property isn't marked read-only, indicating that an application can assign to it.

  • a generic qml label for display of an image and a text

    Unsolved
    2
    0 Votes
    2 Posts
    830 Views
    SavizS

    @JoeCFD said in a generic qml label for display of an image and a text:

    any recommendations for making a generic qml label to display an image and a text?

    If by "image and text" you mean a label that displays an icon (e.g., SVG) alongside text, you can use the IconLabel type. While there is no official documentation for it, you can view its source code. It allows you to assign text, an icon, and even customize the layout.

    For example, this is how it is used in a Button:

    Button { id: control property real radius: 0 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) opacity: control.enabled ? 1 : 0.5 padding: 6 spacing: 6 icon.width: 24 icon.height: 24 contentItem: IconLabel { id: iconLabel spacing: control.spacing mirrored: control.mirrored display: control.display // Controls Layout icon: control.icon // Icon text: control.text // Text font: control.font } }

    If by "image" you mean PNG or other non-icon image types, your best option is to use an Image type alongside a Text or Label type within a layout.

    I don’t see any other straightforward approach.

  • 0 Votes
    9 Posts
    234 Views
    A

    I decided to follow Bob's suggestion to replace moveRows with removeRows followed by insertRows and it seemed to work out for me. Thank you all for the suggestions.

  • 0 Votes
    2 Posts
    82 Views
    mzimmersM

    I'm seeing the same thing on my Ubuntu desktop. Does anyone know of a current bug report for this?

  • How to transfer drag.active between objects?

    Unsolved
    1
    0 Votes
    1 Posts
    36 Views
    No one has replied
  • exclude item inside QML Qt Quick Control from interaction

    Unsolved
    3
    0 Votes
    3 Posts
    68 Views
    M

    Thank you, @GrecKo !
    That helped a lot. Just adding it as you suggested didn't work, but in combination with the following on the control level works good.

    containmentMask: QtObject { function contains (point: point) : bool { return control.contentItem.contains(point) || control.indicator.contains(point) } }
  • App stoped working after `QTP0004 = NEW`

    Unsolved
    3
    0 Votes
    3 Posts
    101 Views
    F

    Hi, it's a bit hard to tell what is causing the issue without more information. Could you describe how the files stored in ${QML_FILES} are structured? Do you have QML files which are part of your module and which explicitly import the module itself?

    But generally, this sounds like a bug (in Qt itself) – if only to improve the warning message – and I'd be interested in a bug report.

    Lastly, as a workaround to avoid warnings, you could also set the "NO_GENERATE_EXTRA_QMLDIRS" option instead of setting the policy to old (if the Qt version is high enough).

  • 0 Votes
    9 Posts
    177 Views
    SGaistS

    You're welcome !

    You know, inverting lines can happen quickly and innocuously :-)
    Anyway, now you're back on track.

  • Shadow Mapping not working after porting to Qt 6,8

    Solved
    6
    0 Votes
    6 Posts
    293 Views
    SGaistS

    Thanks for the feedback and bug reports !

  • Ripple effect on material style

    Unsolved
    3
    0 Votes
    3 Posts
    511 Views
    N

    I am also facing the same issue. Have you found any solution for this?

  • Regarding dynamic graph creation using Shape qml component.

    Unsolved
    1
    0 Votes
    1 Posts
    46 Views
    No one has replied
  • 0 Votes
    12 Posts
    314 Views
    J

    @Bob64 Thank you, just using 'type' worked! I knew it would be something simple like this. And @GrecKo thanks for the tip, that looks like a better solution so ill definitely look into it.

  • 0 Votes
    2 Posts
    57 Views
    SGaistS

    Hi,

    AFAIK there's no such class. Qt Virtual Keyboard provides an on screen keyboard that is not tied to any hardware.
    What is your goal ?

  • Cura plugins + beginner Python + out dated QT= ishhh!

    Unsolved
    3
    0 Votes
    3 Posts
    119 Views
    F

    @SGaist

    Thanks for the reply. I forgot how qt was multi-platform/multi-os. But yeah you have right, I'm running on Windows 10. Now for the crash, it's pretty funny actually. After I've move qt/bin dll into Cura root folder and some Pyd/Pyi... I didn't remember which one, i've to create a kind of cura patch file for.. but anyway.... To say after i've modified cura, i've the same bug into PythonDemo and CuraPlugins.

    struct.png

    import os.path from UM.Application import Application from UM.PluginRegistry import PluginRegistry from cura.Stages.CuraStage import CuraStage from PyQt6.QtCore import QUrl #from PyQt6.QtWebEngineWidgets import QWebEngineView class FluiddStage(CuraStage): """Stage for web Interface""" #view = QWebEngineView() def __init__(self, parent = None): super().__init__(parent) Application.getInstance().engineCreatedSignal.connect(self._engineCreated) def _engineCreated(self): self.addDisplayComponent("menu", os.path.join(PluginRegistry.getInstance().getPluginPath("FluiddStage"), "FluiddMenu.qml")) self.addDisplayComponent("main", os.path.join(PluginRegistry.getInstance().getPluginPath("FluiddStage"), "FluiddMain.qml"))

    My first plugins crash was that I cannot import QWebEngineView and I cannot create QWebEngineView() class instance. Now with cura file patch, I can. Of course I cannot use view.show() it's crash the plugins.

    The second plugins crash was about QML file. I cannot import nothing, except maybe QtQuick/UM/Cura. And it's where is funny... I seem to have the same problem with my QML demo version since i try to QML the demo. I Cannot import QtWebEngine/QtWebView or whatever into QML file. it's crash demo and plugins.

    Does I miss something into init.py? Remark demo folder doesn't have.