Re: [Interest] Standardizing Qt Kit Names

2018-08-30 Thread J-P Nurmi
On Wed, Aug 29, 2018 at 6:28 PM Jason H  wrote:
>
> I'd like it to be Qt / Version / Platform like
> Qt 5.10.1 for Desktop
> Qt 5.10.1 for iOS
> Qt 5.10.1 for iOS Simulator

+1, and while at it, replace "Desktop" with a platform name too.

--
J-P Nurmi
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Avoid readable QML files in application

2018-05-23 Thread J-P Nurmi
Hi,

On 23 May 2018, at 12:38, Van Gucht, Sam 
<sam.vangu...@nobelbiocare.com<mailto:sam.vangu...@nobelbiocare.com>> wrote:

But for certain modules this doesn't work, eg. Quick.Controls2.

Starting with Qt 5.12, Qt Quick Controls 2 supports embedded resources and the 
Qt Quick Compiler, also for external styles. The .qml files can be optionally 
left out at deployment time.

https://codereview.qt-project.org/#/c/228360/

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt 5.10.1 TextField backgound inconsistency or regression

2018-04-09 Thread J-P Nurmi
Hi,

This is a regression caused by the deferred execution changes related to the 
famous “object destroyed during incubation” problems 
(https://bugreports.qt.io/browse/QTBUG-50992). A fix has been pushed to 5.11 
https://codereview.qt-project.org/#/c/225459/ and will be cherry-picked to the 
next 5.9 LTS release too. Thanks for bringing this up.

--
J-P Nurmi

On 8 Apr 2018, at 13:32, m...@herrdiel.de<mailto:m...@herrdiel.de> wrote:


Update: could this be related to https://bugreports.qt.io/browse/QTBUG-67446?

That bug's workaround (setting an id in background) works here, too.



Am 08.04.2018 um 13:14 schrieb m...@herrdiel.de<mailto:m...@herrdiel.de>:

Hi again,

in order to find out more about the QML errors mentioned in my previous post, I 
have tried using Qt 5.10.1.

(MinGw5.3, Windows Version 10.0.16299 Build 16299, 64 bit)

While upgrading doesn't help there, it brought an inconsistency/regression 
between the versions to my attention:

@

   Repeater {

  model: currentItem.similarPupils.count

  TextField {

  property var currentSubItem:  currentItem.similarPupils.get(index)

  background: Rectangle {

  color: "green"// normally more complex

//  anchors.fill: parent

  }

  verticalAlignment: Text.AlignVCenter

  height: 30

  width: importCsvDuplicates.elementWidth

  property string nameText: currentSubItem ? currentSubItem.text : ""

  text: currentSubItem.text + " " + 
currentSubItem.propertyFromRole("distance")

  }

  }

@

In 5.10.0 this works fine, in 5.10.1 some TextFields are left white (see pics 
below).

I can work around that by "uncommenting in" the
anchors.fill: parent

Is this something to file a bug about or has this been done on purpose?

Best regards
Sebastian



This is 5.10.1 - white fields:


--
This is In 5.10.0 -  or In 5.10.1 with additional "anchors.fill: parent"


--
http://www.classintouch.de<http://www.classintouch.de/> - Tablet-Software für 
Lehrer



___
Interest mailing list
Interest@qt-project.org<mailto:Interest@qt-project.org>
http://lists.qt-project.org/mailman/listinfo/interest



--
http://www.classintouch.de<http://www.classintouch.de/> - Tablet-Software für 
Lehrer

___
Interest mailing list
Interest@qt-project.org<mailto:Interest@qt-project.org>
http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] ComboBox styling problems

2018-04-09 Thread J-P Nurmi
> On 27 Mar 2018, at 03:41, Jason H <jh...@gmx.com> wrote:
> 
> I sent this a while back, but I never got help, and I still haven't figured 
> it out. 
> 
> -
> I'm trying to style ComboBox, but I am getting a highlight that is not placed 
> correctly, and there seems to be a semi-transparent black overlay that is 
> also applying itself over the highlight?
> 
> Can someone tell me what I'm doing wrong?

Some comments to get you started:
- Fix the "width: control.height" bindings.
- In the delegate, use Text as a contentItem, and Rectangle as a background. 
Control controls the size of contentItem, and background follows the size of 
the Control by default. No need for width/height bindings for either.
- If you want to use fontSizeMode, specify the font size range: 
http://doc-snapshots.qt.io/qt5-5.11/qml-qtquick-text.html#fontSizeMode-prop
- Set a higher Z-value if you want the ListView highlight to appear over the 
delegates: 
https://doc-snapshots.qt.io/qt5-5.9/qml-qtquick-listview.html#stacking-order-in-listview
 but you will be just hiding the entire delegate with an opaque rectangle, so 
perhaps consider visualizing the highlighted state in the delegate background 
instead.
- What's the purpose of the opaque Rectangle inside the ScrollIndicator?

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] TableView in Qt Quick Controls 2

2017-06-28 Thread J-P Nurmi
Hi Mark,

On 28 Jun 2017, at 10:58, Mark Gaiser 
<mark...@gmail.com<mailto:mark...@gmail.com>> wrote:

Hi J-P,

From what you just said there i get the impression that the new table view has 
"some code somewhere", right?
Or is it all still in a planning phase?

