[Interest] TableView in Qt Quick Controls 2

Shantanu Tushar shaan7in at gmail.com
Wed Jun 28 09:49:01 CEST 2017


You don't necessarily need a separate file,just import like this -

import QtQuick.Controls 1.4 as QQC1
import QtQuick.Controls 2.1

QQC1.TableView {
// ....
// ...
    Button {
    // this will be QtQuick Controls 2 Button
    }
}


On Wed, Jun 28, 2017 at 12:48 PM, Andrew Ialacci <andrew at dkai.dk> wrote:

> Thank you for your time and response!
>
> I originally tried to use the current / old TableView but noticed when
> including the import in my QML file it also downgraded the other components
> like Button to the old style.
>
> Putting the QtQuick.Controls 1.4 import and declaring the TableView
> declaration in a separate qml file seems to solve the problem.
>
> Another question/s:
>
> For my model I’m using a QAbstractListModel that manages a list of plain,
> NON QObject objects.
>
> * Should each property of my objects be exposed to QML using named roles /
> roleNames? Is this the correct way to use a TableView from QML?
>
> StackOverflow has said no
> https://stackoverflow.com/questions/21298124/qt5-
> display-dynamic-data-model-in-qml-tableview
>
> Yet this presentation by ICS said yes: (slides 5 - 7)
> https://www.slideshare.net/ICSinc/best-practices-in-qt-quickqml-part-iv
>
> My goal is to allow a user to show or hide columns at will. So again, if
> it was a table of People, they might want to hide the location column and
> only show Name, Age, and Gender.
>
> * Can you say if the NEW 5.11(ish) TableView will use the
> QAbstractListModel or the QAbstractTableModel?
> * Will the API be similar to the CURRENT TableView?
> * Will it rely on roleNames to denote columns?
>
>
>
>
> On 6/26/17, 6:19 PM, "Frederik Gladhorn" <frederik.gladhorn at qt.io> wrote:
>
>     On søndag 25. juni 2017 10.32.27 CEST Andrew Ialacci wrote:
>     > Hello,
>     >
>     > I understand that there is currently no TableView in Qt Quick
> Controls 2.
>     >
>     > According to this bug report, it’s slated for 5.10:
>     > https://bugreports.qt.io/browse/QTBUG-51710
>
>     I just commented on the bug, I doubt we'll get there in time. Simply
> because
>     we don't want to see all the issues (especially performance) we had
> with the
>     table view again. It'll be a lot of looking into ListView and probably
> a new
>     independent item, not based on ListView, I don't know the details. If
> the
>     Controls 1 table view is good enough, use it. It mixes nicely with
> Controls 2
>     (use import as).
>
>     > Does anyone know if this is still true? Or when 5.10 will be
> released?
>
>     5.10 is scheduled for the end of this year. I'd rather expect this to
> be in
>     5.11 - mid next-year. I hope we'll have something sooner for people to
> play
>     with though, let's see.
>
>     Cheers,
>     Frederik
>
>     >
>     > Can anyone think of a way to use a GridView or ListView that would
> allow
>     > for:
>      - Dynamic column contents based on the underlying model.
>     > - Rearrange / resize table columns.
>     > - Addition or removal of columns at run time.
>     > - Somehow some way magically not use loads of JavaScript for all the
> sizing
>     > and manipulation of cells.
>
>     > Thanks to everyone for their time and ESPECIALLY to TeamQT!
>     > ❤🌻🍍
>     >
>     >
>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>



-- 
Shantanu Tushar    (UTC +0530)
shantanu.io
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170628/0da09670/attachment.html>


More information about the Interest mailing list