QML TableView | Building your Headers | Qt Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ย. 2024
  • Learn how to work with the TableView QML Component from Qt 5.12
    ------------------------------------------
    Get Our Full Courses on Qt,C++,QML and more (Dicounted) :
    Qt C++ GUI Development for Beginners : bit.ly/2QosgO8
    Qt C++ GUI Development - Intermediate : bit.ly/2MXv8Qd
    Qt Quick and QML For Beginners : bit.ly/2uix5Qx
    Qt Quick and QML Intermediate : bit.ly/2MYGIu6
    Qt Quick and QML Advanced : bit.ly/2QOkjRj
    Multithreading and IPC with Qt C++ : bit.ly/36olQV2
    -----
    33Qt Creator Tips and Tricks Free Booklet : bit.ly/33HCj4k
    ----
    Join the LearnQt Facebook Group : bit.ly/39zdOdM
    -----------Follow Us----------
    Website - learnqt.guide
    Twitter - / learnqtguide
    Facebook - / learnqtguide

ความคิดเห็น • 30

  • @romannik7224
    @romannik7224 5 ปีที่แล้ว +8

    It's unusable in real application because header should be fixed and not hidden when user scrolling the data.

  • @Phil-tl6ln
    @Phil-tl6ln 2 ปีที่แล้ว +1

    For what it's worth, QML types VerticalHeaderView and HorizontalHeaderView now exist

  • @sudarshandeshmukh5954
    @sudarshandeshmukh5954 3 ปีที่แล้ว +1

    Hi this is a very informative tutorial. Thank You ! Can you please create tutorial for scrolling some middle columns of QML table view horizontally with outer columns should be freeze (not scrollable).

  • @devasenalatha4427
    @devasenalatha4427 2 ปีที่แล้ว

    Hi Daniel,
    How to add a button in every row to edit data/delete that row?

  • @mindstreamx
    @mindstreamx 5 ปีที่แล้ว +4

    ugh seriously who builds & releases a tableview without headers.... i wonder if it has auto scrollbars now.

  • @janzembowicz8607
    @janzembowicz8607 5 ปีที่แล้ว +1

    Hi, is it possible to have checkbox in one of the row?
    How can i also find on which row i clicked/tapped?

    • @LearnQtGuide
      @LearnQtGuide  5 ปีที่แล้ว

      You can add QML check box in the delegate. For clicks there are many ways like MouseArea or some signals from TableView itself. I would recommend learning the basics about QML and most of these things will suddenly make sense.

    • @AndreSomers
      @AndreSomers 5 ปีที่แล้ว

      If you want to find out which item was clicked, add a MouseArea on your delegate, and in the onClicked handler reference the model.row and model.column properties.

  • @joshikanethanamani3571
    @joshikanethanamani3571 2 ปีที่แล้ว

    How to make first row constant

  • @alirezaghalavand7513
    @alirezaghalavand7513 3 ปีที่แล้ว

    Hi Daniel,
    Do you know if I want to use QSortFilterProxyModel instead of a TableModel which inherits from QAbstractTableModel, how can I do that? I know that I have to setSource(TableModel) for the proxy object but I don't know how can I use it in the QML !

  • @user-go5fp5my1g
    @user-go5fp5my1g 5 ปีที่แล้ว

    Why do table is blinking when its colored in red and green? Because of this it seems very unusable for real applications.

  • @mohammadjavadkhodabandeloo4444
    @mohammadjavadkhodabandeloo4444 3 ปีที่แล้ว

    Thanks.

  • @felipereyesgonzalez9960
    @felipereyesgonzalez9960 2 ปีที่แล้ว

    Hi,
    how it is possible to select rows ?
    Thanks :D

    • @shubhamkalihari3867
      @shubhamkalihari3867 5 หลายเดือนก่อน

      did you get the solution?

    • @reyesfelipe
      @reyesfelipe 5 หลายเดือนก่อน

      ​@@shubhamkalihari3867no 😢

  • @thomaslammlein5950
    @thomaslammlein5950 5 ปีที่แล้ว

    Hi,
    how it is possible to add a row to the TableView?
    Thanks,
    Thomas

    • @LearnQtGuide
      @LearnQtGuide  5 ปีที่แล้ว

      You can reimplement insertRows in your model as shown in docs : doc.qt.io/qt-5/qabstractitemmodel.html#insertRows . In that method just make sure to call beginInsertRows and endInsertRows. Any view attached to that model will update with the new changes to the model. Hope this helps.

    • @thomaslammlein5950
      @thomaslammlein5950 5 ปีที่แล้ว

      @@LearnQtGuide Thank you.

    • @AndreSomers
      @AndreSomers 5 ปีที่แล้ว

      I would not use the QAbstractItemModel API for that, if you want to do this from the QML side. Instead, simply add a specialized Q_INVOKABLE method on your model, and call that from QML to do the insertion. The QAIM API is not suitable for direct consumption by application logic.

  • @nikkimukundpurandare432
    @nikkimukundpurandare432 5 ปีที่แล้ว

    Hello!! i needed some help to display Sqlite data into this TableView.. How is it possible? or is there any other way to display Sqlite tables and refresh them as the new entries occur? Please help ! thank you :)

    • @AndreSomers
      @AndreSomers 5 ปีที่แล้ว +1

      Use a QSqlTableModel as your model, instead of a custom made QAbstractTableModel derived class. It won't automatically update itself though, you'll have to have some type of signal or callback that tells you when to requery.

    • @nikkimukundpurandare432
      @nikkimukundpurandare432 5 ปีที่แล้ว

      @@AndreSomers Thank you very much :)

  • @-nafa-3229
    @-nafa-3229 4 ปีที่แล้ว

    Thanks for help!

  • @NickEnchev
    @NickEnchev 2 หลายเดือนก่อน

    Never understood why people start tutorials with "Let's create a new project!", most of us have a project, lets go! Its like if I taught somebody how to setup some windows feature and started my video with "Ok, let's start by installing windows"