Anyhow, if there is some working code for this somewhere, could you point me to 
that? I'd like to play with it and see if it fits my needs.
In this case that's merely displaying a calendar and showing animations when 
switching between months.


Best regards,
Mark

The code is in the wip/itemviews branch in qtdeclarative, but given that the 
table layout for visible items is still missing, there’s nothing you can play 
with yet, unfortunately. So far the focus has been on refactoring the 
underlying itemview framework to make it suitable for building a TableView.

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] TableView in Qt Quick Controls 2

2017-06-28 Thread J-P Nurmi
Hi,

> On 28 Jun 2017, at 09:18, Andrew Ialacci <and...@dkai.dk> wrote:
> 
> * Can you say if the NEW 5.11(ish) TableView will use the QAbstractListModel 
> or the QAbstractTableModel?
> * Will it rely on roleNames to denote columns?

We're making it possible to use any model. With a multi-column table model it 
would resolve the amount of columns by default, but allows you to explicitly 
specify/override the desired amount of columns. With a single model column, it 
is left up to you to specify the amount of columns. This way, you can use 
either a two-dimensional QAbstractTableModel, a single-column QML ListModel 
using role names as columns, JS arrays, or even a plain number if you want to. 
:)

> * Will the API be similar to the CURRENT TableView?

The API will be more in line with ListView and GridView. The old way of 
declaring columns with TableViewColumn objects does not scale well for more 
than a few columns.

--
J-P Nurmi


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] TableView in Qt Quick Controls 2

2017-06-26 Thread J-P Nurmi
On 26 Jun 2017, at 19:10, Jean-Michaël Celerier 
<jeanmichael.celer...@gmail.com<mailto:jeanmichael.celer...@gmail.com>> wrote:


On Mon, Jun 26, 2017 at 6:19 PM, Frederik Gladhorn 
<frederik.gladh...@qt.io<mailto:frederik.gladh...@qt.io>> wrote:


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.

Question: why must a single component like this be coupled so tightly to the 
rest of the framework ?
Why does it have to be in the "official" Qt release at all, and not in a 
separate git repo or something loosely coupled ?
Couldn't it be released on a separate channel as a qml extension plugin ?

Just trying to understand.

The goal is to get the new TableView’s performance on the same level with 
ListView and  GridView. (The old QML-based TableView is from a different 
planet.) The idea is to base the new TableView on the existing Qt Quick item 
view framework, and support all same item view transitions, item recycling, and 
all that. Providing such functionality as a standalone addition outside of Qt 
Quick is not doable without re-writing or forking the entire Qt Quick item view 
framework, which is a lot of code and goes into deep internals of libQtQuick 
and libQtQml. Even though there have been some discussions about re-writing the 
item view framework from scratch, we don’t plan to do that now as that would 
take a lot longer than it has taken so far to refactor the existing item view 
framework to support two-dimensional views. What remains to be done for the 
view itself is the actual table layout for the visible items. After that, there 
are a few other things on the TODO-list related to multiple delegate types, 
multi-selection, and so on 
(http://lists.qt-project.org/pipermail/development/2017-January/028344.html).

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt 5.7 QuickControls 2 are not multitouch??

2017-05-01 Thread J-P Nurmi
> On 1 May 2017, at 01:31, Jean-Michaël Celerier 
> <jeanmichael.celer...@gmail.com> wrote:
> 
> Bump.
> 
> Even if Qt Quick Controls 2.0 are apparently gaining this feature in 5.9.0, 
> how would one go when writing custom QQuickItem, if multiple distinct items 
> have to be able to receive touch events simultaneously ? 

Hi,

You can reimplement QQuickItem::touchEvent() to handle touch events. See 
QTouchEvent docs for the details.

- http://doc.qt.io/qt-5/qquickitem.html#touchEvent
- http://doc.qt.io/qt-5/qtouchevent.html

PS. Unlike for QWidgets and QGraphicsItems, there is no need to explicitly 
enable touch events for QQuickItems.

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Attached properties with Namespaced imports

2017-01-27 Thread J-P Nurmi
Hi,

Try this:

C2.StackView.onStatusChanged: console.log("Status is " + 
C2.StackView.status)

--
J-P Nurmi

> On 27 Jan 2017, at 18:48, Shantanu Tushar <shaan...@gmail.com> wrote:
> 
> Hi,
> 
> I realized today that this doesn't work-
> 
> import QtQuick 2.7
> import QtQuick.Controls 2.1 as C2
> 
> C2.ApplicationWindow {
>visible: true
>width: 640
>height: 480
> 
>C2.StackView {
>anchors.fill: parent
> 
>Component.onCompleted: push(rectComponent)
>}
> 
>Component {
>id: rectComponent
> 
>Rectangle {
>color: "green"
>C2.StackView.onStatusChanged: console.log("Status is " +
> StackView.status)
>}
>}
> }
> 
> "Status is" is never printed. However if I import without the "as C2"
> and use "StackView.onStatusChanged", the message is printed.
> 
> The reason I need to do this is that we are still using QtQuick
> Controls 1 throughout our project and want to use StackView from
> QtQuick.Controls 2 because we need the "StackView.onRemoved"
> functionality.
> 
> Any idea how to make the attached property's signal work?
> 
> Cheers,
> 
> -- 
> Shantanu Tushar(UTC +0530)
> shantanu.io
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] ComboBox with hintText?

