Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. tableviewcolumn

    Log in to post
    • All categories
    • V

      Solved how to get the current index on click of an image for table view
      QML and Qt Quick • qml qt5 tableviewcolumn table view • • vinaygopal

      2
      0
      Votes
      2
      Posts
      406
      Views

      J.Hilk

      @vinaygopal
      according to the documentation:

      https://doc.qt.io/qt-5/qml-qtquick-controls-tableviewcolumn.html#delegate-prop

      this should do the trick:

      Component{ id:firstColumnComponent Item { id: toplevelItem property bool textpresent: true Row{ spacing: 10 TextField{ id:te width: 100 text: styleData.value maximumLength: 20 onAccepted:{ console.log("the editing is finished to",te.text) peopleTable.editfinished(te.text,styleData.value) } } Image { id: fav_image source: "qrc:/favourite_icon.png" height: 20 width: 40 MouseArea{ anchors.fill: parent onClicked: { console.log("the current index is",styleData.row) //Change happened here } } } } } }
    • V

      Solved how to apply certain properties only to the selected delegates
      QML and Qt Quick • qt5 qml table view tableviewcolumn delegate • • vinaygopal

      3
      0
      Votes
      3
      Posts
      295
      Views

      V

      @fcarney

      Got it thank you so much :)

    • V

      Solved how to access data from a delegate's component.
      QML and Qt Quick • qt5.15.2 qml tableview tableviewcolumn delegate • • vinaygopal

      4
      0
      Votes
      4
      Posts
      707
      Views

      sierdzio

      The model should provide this information for you. Create a role in the model which will return the correct value for any given cell. On QML side, just access that role and display it directly. No need for any get() method (which, by the way, is called data() https://doc.qt.io/qt-5/qabstractitemmodel.html#data, not get()).

    • N

      Unsolved Is it possible through qml javascript change the value of an delegate of a TableViewColumn?
      QML and Qt Quick • qml tableview tableviewcolumn model • • Nmaster88

      1
      0
      Votes
      1
      Posts
      294
      Views

      No one has replied

    • N

      Unsolved Is there a way to have subheader on a TableView?
      QML and Qt Quick • tableview tableviewcolumn • • Nmaster88

      1
      0
      Votes
      1
      Posts
      327
      Views

      No one has replied

    • R

      Unsolved How I can create the table view having two columns in QML?
      QML and Qt Quick • python3 qml pyqt5 tableviewcolumn • • Rohn

      2
      0
      Votes
      2
      Posts
      1105
      Views

      KillerSmath

      Hi there.

      I think you can use TableViewColumn element to create a new column inside a TableView component.
      If necessary, you can define your own delegate to set how the data is showed to user.

      Read more:
      http://doc.qt.io/qt-5/qml-qtquick-controls-tableview.html#details <- TableView Documentation
      http://doc.qt.io/qt-5/qtquickcontrols-tableview-main-qml.html <- TableView Example

    • B

      Unsolved qml TableView and group of columns
      QML and Qt Quick • tableview tableviewcolumn • • BePie

      1
      0
      Votes
      1
      Posts
      550
      Views

      No one has replied

    • K

      Solved Sorting QTableview items alphabetically!
      General and Desktop • tableviewcolumn items sort alphabetical • • Kushan

      6
      0
      Votes
      6
      Posts
      3709
      Views

      K

      @VRonin Thanx mate

    • R

      Unsolved TableView and Columns
      QML and Qt Quick • tableview tableviewcolumn • • RostV

      1
      0
      Votes
      1
      Posts
      539
      Views

      No one has replied

    • Sikarjan

      Unsolved How to use resizeToContents() in a TableView?
      QML and Qt Quick • tableviewcolumn • • Sikarjan

      5
      0
      Votes
      5
      Posts
      3511
      Views

      Sikarjan

      Thanks again for helping. But it is not really working for me. My model is a XmlListModel and I tried your code with status == ready and onComplete but nothing. When I add a button and connect the function to onClicked your code works nicely...

      Unfortunately the length of the table header is not considered. I believe this is a two year old bug.

      At the moment I am using

      width: title.length*factor

      This seems to work okay for now. I am just curious if it will work on other screens as well.

    • Okyn

      Unsolved TableViewColumn, ListModel, ... not displayed in the section "Navigator" of Qt Quick Designer
      QML and Qt Quick • qt quick tableviewcolumn display navigator • • Okyn

      1
      0
      Votes
      1
      Posts
      554
      Views

      No one has replied

    • M

      Unsolved How do I emit signal while clicking TableViewColumn?
      QML and Qt Quick • tableviewcolumn mousearea delegate • • Mira13

      1
      0
      Votes
      1
      Posts
      679
      Views

      No one has replied