Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • clarification on debugging QML

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    mzimmersM
    I discovered my error: I hadn't enabled QML debugging in the run settings for my project. (The documentation does say to do this, though it's kind of subtle.) Now I can break and examine variables. Thanks to all who looked at this.
  • Delete cookies of QML WebView

    Moved Unsolved
    5
    0 Votes
    5 Posts
    514 Views
    Q
    I agree about the Javascript usage to delete cookies but when used in QML we have to access an element by "id" which in our case has to be QML WebView component id which inturn doesn't have any "cookies" property as opposed to Javascript Document Object. Hence i am failiing to implement any method to delete cookies. Am i missing on to something here (P.S: i never learnt JS and could gather these info from other forum solutions) ? Thanks
  • Qml TableView scrollbar

    Unsolved
    1
    0 Votes
    1 Posts
    195 Views
    No one has replied
  • TableView with different delegates for its columns (QtQuick 2.15)

    Solved
    4
    0 Votes
    4 Posts
    892 Views
    SeDiS
    @SeDi For posterity, here's my working solution: delegate: Rectangle { width: childrenRect.width height: childrenRect.height Loader { sourceComponent: { switch(columnNo) { case 0: return firstDelegate; case 1: return secondDelegate; // ... default: return etcDelegate; } } } Component { id: firstDelegate Rectangle { width: childrenRect.width height: childrenRect.height color: "lightgray" Text { width: contentWidth + contentHeight height: contentHeight * 1.1 text: "first" verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } } } Component { id: secondDelegate Rectangle { width: childrenRect.width height: childrenRect.height color: "yellow" Text { width: contentWidth + contentHeight height: contentHeight * 1.1 text: "second" verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } } } Component { id: etcDelegate Rectangle { width: childrenRect.width height: childrenRect.height color: "lightgreen" Text { width: contentWidth + contentHeight height: contentHeight * 1.1 text: foodName verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } } } } To provide the columnNo role I had to do some work in my QAbstractTableModel. The roles enum in the header: class LogTableModel : public QAbstractTableModel { enum Role { DisplayRole = Qt::DisplayRole, DecorationRole = Qt::DecorationRole, StatusTipRole = Qt::StatusTipRole, //whatever... ColumnNoRole = Qt::UserRole+5 // or wherever it suits ... In data(...) I have implemented: QVariant LogTableModel::data(const QModelIndex &index, int role) const { if (index.isValid()) { switch(role) { case DisplayRole: return QVariant::fromValue(m_columns.at(index.column())->at(index.row())); case ColumnNoRole: return QVariant::fromValue(index.column()); ... roleNames() must also know it: QHash<int, QByteArray> LogTableModel::roleNames() const { QHash<int, QByteArray> roles; roles[DisplayRole] = "display"; roles[ColumnNoRole] = "columnNo"; ...
  • QQuickWidget - QOpenGLFramebufferObject::release() called from incompatible context

    Unsolved
    1
    0 Votes
    1 Posts
    225 Views
    No one has replied
  • QML Navigator example

    Unsolved
    1
    0 Votes
    1 Posts
    254 Views
    No one has replied
  • How to call Dialog with openfunction properly?

    Unsolved
    1
    0 Votes
    1 Posts
    117 Views
    No one has replied
  • How to auto size font on TextInput or TextField?

    Unsolved
    2
    0 Votes
    2 Posts
    285 Views
    F
    @filipdns here is what I did waiting better solution... FontMetrics { id: textMetrics font.pixelSize:20 } TextInput { id:textInputItem anchors.fill:parent focus: true activeFocusOnPress: true activeFocusOnTab: true padding : 5 rightPadding: 5 color: "black" leftPadding: 5 selectByMouse: true text: control.displayText font.pixelSize:20 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter onTextChanged: { font.pixelSize=20*Math.min(1,width/(textMetrics.advanceWidth(text)*1.4));textMetrics.font.pixelSize=font.pixelSize} }
  • QQmlApplicationEngine failed to load component

    Unsolved
    1
    0 Votes
    1 Posts
    334 Views
    No one has replied
  • How the position offsets do not return to initial values after pressing the button?

    Unsolved
    1
    0 Votes
    1 Posts
    116 Views
    No one has replied
  • QML and C++, Float Variable not matching

    Solved
    5
    0 Votes
    5 Posts
    690 Views
    mrjjM
    @Olivia-Dodonic Hi I think its different default "show values" for how many digits are "printed" std::cout has http://www.cplusplus.com/reference/iomanip/setprecision/ to alter it.
  • QSVGRenderer - subclassing & replacing with custom renderer possible?

    Solved
    3
    0 Votes
    3 Posts
    351 Views
    M
    Thanks, as a reference, ill add here https://doc.qt.io/qt-5/qtimageformats-index.html
  • Insert un placeholder or similar in a state

    Unsolved
    3
    0 Votes
    3 Posts
    256 Views
    PollyP
    @LeLev thank you i'll try.
  • Adjusting constant sizes to DPI

    Unsolved
    2
    0 Votes
    2 Posts
    247 Views
    ODБOïO
    hi @Asperamanca said in Adjusting constant sizes to DPI: My best idea right now is to register some context property or similar with this scaling factor, and multiply every constant size with that. I think that is the right thing to do. https://doc.qt.io/qt-5/scalability.html
  • How to make

    Unsolved
    2
    0 Votes
    2 Posts
    215 Views
    ODБOïO
    Hi In your 2nd Tqmlc_TextButton you have @OpenCoder said in How to make: Tqmlc_TextButton { Layout.alignment: Qt.AlignLeftRight sould be Qt.AlignLeft
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • import OpenGLUnderQML 1.0 not found

    Unsolved
    4
    0 Votes
    4 Posts
    474 Views
    SGaistS
    IIRC, the examples have not yet been all ported to Python. I currently do not know how this one can be translated. On thing you can do is check the bug report system to see if there's something related to these examples.
  • Qt gets crashes when there are too many resource files.

    Unsolved
    3
    0 Votes
    3 Posts
    344 Views
    SGaistS
    Hi, Beside the information requested by @jsulm, what type are these icons ? How big are they ? And out of curiosity, why so many ?
  • Displaying multiple images using GridView

    Unsolved
    4
    0 Votes
    4 Posts
    742 Views
    M
    it has been solved :) https://stackoverflow.com/questions/66139807/displaying-multiple-images-using-qml-in-gridview
  • Child Element of SplitView overriding SplitView functionality

    Unsolved
    1
    0 Votes
    1 Posts
    129 Views
    No one has replied