2016-10-31 Thread J-P Nurmi
> On 31 Oct 2016, at 17:00, Jason H <jh...@gmx.com> wrote:
> 
> 
> I'm also on 5.6.2 because we had bugfixes arrive in that that we need that 
> aren't in 5.7.0, but they will be in 5.7.1
> 
> 
>> Sent: Monday, October 31, 2016 at 11:56 AM
>> From: "Jason H" <jh...@gmx.com>
>> To: "J-P Nurmi" <jpnu...@qt.io>
>> Cc: "interestqt-project.org" <interest@qt-project.org>
>> Subject: Re: [Interest] ComboBox with hintText?
>> 
>> Unfortunately, 1.4.
>> 
>> The QtQuickControls 2.0 were very buggy on mobile, and I've not had time to 
>> retest all the issues we had with 2.0.

Is this perception based on the early development snapshot that was released as 
a tech preview in Qt 5.6?

--
J-P Nurmi
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] ComboBox with hintText?

2016-10-31 Thread J-P Nurmi
On Mon, 2016-10-31 at 16:23 +0100, Jason H wrote:
> I'm trying to have a QML ComboBox with a hint text capability, but
> none of my efforts are panning out. The idea is that the combobox has
> an unpicked initial state, and supplied a hint as to what the
> combobox contains. Once a selection is made the combobox functions
> normally.
> 
> I'm having trouble creating my own. I'm attempting to sue a Text +
> Combobox, but the model of the combobox does not update when the
> model is obtained from the server, and there seems to be no way to
> programatically open a ComboBox in QML.
> 
> So I'm here to ask, has this been solved before?
> 

You didn't specify any version, so I'm assuming you're using the latest
and greatest Qt Quick Controls 2.

You can specify ComboBox::displayText to show any text you want on the
button, and the popup you can access via ComboBox::popup, and call
open() on it.

- http://doc.qt.io/qt-5/qml-qtquick-controls2-combobox.html#displayText
-prop
- http://doc.qt.io/qt-5/qml-qtquick-controls2-combobox.html#popup-prop

-- 
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Mouse event propagation in Qt Quick

2016-10-16 Thread J-P Nurmi
Hey Mitch,

> - In example #2, why is Flickable happy to steal events that it doesn't do 
> anything with? Shouldn't it see that it wasn't a "flick" and ignore the 
> event, so that it goes to the next highest item in the stacking order (the 
> mouse area)?

An interactive Flickable always accepts mouse press events, because it needs to 
become the "mouse grabber item" ie. the item that receives the consequent mouse 
move events. This way Flickable can detect drags and flicks.

> - Why aren't the scroll bars blocked by the mouse area in example #3?

The MouseArea is under the ScrollBar, because its parent is under the 
ScrollBar. The MouseArea is a child of Flickable::contentItem, whereas 
ScrollBars are children of the Flickable they are attached to. ScrollBar and 
Flickable::contentItem are siblings, ScrollBar being higher in the stacking 
order.

> - Why does example #3 work if I remove "preventStealing: true"?

What do you mean? That's the exact use case "preventStealing" is meant for. :) 
When the MouseArea's preventStealing is true, Flickable honors it and won't be 
able to flick or drag since it's not allowed to steal events from the 
MouseArea. When preventStealing is false, Flickable's childMouseEventFilter() 
steals the press from the MouseArea when it detects a flick or drag.

--
J-P Nurmi


From: Interest <interest-bounces+jpnurmi=qt...@qt-project.org> on behalf of 
Mitch Curtis <mitch.cur...@qt.io>
Sent: Sunday, October 16, 2016 3:42:35 PM
To: Qt Project
Subject: [Interest] Mouse event propagation in Qt Quick

Hi.

In the following example (#1), I want both the MouseArea to be clickable and 
the scroll bars to be draggable:

import QtQuick 2.7
import QtQuick.Window 2.2
import QtQuick.Controls 2.0

Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
id: root

Flickable {
anchors.fill: parent
contentWidth: rect.width
contentHeight: rect.height
boundsBehavior: Flickable.StopAtBounds

ScrollBar.vertical: ScrollBar {
id: verticalScrollBar
Binding {
target: verticalScrollBar
property: "active"
value: verticalScrollBar.hovered
}
}

Rectangle {
id: rect
width: 640
height: 1000
gradient: Gradient {
GradientStop {
position: 0
color: "#e03389"
}
GradientStop {
position: 1
color: "#20ae24"
}
}
}
}

MouseArea {
id: mouseArea
anchors.fill: parent
}

Rectangle {
id: mouseAreaRect
anchors.fill: parent
color: "transparent"
border.color: mouseArea.pressed ? "red" : "darkorange"
}
}

The mouse area can be clicked, but the scroll bars can't be dragged.

If I move the mouse area below the flickable, the opposite problem occurs: the 
scroll bars can be dragged, but the mouse area can't be clicked. Example #2:

import QtQuick 2.7
import QtQuick.Window 2.2
import QtQuick.Controls 2.0

Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
id: root

MouseArea {
id: mouseArea
anchors.fill: parent
}

