跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k 主題 77.4k 貼文
  • QML Svg in qt 5.15 static build, using CMake

    Unsolved
    3
    0 評價
    3 貼文
    2k 瀏覽
    B
    The solution for me was in addition to including Qt5::Svg in find_package and target_link_libraries, eg: find_package(Qt5 REQUIRED COMPONENTS Core Quick Qml Xml Charts Gui Svg QuickControls2) target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Quick Qt5::Qml Qt5::Xml Qt5::Charts Qt5::Gui Qt5::Svg Qt5::QuickControls2) To also include the following when statically linking Qt 5.15: qt5_import_plugins(${PROJECT_NAME} INCLUDE Qt5::QSvgPlugin) That resolved errors such as "QML ButtonIcon: Error decoding: qrc:/resources/images/add-white-36dp.svg: Unsupported image format"
  • Make Independent Popup

    Solved
    4
    0 評價
    4 貼文
    409 瀏覽
    PadawanP
    @GrecKo Thanks I've gotten it sorted out. I encapsulated the component i wanted to show inside a window and created it using Qt.createComponent() var playListComponent = Qt.createComponent("CustomPlaylist.qml") var window = playListComponent.createObject(rootWindow) window.show() The root element of CustomPlaylist.qml is a Window [image: 4c1cfe8b-9403-4008-9066-c4ec97b8f368.png]
  • why doesn't it draw PathLine ??

    Unsolved quick qt quick qt5.11
    2
    0 評價
    2 貼文
    828 瀏覽
    B
    If I understood correctly, you want to draw a red line. The purpose of Path is to position elements through a path. Think of a row or a column that's not straight. You can understand better if you run the first example from this tutorial. To draw paths you need Shape. import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Shapes 1.12 Window { width: 640 height: 480 visible: true title: qsTr("Редактор персонажей") Shape { ShapePath { strokeColor: "red"; // it works :) startX: 0; startY: 100 PathLine { x: 640; y: 480 } } } }
  • How to show multiple Popup on a window? (for ToolTip)

    Solved
    3
    0 評價
    3 貼文
    428 瀏覽
    W
    @GrecKo Nice and good example! I can solve my problem. Thanks.
  • Using of property mouse.accepted

    Solved
    4
    1 評價
    4 貼文
    3k 瀏覽
    GrecKoG
    not that for a single parameter you can get rid of the parenthesis, mouse => { ... } works
  • "ValueAxis.tickInterval" is not available in QtCharts 2.3.

    Solved
    3
    0 評價
    3 貼文
    359 瀏覽
    S
    It works ! Thanks (I don't understand it either...)
  • Qt Quick QML Types in QtQuick 2.11 ??

    Solved qml types
    2
    0 評價
    2 貼文
    477 瀏覽
    raven-worxR
    @timob256 you mean this? https://doc.qt.io/archives/qt-5.11/qtquick-qmlmodule.html
  • Fonts, again. Different appearance on different platforms. Same font.

    Solved
    6
    0 評價
    6 貼文
    1k 瀏覽
    GrecKoG
    That's how font works in every UI system, there is a fallback behavior. As for why there is both font.family and fontInfo.family, it's because it makes developers life easier. You can actually see if the chosen font differs from the one that was set without having to store the expected font somewhere else. For the font family you can also gives a very vague one like "serif", "sans-serif", "monospace" and seeing what the font matched with fontInfo might be important. It would be weird to do font.family = "sans-serif"; and then getting "DejaVu Sans" back when querying font.family, wouldn't it? QML is declarative, so making font.family a function won't be very practical and give much advantages. You already have your feedback in a declarative way, I really don't see how an imperative API would be any better? Do you have a pseudo code example of what your perfect API would look like?
  • TableView header hides first elements

    Unsolved
    3
    0 評價
    3 貼文
    700 瀏覽
    sudarshandS
    Use topMargin property of Table View.
  • Problems with ScrollBar and ListView

    Solved
    2
    0 評價
    2 貼文
    856 瀏覽
    C
    I figured it out. For anyone who's interested. If you set the visibility of the contentItem to be: visible: theListView.contentHeight > theListView.height that should do the trick.
  • Dialog and DropArea issue

    Unsolved
    5
    0 評價
    5 貼文
    2k 瀏覽
    G
    This is an annoying problem and I'm struggling with it at the moment. Did anyone manage to find a proper workaround to it?
  • Qt Creator: qml.qrc with different prefix, problem in design editor

    Unsolved
    1
    0 評價
    1 貼文
    209 瀏覽
    尚無回覆
  • QList as qml model

    Unsolved
    2
    0 評價
    2 貼文
    296 瀏覽
    raven-worxR
    @Cyrille-de-Brebisson Q_PROPERTY(QList<MyObj*> liste READ getliste NOTIFY listeChanged) now emit the listeChanged signal everytime you change the list If you would implement a QAbstractListModel subclass you would have more control of rearrangements etc.
  • 0 評價
    4 貼文
    1k 瀏覽
    raven-worxR
    @Tee_ normally a pro file results in a separate target (executable or library). Even if you "combine" them with a subdirs project. So your AppUi project must link against the AppLib
  • GTK style File Explorer on Windows OS

    Unsolved
    1
    0 評價
    1 貼文
    193 瀏覽
    尚無回覆
  • ChartView/ValueAxis - How to NOT label the maximum value tick on the ValueAxis

    Unsolved
    4
    0 評價
    4 貼文
    326 瀏覽
    fcarneyF
    You could draw a line on top. Not ideal. Edit: Width of 1 rect with border.
  • Conditional Import

    Unsolved
    10
    0 評價
    10 貼文
    2k 瀏覽
    raven-worxR
    @caicx said in Conditional Import: import QtGraphicalEffects 1.0 // Required by Qt 5.x.x vs import Qt5Compat.GraphicalEffects // Required by Qt 6.x.x yes and? Since the major version of Qt has changed you should also advance with your project, instead of importing a compat module of a previous version for the whole lifespan of Qt 6. The compat module is intended to be used as a quick solution until the porting of your application to Qt6 has finished
  • Key press events are not handled in e.g. Qml TextField but eventFilter receives it

    Unsolved
    1
    0 評價
    1 貼文
    163 瀏覽
    尚無回覆
  • How to identify the Qt libraries are built with open source or commercial licenses

    Solved
    3
    0 評價
    3 貼文
    435 瀏覽
    P
    @jsulm - Thank You
  • Can't use QtQuick.Controls

    Unsolved
    3
    0 評價
    3 貼文
    381 瀏覽
    W
    @J-Hilk No, I haven't considered it because it has been working fine until now. Sorry, I made a mistake, it's "5.15.2" to be exact. I created a new project with the exact same settings and the exact same code, and it worked. Was there a problem with the settings that I missed somewhere?