[Interest] a few questions about QML Components

Nurmi J-P jpnurmi at digia.com
Mon May 19 14:29:38 CEST 2014


On 19 May 2014, at 12:51, Alexander Ivash <elderorb at gmail.com> wrote:

> I was trying to use QML components in simple android application but confronted several issues: 
> 
> 1. I couldn't find any API allowing to adjust widths of columns in TableView based on the content. Do I understand right that the only way to achieve this is to go through all the entries in model manually and calculate maximum width using 'paintedWidth' of Text element? Does the better way exist? For future would be really nice to have some property like 'autoAdjustColumns’. 

QtQuick.Controls 1.2 (Qt 5.3) introduces TableView::resizeColumnsToContens() and TableViewColumn::resizeToContents().

> 2. I couldn't find API for adjusting width of Combobox based on the content. Again, what is the best way for doing this manually? 

Sounds like we need something similar for ComboBox. Please open a JIRA ticket: https://bugreports.qt-project.org

> 3. Combobox's auto-complete does seems to be working on android (Qt 5.3RC). How can I 'subclass'/ extend QML Combobox to add missing logic? 

I’m afraid currently there’s no way to extend the auto-completion logic that is hidden inside the control implementation. I suspect auto-completion doesn’t work on mobile, because ComboBox is probably not getting normal key events, but it should handle pre-edit text somehow. This is something we need to investigate, and worth reporting a bug so it doesn’t get forgotten. :)

> 4. In general QML Components doesn't look very good on android. Is there any styles/themes available allowing to simulate android's look&feel for QML components? 

I don’t have much to share at the moment, but I can tell that we have started working on an Android style: https://bugreports.qt-project.org/browse/QTBUG-35081

--
J-P Nurmi




More information about the Interest mailing list