Flickable {
anchors.fill: parent
contentWidth: rect.width
contentHeight: rect.height
boundsBehavior: Flickable.StopAtBounds

ScrollBar.vertical: ScrollBar {
id: verticalScrollBar
Binding {
target: verticalScrollBar
property: "active"
value: verticalScrollBar.hovered
}
}

Rectangle {
id: rect
width: 640
height: 1000
gradient: Gradient {
GradientStop {
position: 0
color: "#e03389"
}
GradientStop {
position: 1
color: "#20ae24"
}
}
}
}

Rectangle {
id: mouseAreaRect
anchors.fill: parent
color: "transparent"
border.color: mouseArea.pressed ? "red" : "darkorange"
}
}

I remembered that 

Re: [Interest] Customising ComboBox 2.0

2016-10-10 Thread J-P Nurmi
On 10 Oct 2016, at 13:35, Nuno Santos 
<nunosan...@imaginando.pt<mailto:nunosan...@imaginando.pt>> wrote:

Hi,

Is it possible to customize the drop down box of a ComboBox 2.0? It seems that 
I’m only able to customize the combobox control itself and not the content.

http://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-combobox

Hi Nuno,

There’s an example in the latest doc snapshots:

http://doc-snapshots.qt.io/qt5-5.7/qtquickcontrols2-customize.html#customizing-combobox

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] I can't find QQuickStyle class

2016-10-04 Thread J-P Nurmi
Hi Freddy,

Add "QT += quickcontrols2" to your application's .pro file.

http://doc.qt.io/qt-5/qtquickcontrols2-index.html

--
J-P Nurmi

On 4 Oct 2016, at 06:59, Freddy Martinez Garcia 
<freddy311...@gmail.com<mailto:freddy311...@gmail.com>> wrote:


Hi guys... as the doc say (http://doc.qt.io/qt-5/qtquickcontrols2-styles.html), 
I can do something like this:


#include 
#include 
#include 

int main(int argc, char *argv[])
{

QGuiApplication<http://doc.qt.io/qt-5/qguiapplication.html>::setAttribute(Qt<http://doc.qt.io/qt-5/qt.html>::AA_EnableHighDpiScaling);
QGuiApplication<http://doc.qt.io/qt-5/qguiapplication.html> app(argc, argv);

QQuickStyle<http://doc.qt.io/qt-5/qquickstyle.html>::setStyle("Material");

QQmlApplicationEngine<http://doc.qt.io/qt-5/qqmlapplicationengine.html> 
engine;
engine.load(QUrl<http://doc.qt.io/qt-5/qurl.html>("qrc:/main.qml"));

return app.exec();
}

The problem for me is that the include for QQuickStyle faile... file not 
found... so I think that I'm missing something... What do I have to add to be 
available to run this example?

Regards

Freddy


___
Interest mailing list
Interest@qt-project.org<mailto:Interest@qt-project.org>
http://lists.qt-project.org/mailman/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] A question about QtQuick.Control 2.0 ComboBox customisation

2016-09-27 Thread J-P Nurmi
The documentation for ComboBox::popup seems rather scarce, so I've added a 
related note to https://bugreports.qt.io/browse/QTBUG-55904.

- http://doc.qt.io/qt-5/qml-qtquick-controls2-combobox.html#popup-prop
- http://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html

--
J-P Nurmi


From: Nuno Santos <nunosan...@imaginando.pt>
Sent: Wednesday, September 28, 2016 00:17
To: J-P Nurmi
Cc: Qt Project
Subject: Re: [Interest] A question about QtQuick.Control 2.0 ComboBox 
customisation

Thanks so much for this tip!! I would never get there. I couldn’t find 
documentation for popup. Where is it defined?

Best regards,

Nuno

On 27 Sep 2016, at 17:22, J-P Nurmi <jpnu...@qt.io<mailto:jpnu...@qt.io>> wrote:

On 27 Sep 2016, at 17:40, Nuno Santos 
<nunosan...@imaginando.pt<mailto:nunosan...@imaginando.pt>> wrote:

Hi,

I’m customising a QtQuick.Control 2.0 ComboBox and I’m facing myself with the 
following problem:

I don’t know how to close the ComboBox when using a another element than 
ItemDelegate. The customisation page says the following:

http://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-combobox

delegate: ItemDelegate {
width: control.width
text: modelData
font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal
highlighted: control.highlightedIndex == index
}

But I need to use a rectangle in order to have a different background color of 
the combobox drop down, so I’m doing the following:

delegate: Rectangle {
width: control.width
height: label.paintedHeight+10
color: controller.settings.baseColor

Text {
id: label
anchors.fill: parent
anchors.margins: 10
text: modelData
font.family: opensans.name
font.pixelSize: 14
verticalAlignment: Text.AlignVCenter
color: 
control.highlightedIndex==index?controller.settings.highlightColor:"white"
}

MouseArea {
anchors.fill: parent
onClicked: {
control.currentIndex=index
}
}
}

But now, how do I close the combo box? Any ideas?


Hi,

The most straight-forward way is to add “control.popup.close()” in the existing 
MouseArea onClicked handler. Alternatively, switch to AbstractButton and kill 
the MouseArea altogether:


delegate: AbstractButton {

width: control.width

height: label.paintedHeight+10

padding: 10

background: Rectangle {

color: controller.settings.baseColor

}

contentItem: Text {

id: label

    // ...

}

}


--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org<mailto:Interest@qt-project.org>
http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] A question about QtQuick.Control 2.0 ComboBox customisation

2016-09-27 Thread J-P Nurmi
On 27 Sep 2016, at 17:40, Nuno Santos 
<nunosan...@imaginando.pt<mailto:nunosan...@imaginando.pt>> wrote:

Hi,

I’m customising a QtQuick.Control 2.0 ComboBox and I’m facing myself with the 
following problem:

I don’t know how to close the ComboBox when using a another element than 
ItemDelegate. The customisation page says the following:

http://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-combobox

delegate: ItemDelegate {
width: control.width
text: modelData
font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal
highlighted: control.highlightedIndex == index
}

But I need to use a rectangle in order to have a different background color of 
the combobox drop down, so I’m doing the following:

delegate: Rectangle {
width: control.width
height: label.paintedHeight+10
color: controller.settings.baseColor

Text {
id: label
anchors.fill: parent
anchors.margins: 10
text: modelData
font.family: opensans.name
font.pixelSize: 14
verticalAlignment: Text.AlignVCenter
color: 
control.highlightedIndex==index?controller.settings.highlightColor:"white"
}

MouseArea {
anchors.fill: parent
onClicked: {
control.currentIndex=index
}
}
}

But now, how do I close the combo box? Any ideas?


Hi,

The most straight-forward way is to add “control.popup.close()” in the existing 
MouseArea onClicked handler. Alternatively, switch to AbstractButton and kill 
the MouseArea altogether:


delegate: AbstractButton {

width: control.width

height: label.paintedHeight+10

padding: 10

background: Rectangle {

color: controller.settings.baseColor

}

contentItem: Text {

id: label

// ...

    }

    }


--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QtQuick Controls 2.0 copy/past

2016-09-03 Thread J-P Nurmi
On Friday, September 2, 2016 20:30, Xavier Bigand <flamaros.xav...@gmail.com> 
wrote:
> I made few more tests on android with QtQuick Controls 2.0, and I was 
> surprise to see that the copy/past isn't possible. So I
> found the following bug report https://bugreports.qt.io/browse/QTBUG-34867
>
> Is there a chance to see that fixed in Qt5.8? because it can be a blocker for 
> a lot of applications.

Hi,

These are the relevant patches:

- Android selection handles: https://codereview.qt-project.org/#/c/142466/
- Android: Show the edit menu when things are selected: 
https://codereview.qt-project.org/#/c/167017/

They were merged to the dev-branch before 5.8 was branched off.

--
J-P Nurmi
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt 5.7 - iOS - module "QtGraphicalEffects" plugin "qtgraphicaleffectsplugin" not found

2016-08-11 Thread J-P Nurmi
On 11 Aug 2016, at 14:43, Ben Lau <xben...@gmail.com<mailto:xben...@gmail.com>> 
wrote:


I think so. I would suggest to add a new variable called "QML_SCAN_PATH" for 
qmake. And let's qmlimportscanner scan those directory too. Moreover, due to 
QTBUG-48480, it may also need a variable QML_EXCLUDE_SCAN_PATH too.

[QTBUG-48480] Qt5QuickTest should not be linked in iOS target for non-unit test 
program - Qt Bug Tracker<https://bugreports.qt.io/browse/QTBUG-48480>

There’s already QML_IMPORT_PATH that is only (?) used by Qt Creator for 
resolving imports. Perhaps the same variable could be used for 
qmlimportscanner...

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Why does QML prefer 'count' over '.length'?

2016-07-28 Thread J-P Nurmi
On Thursday, July 28, 2016 15:46, Jason H <jh...@gmx.com> wrote:
> Look, I know JS was invented in 10 days back in 1995. There's no shortage of 
> things to complain about. But
> 'length' was chosen, and it is the number of items. I would agree with you 
> that length is not as good as 'count', but
> the language is the language. Qt should move to be in compliance wit the 
> language because JS was using it first,
> then Qt moved into JS. Unless you want to convince JS they should add count 
> to everything as well. And I assure
> you there is more lines of JS using length than all lines of QML put together.
> 
> Consider the absurdity of the reverse:
> Why don't we ditch .length in QML and just make everything count?

Nobody is saying that 'length' wouldn't make sense for JS arrays or the generic 
Qt containers. 'Length' does make perfect sense in that context.

What I've been trying to say that comparing JS array to QML ListModel is like 
comparing QList or QVector to QAbstractItemModel. That does not make sense. 
They have different APIs and different needs. They are not interchangeable 
components even if your code snippet attempts to make it look like that. While 
primitive containers can be used in any context, item models are deliberately 
designed to feed data to item views. That is the context where 'count' wins 
'length' hands down.

--
J-P Nurmi
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Why does QML prefer 'count' over '.length'?

2016-07-26 Thread J-P Nurmi
On Tuesday, July 26, 2016 22:04,Jason H <jh...@gmx.com> wrote:
> JS uses length on arrays and strings. Anytime you have an array (be it a 
> list, etc) the number of items is denoted as .length

And in QML you have .length where you'd expect to have it, in JS arrays and 
strings.

> It makes no sense to have Qt use count in similar situations.

Arrays and strings are not exactly similar situations to item views and item 
models. :)

> As Thiago mentioned length, size and count are all analogous in the C++ API, 
> so I don't know how/why they are ambiguous.

The C++ API of the Qt containers. Not item views nor item models. Two entirely 
different worlds. The length or size of an array is clear, but the length or 
size of a list view is likely to get associated to the UI element's visual 
geometry.

> I write quite a bit of JS code (server and mobile) and it seems rather 
> arbitrary to continue to use count. > 
> Specific places: 
> All models. DelegateModel, DelegateModelGroup, ListModel, etc.

It's not that arbitrary. "Count" is used all over in item views and item 
models, in C++ and in QML.

--
J-P Nurmi
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Why does QML prefer 'count' over '.length'?

2016-07-26 Thread J-P Nurmi
On Tuesday, July 26, 2016 19:02, Jason H <jh...@gmx.com> wrote:
> I seem to remember that too. Would it be possible to at least add .length so 
> that we conform to the norm?

Adding .length to QML "stuff" is not very specific. Where exactly would you 
like .length to be added? For something like ListView, both .length and .size 
would be ambiguous, whereas .count is not that easy to misunderstand, is it?

--
J-P Nurmi
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Utilizing the GPU, how to start?

2016-07-06 Thread J-P Nurmi
> On 06 Jul 2016, at 19:41, Uwe Rathmann <uwe.rathm...@tigertal.de> wrote:
> 
>> On Tue, 05 Jul 2016 23:58:48 -0700, Thiago Macieira wrote:
>> 
>> So what you want isn't QWidget with OpenGL support. We've proven it
>> won't work. What you want is a powerful, Scene Graph-based set of
>> widgets with native look and feel (that is Qt Quick Controls).
>> 
>> You're probably also asking for a C++ API instead of a QML one.
> 
> And this is exactly what I'm currently trying to do - creating a set of 
> Quick controls offering full featured C++ and QML APIs.
> 
> Our main motivation is the well known instantiation problem of QML, that 
> is totally dominating the overall performance of our user interface. As 
> most of our QML code is application code, having a C++ API for the 
> controls is mandatory to significantly limit the amount of QML.

Interesting choice. I would have done the exact opposite. Application logic in 
C++ and UI declaration in QML. Declaring fluid animated UIs in QML is a joy, 
writing animations in C++ is not so.

--
J-P Nurmi
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] ApplicationWindow is not an Item?

2016-06-16 Thread J-P Nurmi

>> On 16 Jun 2016, at 17:42, Jason H <jh...@gmx.com> wrote:
>> 
>> I tried using Keys on an application window. I got an error that it is not 
>> an item. While it's trivial to throw an item in, why isn't it an Item?
> 
> Because QML Window is not an Item. I'd like the Keys attached property work 
> regardless, though. It should just forward it to the content item of the 
> window. This has been discussed several times, but I don't remember why it 
> wasn't done yet.

A good point in the comments of https://bugreports.qt.io/browse/QTBUG-28957 
that you're probably better off with the Shortcut QML type.

--
J-P Nurmi
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] ApplicationWindow is not an Item?

2016-06-16 Thread J-P Nurmi

> On 16 Jun 2016, at 17:42, Jason H <jh...@gmx.com> wrote:
> 
> I tried using Keys on an application window. I got an error that it is not an 
> item. While it's trivial to throw an item in, why isn't it an Item?

Because QML Window is not an Item. I'd like the Keys attached property work 
regardless, though. It should just forward it to the content item of the 
window. This has been discussed several times, but I don't remember why it 
wasn't done yet.

--
J-P Nurmi
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qt.labs.controls - Flickable - Pane - Label: max width problem

2016-05-11 Thread J-P Nurmi
> On 11 May 2016, at 21:41, ekke <e...@ekkes-corner.org> wrote:
> 
> Qt 5.7 Beta, Android 6.0.1, BlackBerry PRIV
> 
> qt.labs.controls, Material
> 
> Given this (simplified) code:
> 
> ApplicationWindow {
>Flickable {
>contentHeight: root.implicitHeight
>anchors.fill: parent
>Pane {
>id: root
>anchors.fill: parent
>ColumnLayout {
>anchors.right: parent.right
>anchors.left: parent.left
>// some controls
>Label {
>Layout.maximumWidth: parent.width
>text: "Display4: 112 px"
>font.pixelSize: 112
>opacity: 0.54
>}
>}
>}
>} 
> } 
> 
> ApplicationWindow covers the complete screen of my android device.
> 
> I need a flickable Pane containing a ColumnLayout to resize controls if
> orientation changes.
> 
> All worked OK.
> 
> Then I added some Label for the different Font Sizes from Google Material
> 
> The text of Label for Display 4 with 112 px doesn't fit into screen
> size. Instead of cutting the text, Qt resizes to a width where the Label
> fits.
> 
> Side effect: all other UI Controls placed at the right side weren't
> visible anymore.
> 
> Adding wrapMode WordWrap didn't help.
> 
> Only workaround helping was to add Layout.maximumWidth: parent.width to
> all Label controls where the text is out of bounderies.
> 
> Then Text outside was "cut" or if using WordWrap goes into the next line.
> 
> ---
> 
> Did I something wrong, is this expected behaviour or should I open a
> bugreport ?
> 
> ekke

By default, a vertical ColumnLayout doesn’t resize children horizontally (but 
it calculates the required implicit width to fit all children), and a 
horizontal RowLayout doesn’t resize children vertically (but it calculates the 
required implicit height to fit all children). If you want ColumnLayout and 
RowLayout to resize the children to fill width and height, respectively, you 
can use the “Layout.fillWidth: true” and “Layout.fillHeight: true” attached 
properties for the children. For Label you have basically two options to choose 
from: eliding (eg. "elide: Label.ElideRight") or wrapping (eg. "wrapMode: 
Label.Wrap”).

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qt.labs.controls / QtQuickControls2: ToolBar, Label / Image Colors, tinting...

2016-05-10 Thread J-P Nurmi
On 06 May 2016, at 19:49, ekke 
<e...@ekkes-corner.org<mailto:e...@ekkes-corner.org>> wrote:

just noticed that in Qt 5.7 there's a new property Material.foreground:
http://doc-snapshots.qt.io/qt5-5.7/qtquickcontrols2-material.html#foreground-attached-prop
seems this didn't make it into the 5.7 Beta
from docs:
The default value is theme-specific (light or dark).
So there's no dependency between primary and foreground and I have to calculate 
it by myself for text inside ToolBar

still my question about tinting images for Material

Am 06.05.16 um 17:59 schrieb ekke:

it's really easy to create a Toolbar with Title and Menu using qt.labs.controls 
and Material style:

import QtQuick 2.6
import QtQuick.Layouts 1.3
import Qt.labs.controls 1.0
import Qt.labs.controls.material 1.0

ToolBar {
id: titleToolBar
property alias text: titleLabel.text
RowLayout {
focus: false
spacing: 20
anchors.fill: parent
Label {
id: titleLabel
text: "ekke"
font.pixelSize: 20
elide: Label.ElideRight
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: true
}
ToolButton {
Image {
anchors.centerIn: parent
source: "qrc:/images/menu.png"
}
// onClicked: doSomething()
}
}
}

I'm getting the primaryColor as background of ToolBar as expected.

Problem is when primaryColor is a dark color and needs white as text color.

Here's the overview of Material Color Palette where you can see when text 
should be black or white:

http://www.google.com/design/spec/style/color.html#color-color-palette

I'm always getting black as color - is there something like color: 
Material.textOnPrimary ?

Or do I have to handle this by my own logic or mappings ?

Using a dark primary color not only needs white text color, but also white 
Images as used in ToolButton -> Image above.

Hi,

The latest 5.7 branch now has the correct ToolBar foreground color out of the 
box, when using one of the pre-defined primary colors.

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt 5.7 - Using File Selectors with Qt Quick Controls 2

2016-05-10 Thread J-P Nurmi
On 08 May 2016, at 14:36, ekke 
<e...@ekkes-corner.org<mailto:e...@ekkes-corner.org>> wrote:

Am 08.05.16 um 13:50 schrieb Nikita Krupenko:
2016-05-08 13:59 GMT+03:00 ekke 
<e...@ekkes-corner.org<mailto:e...@ekkes-corner.org>>:
what if (per ex. for a demo app) user can switch between universal and
material and using some images specific to universal, others to material and
this in combination with ios and android - is this possible via file
selector or will it only work for one style per platform.
You can place style-specific images into separate folders and if you
have some different images in style for os you can check
Qt.platform.os and select the appropriate image:
https://doc.qt.io/qt-5/qml-qtqml-qt.html#platform-prop
For example, you have:

+material/img_ios.png
+material/img_android.png

Image {
   source: Qt.platform.os === "ios" ? "img_ios.png" : "img_android.png"
}
thanks


Hi,

Notice that you can combine file selectors, for example:
- img.png // the base image must always exist
- +material/img.png // used with the material style, except on ios
- +material/+ios/img.png // used with the material style on ios

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] React to signal only when at top of StackView

2016-05-07 Thread J-P Nurmi
> On 06 May 2016, at 23:27, Elvis Stansvik <elvst...@gmail.com> wrote:
> 
> 2016-05-06 22:41 GMT+02:00 J-P Nurmi <jpnu...@qt.io>:
>> 
>> 
>> The Stack.status property must be attached to an item that is in a 
>> StackView. In the snippet above, it is attached to the Connections element. 
>> You can give the Rectangle element an id to be able to attach the property 
>> to it instead.
>> 
>>initialItem: Rectangle {
>>   id: rect // <==
>>   anchors.fill: parent
>>   color: "green"
>>   Connections {
>>   target: rect.Stack.status === rect.Stack.Active ? button : 
>> null // <==
> 
> BTW, out of curiosity, do you know why the above works, but not:
> 
>   target: parent.Stack.status === parent.Stack.Active
> ? button : null // <==
> 
> ?
> 
> Elvis

Hi, it’s because ‘parent’ is a property of Item, but Connections is not an Item.

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] React to signal only when at top of StackView

2016-05-06 Thread J-P Nurmi
> On 06 May 2016, at 22:27, Elvis Stansvik <elvst...@gmail.com> wrote:
> 
> Hi all,
> 
> I want that an item reacts to a certain signal only when it is at the
> top of a StackView, so I tried something like:
> 
>Connections {
>// Below won't work:
>target: Stack.status === Stack.Active ? button : null
>//target: button // ..but this works
>onClicked: console.log("clicked")
>}
> 
> That is, making the target of the connection null unless Stack.status
> == Stack.Active, but it seems it's not working.
> 
> Full example below:
> 
> import QtQuick 2.4
> import QtQuick.Controls 1.3
> import QtQuick.Window 2.2
> 
> Window {
>id: window
>width: 500
>height: 500
>visible: true
> 
>Column {
>Rectangle {
>width: 100
>height: 100
>color: "gray"
> 
>MouseArea {
>id: button
>anchors.fill: parent
>Text {
>text: "Click Me"
>anchors.centerIn: parent
>}
>}
>}
> 
>StackView {
>id: stackView
>width: 100
>height: 100
> 
>initialItem: Rectangle {
>anchors.fill: parent
>color: "green"
>Connections {
>// Below won't work:
>target: Stack.status === Stack.Active ? button : null
>//target: button // ..but this works
>onClicked: console.log("clicked")
>}
>}
>}
>}
> }
> 
> Anyone know what the problem might be? The item here is definitely
> active on the stack, since it's the initial (and only item).
> 

Hi,

The Stack.status property must be attached to an item that is in a StackView. 
In the snippet above, it is attached to the Connections element. You can give 
the Rectangle element an id to be able to attach the property to it instead.

initialItem: Rectangle {
   id: rect // <==
   anchors.fill: parent
   color: "green"
   Connections {
   target: rect.Stack.status === rect.Stack.Active ? button : 
null // <==
   onClicked: console.log("clicked")
   }
   }

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qt.labs.controls / QtQuickControls2: ToolBar, Label / Image Colors, tinting...

2016-05-06 Thread J-P Nurmi
Hi ekke,

One possibility for tinting images could be to use ColorOverlay from 
QtGraphicalEffects: 
http://doc.qt.io/qt-5/qml-qtgraphicaleffects-coloroverlay.html

--
J-P Nurmi



On 06 May 2016, at 19:49, ekke 
<e...@ekkes-corner.org<mailto:e...@ekkes-corner.org>> wrote:

just noticed that in Qt 5.7 there's a new property Material.foreground:
http://doc-snapshots.qt.io/qt5-5.7/qtquickcontrols2-material.html#foreground-attached-prop
seems this didn't make it into the 5.7 Beta
from docs:
The default value is theme-specific (light or dark).
So there's no dependency between primary and foreground and I have to calculate 
it by myself for text inside ToolBar

still my question about tinting images for Material

Am 06.05.16 um 17:59 schrieb ekke:

it's really easy to create a Toolbar with Title and Menu using qt.labs.controls 
and Material style:

import QtQuick 2.6
import QtQuick.Layouts 1.3
import Qt.labs.controls 1.0
import Qt.labs.controls.material 1.0

ToolBar {
id: titleToolBar
property alias text: titleLabel.text
RowLayout {
focus: false
spacing: 20
anchors.fill: parent
Label {
id: titleLabel
text: "ekke"
font.pixelSize: 20
elide: Label.ElideRight
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: true
}
ToolButton {
Image {
anchors.centerIn: parent
source: "qrc:/images/menu.png"
}
// onClicked: doSomething()
}
}
}

I'm getting the primaryColor as background of ToolBar as expected.

Problem is when primaryColor is a dark color and needs white as text color.

Here's the overview of Material Color Palette where you can see when text 
should be black or white:

http://www.google.com/design/spec/style/color.html#color-color-palette

I'm always getting black as color - is there something like color: 
Material.textOnPrimary ?

Or do I have to handle this by my own logic or mappings ?

Using a dark primary color not only needs white text color, but also white 
Images as used in ToolButton -> Image above.

Do I need two different image sets for black or white ?

Or is there something like 'tinting' an Image as for other OS ?

(BlackBerry Cascades: setFilterColor(), Android: setColorFilter, iOS: tintColor 
= UIColor.redColor())

Inside the Toolbar depending from Material primary color, I need black or 
white, also for BottomNavigation (Android)

There are other situations where I have to 'tint' Images with the primary color 
as for selected buttons in iOS bottom navigation bar

Would be great to get some hints or if there's something inside 
qt.labs.controls / QtQuickControls2 I could use - even with the risk of API 
changes in future.

THANKS
--

ekke (ekkehard gentz)

independent software architect
international development native mobile business apps
BlackBerry 10 | Qt Mobile (Android, iOS)




___
Interest mailing list
Interest@qt-project.org<mailto:Interest@qt-project.org>
http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org<mailto:Interest@qt-project.org>
http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QtLabsControls Button - Invalid property name "label".

2016-04-25 Thread J-P Nurmi
On 25 Apr 2016, at 10:01, Viktória Nemkin 
<viktoria.nem...@gmail.com<mailto:viktoria.nem...@gmail.com>> wrote:

Hello!

I'm just starting out with the newly released QtLabsControls. I have tried 
using a Button and ran into a problem:


import QtQuick 2.0

import Qt.labs.controls 1.0


Button {

label: Item {

Text {

text: "Example"

}

Image {

id: icon

source: "qrc:/x.svg"

}

}

}


In this example QtCreator tells me "label" is an invalid property name.

According to the documentation here it is should exist:
http://doc.qt.io/qt-5/qml-qt-labs-controls-abstractbutton.html

What am I missing?

Hi,

Are you using 5.7 beta? The Button::label property was replaced by a more 
generic Control::contentItem property. We’ve been reviewing, aligning and 
cleaning up the APIs so there are going to be some minor API differences 
between the tech preview in 5.6 beta and the final release in 5.7.0.

Button {
    contentItem: Item { … }
}

--
J-P Nurmi

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest