Re: [Interest] Cannot drag a Pane in Qml even on Qt 6.X

2023-03-06 Thread Nuno Santos
Mitch,

Thank you very much for the clarification.

Best regards,

Nuno

> On 7 Mar 2023, at 00:28, EXT Mitch Curtis  wrote:
> 
>> -Original Message-
>> From: Interest > > On Behalf Of Nuno
>> Santos
>> Sent: Monday, 6 March 2023 4:55 PM
>> To: Qt Interest mailto:interest@qt-project.org>>
>> Subject: [Interest] Cannot drag a Pane in Qml even on Qt 6.X
>> 
>> Hi,
>> 
>> It was not possible to drag a Pane on Qt 5.X
>> 
>> But I was almost convinced it was possible to do it on Qt 6.X
>> 
>> But now I have tried again and it seems it is not possible. Or maybe I’m 
>> doing
>> something wrong.
>> 
>> Is there any strong reason a Pane cannot be draggable?
> 
> The parent of the MouseArea is the contentItem, thanks to contentData being 
> the default property. That's explained here:
> 
> https://doc.qt.io/qt-6/qml-qtquick-controls2-pane.html#details 
> 
> 
> You can see what really happens by modifying the code below to set the drag 
> target to parent again and uncomment the title binding - the contentItem (and 
> black-bordered rectangle) will move but the Pane itself won't.
> 
> Set the drag target to the pane and it will work:
> 
>import QtQuick
>import QtQuick.Controls
> 
>Window {
>width: 640
>height: 480
>visible: true
>title: "pane.x: " + pane.x + " pane.y: " + pane.y
>//title: "pane.contentItem.x: " + pane.contentItem.x + 
> "pane.contentItem.y: " + pane.contentItem.y
> 
>Item {
>width: 200
>height: 200
> 
>DropArea {
>x: 75
>y: 75
>width: 50
>height: 50
> 
>Rectangle {
>anchors.fill: parent
>color: parent.containsDrag ? "green" : "gray"
>}
>}
> 
>Pane {
>id: pane
>x: 10
>y: 10
>width: 20
>height: 20
>leftPadding: 0
>rightPadding: 0
>topPadding: 0
>bottomPadding: 0
>background: Rectangle {
>color: "tomato"
>}
> 
>Rectangle {
>anchors.fill: parent
>color: "transparent"
>border.color: "black"
>}
> 
>Drag.active: dragArea.drag.active
>Drag.hotSpot.x: 10
>Drag.hotSpot.y: 10
> 
>MouseArea {
>id: dragArea
>anchors.fill: parent
> 
>drag.target: pane
>}
>}
>}
>}
> 
>> Thanks!
>> 
>> Nuno
>> 
>> 
>> import QtQuick
>> import QtQuick.Layouts
>> import QtQuick.Controls
>> 
>> Window {
>>width: 640
>>height: 480
>>visible: true
>>title: qsTr("Hello World")
>> 
>>Item {
>>width: 200; height: 200
>> 
>>DropArea {
>>x: 75; y: 75
>>width: 50; height: 50
>> 
>>Rectangle {
>>anchors.fill: parent
>>color: parent.containsDrag ? "green" : "gray"
>>}
>>}
>> 
>>//Rectangle {
>>Pane {
>>x: 10; y: 10
>>width: 20; height: 20
>>//color: "red"
>> 
>>Drag.active: dragArea.drag.active
>>Drag.hotSpot.x: 10
>>Drag.hotSpot.y: 10
>> 
>>MouseArea {
>>id: dragArea
>>anchors.fill: parent
>> 
>>drag.target: parent
>>}
>>}
>>}
>> }
>> ___
>> Interest mailing list
>> Interest@qt-project.org 
>> https://lists.qt-project.org/listinfo/interest 
>> 
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] can't dump QStringList with qDebug()

2023-03-06 Thread Hamish Moffatt via Interest
I'm porting my code to Qt6 (6.4.2) (from 5.15) and ran into this 
mysterious problem; this code doesn't compile:


    const auto connections = QSqlDatabase::connectionNames();
    qDebug() << "Closing open connections:" << connections;


claiming that

../../../src/server/server_database.cpp:691:45: error: invalid operands 
to binary expression ('QDebug' and 'const QList')


It then lists all the candidates, of which there are many.  I have a 
simple test program that compiles OK though.


The same occurs on both Visual Studio/Windows and gcc 10/Linux.

Am I missing an include or something?


Hamish



../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qdatastream.h:398:1: note: 
candidate function template not viable: no known conversion from 'QDebug' to 
'QDataStream &' for 1st argument
operator<<(QDataStream , const T )
^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qdatastream.h:415:63: note: 
candidate function template not viable: no known conversion from 'QDebug' to 
'QDataStream &' for 1st argument
inline QDataStreamIfHasOStreamOperatorsContainer, T> operator<<(QDataStream , 
const QList )
  ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qobject.h:491:22: note: candidate 
function not viable: no known conversion from 'const QList' to 'const 
QObject *' for 2nd argument
Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *);
 ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtSql/qsqldatabase.h:105:21: note: candidate 
function not viable: no known conversion from 'const QList' to 'const 
QSqlDatabase' for 2nd argument
Q_SQL_EXPORT QDebug operator<<(QDebug, const QSqlDatabase &);
^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qdebug.h:447:15: note: candidate 
function not viable: no known conversion from 'const QList' to 
'QKeyCombination' for 2nd argument
inline QDebug operator<<(QDebug debug, QKeyCombination combination)
  ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qiodevice.h:143:22: note: candidate 
function not viable: no known conversion from 'const QList' to 
'QIODevice::OpenMode' (aka 'QFlags') for 2nd argument
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QIODevice::OpenMode modes);
 ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qvariant.h:560:28: note: candidate 
function not viable: no known conversion from 'QDebug' to 'QDataStream &' for 
1st argument
Q_CORE_EXPORT QDataStream <<(QDataStream , const QVariant );
   ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qvariant.h:622:22: note: candidate 
function not viable: no known conversion from 'const QList' to 'const 
QVariant::Type' for 2nd argument
Q_CORE_EXPORT QDebug operator<<(QDebug, const QVariant::Type);
 ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qlocale.h:1142:22: note: candidate 
function not viable: no known conversion from 'const QList' to 'const 
QLocale' for 2nd argument
Q_CORE_EXPORT QDebug operator<<(QDebug, const QLocale &);
 ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qdatetime.h:540:22: note: candidate 
function not viable: no known conversion from 'const QList' to 'QDate' 
for 2nd argument
Q_CORE_EXPORT QDebug operator<<(QDebug, QDate);
 ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qdatetime.h:541:22: note: candidate 
function not viable: no known conversion from 'const QList' to 'QTime' 
for 2nd argument
Q_CORE_EXPORT QDebug operator<<(QDebug, QTime);
 ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qdatetime.h:542:22: note: candidate 
function not viable: no known conversion from 'const QList' to 'const 
QDateTime' for 2nd argument
Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &);
 ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qfileinfo.h:175:22: note: candidate 
function not viable: no known conversion from 'const QList' to 'const 
QFileInfo' for 2nd argument
Q_CORE_EXPORT QDebug operator<<(QDebug, const QFileInfo &);
 ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qdir.h:244:22: note: candidate function not 
viable: no known conversion from 'const QList' to 'QDir::Filters' (aka 
'QFlags') for 2nd argument
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters);
 ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qdir.h:245:22: note: candidate 
function not viable: no known conversion from 'const QList' to 'const 
QDir' for 2nd argument
Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QDir );
 ^
../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qregularexpression.h:166:22: note: 
candidate function not viable: no known conversion from 'const QList' 
to 'const QRegularExpression' for 2nd argument
Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QRegularExpression );
 ^

[Interest] Transparent WebEngineView hides the elements behind it

2023-03-06 Thread Austin via Interest

 Ifwe make a Qt WebEngineView transparent it will not allow viewinganything 
behind it. This includes other Qt Quick elements or stuffdrawn behind it using 
OpenGL. Instead it causes whatever the previousframe was to be repeated. So for 
instance if we display an image inthe WebView and get rid of it, the image will 
still be there as a"ghost".


Arewe doing something wrong with the new rendering api or is this a bug?





Anexample of thisbehavior:  
https://github.com/jellyfin/jellyfin-media-player/tree/qt6


Thanks!


Austin

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


Re: [Interest] Cannot drag a Pane in Qml even on Qt 6.X

2023-03-06 Thread EXT Mitch Curtis via Interest
> -Original Message-
> From: Interest  On Behalf Of Nuno
> Santos
> Sent: Monday, 6 March 2023 4:55 PM
> To: Qt Interest 
> Subject: [Interest] Cannot drag a Pane in Qml even on Qt 6.X
> 
> Hi,
> 
> It was not possible to drag a Pane on Qt 5.X
> 
> But I was almost convinced it was possible to do it on Qt 6.X
> 
> But now I have tried again and it seems it is not possible. Or maybe I’m doing
> something wrong.
> 
> Is there any strong reason a Pane cannot be draggable?

The parent of the MouseArea is the contentItem, thanks to contentData being the 
default property. That's explained here:

https://doc.qt.io/qt-6/qml-qtquick-controls2-pane.html#details

You can see what really happens by modifying the code below to set the drag 
target to parent again and uncomment the title binding - the contentItem (and 
black-bordered rectangle) will move but the Pane itself won't.

Set the drag target to the pane and it will work:

import QtQuick
import QtQuick.Controls

Window {
width: 640
height: 480
visible: true
title: "pane.x: " + pane.x + " pane.y: " + pane.y
//title: "pane.contentItem.x: " + pane.contentItem.x + 
"pane.contentItem.y: " + pane.contentItem.y

Item {
width: 200
height: 200

DropArea {
x: 75
y: 75
width: 50
height: 50

Rectangle {
anchors.fill: parent
color: parent.containsDrag ? "green" : "gray"
}
}

Pane {
id: pane
x: 10
y: 10
width: 20
height: 20
leftPadding: 0
rightPadding: 0
topPadding: 0
bottomPadding: 0
background: Rectangle {
color: "tomato"
}

Rectangle {
anchors.fill: parent
color: "transparent"
border.color: "black"
}

Drag.active: dragArea.drag.active
Drag.hotSpot.x: 10
Drag.hotSpot.y: 10

MouseArea {
id: dragArea
anchors.fill: parent

drag.target: pane
}
}
}
}

> Thanks!
> 
> Nuno
> 
> 
> import QtQuick
> import QtQuick.Layouts
> import QtQuick.Controls
> 
> Window {
> width: 640
> height: 480
> visible: true
> title: qsTr("Hello World")
> 
> Item {
> width: 200; height: 200
> 
> DropArea {
> x: 75; y: 75
> width: 50; height: 50
> 
> Rectangle {
> anchors.fill: parent
> color: parent.containsDrag ? "green" : "gray"
> }
> }
> 
> //Rectangle {
> Pane {
> x: 10; y: 10
> width: 20; height: 20
> //color: "red"
> 
> Drag.active: dragArea.drag.active
> Drag.hotSpot.x: 10
> Drag.hotSpot.y: 10
> 
> MouseArea {
> id: dragArea
> anchors.fill: parent
> 
> drag.target: parent
> }
> }
> }
> }
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QProcess unbuffered

2023-03-06 Thread Thiago Macieira
On Monday, 6 March 2023 12:17:39 PST Björn Schäpers wrote:
> I had the exact same problem (but without QProcess). You have to use a trick
> to disable the buffering, I don't know if its possible with QProcess, you
> will have to use QProcess::CreateProcessArgumentModifier or most likely
> CreateProcess directly.

QProcess gives you access to all options of CreateProcess, so if it's a matter 
of flags, it should be doable with it.

If it's something else, we'd like to know. 

> If there is interest I can copy some of my data, but currently I can't
> access it.


-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QProcess unbuffered

2023-03-06 Thread Elvis Stansvik
Den mån 6 mars 2023 kl 21:21 skrev Scott Bloom :
>
>
>
> From: Björn Schäpers 
> Sent: Monday, March 6, 2023 12:18 PM
> To: Scott Bloom ; interest@qt-project.org
> Subject: Re: [Interest] QProcess unbuffered
>
>
>
> Am 06.03.2023 um 02:11 schrieb Scott Bloom:
>
> I have an external executable (mkvalidator from 
> https://www.matroska.org/downloads/mkvalidator.html
>
>
>
> It never flushes the output, and it uses linefeed without carriage returns to 
> overwrite existing text on the output.
>
>
> The problem is, when I run it via QProcess (on windows, Qt 5.15.10), I get 
> zero output until the process ends.  As if it was buffered, and the output 
> was finally flushed
>
> When running from the command line, I do get output continuously during the 
> processing.
>
>
>
> I setup a timer to waitForRead, didn’t do anything. I cant seem to force the 
> QProcess to read all stdout or stderror info.
>
> Any thoughts?
>
>
> TIA
>
> Scott
>
>
>
> ___
>
> Interest mailing list
>
> Interest@qt-project.org
>
> https://lists.qt-project.org/listinfo/interest
>
> Hi,
>
> I had the exact same problem (but without QProcess). You have to use a trick 
> to disable the buffering, I don't know if its possible with QProcess, you 
> will have to use QProcess::CreateProcessArgumentModifier or most likely 
> CreateProcess directly.
>
> If there is interest I can copy some of my data, but currently I can't access 
> it.
>
> Kind regards,
> Björn.
>
> I would love any info/data you can provide.  Feel free to email me privately 
> if you want.

If possible, keep it on the list, to not leave us hanging. I think
it's valuable for both Qt devs and users to see other people's
laundry, even if it's a bit dirty :)

Elvis

>
> Thanks
>
> Scott
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] QML singleton properties are undefined if file placed in subdirectory

2023-03-06 Thread Maxim
Qt 6.4.2 QML singleton's properties undefined if singleton QML file placed
in subdirectory e.g "/qml" (${CMAKE_SOURCE_DIR}/qml/Style.qml)


set_source_files_properties(Style.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)

qt_add_qml_module(untitled
URI untitled
VERSION 1.0
QML_FILES qml/main.qml qml/Style.qml
)

Is it Qt bug or an something extra should be declared when qml files not
lay directly in project root?
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QProcess unbuffered

2023-03-06 Thread Scott Bloom

From: Björn Schäpers 
Sent: Monday, March 6, 2023 12:18 PM
To: Scott Bloom ; interest@qt-project.org
Subject: Re: [Interest] QProcess unbuffered

Am 06.03.2023 um 02:11 schrieb Scott Bloom:
I have an external executable (mkvalidator from 
https://www.matroska.org/downloads/mkvalidator.html

It never flushes the output, and it uses linefeed without carriage returns to 
overwrite existing text on the output.

The problem is, when I run it via QProcess (on windows, Qt 5.15.10), I get zero 
output until the process ends.  As if it was buffered, and the output was 
finally flushed

When running from the command line, I do get output continuously during the 
processing.

I setup a timer to waitForRead, didn’t do anything. I cant seem to force the 
QProcess to read all stdout or stderror info.

Any thoughts?

TIA
Scott



___

Interest mailing list

Interest@qt-project.org

https://lists.qt-project.org/listinfo/interest
Hi,

I had the exact same problem (but without QProcess). You have to use a trick to 
disable the buffering, I don't know if its possible with QProcess, you will 
have to use QProcess::CreateProcessArgumentModifier or most likely 
CreateProcess directly.

If there is interest I can copy some of my data, but currently I can't access 
it.

Kind regards,
Björn.
I would love any info/data you can provide.  Feel free to email me privately if 
you want.

Thanks
Scott
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QProcess unbuffered

2023-03-06 Thread Björn Schäpers

Am 06.03.2023 um 02:11 schrieb Scott Bloom:


I have an external executable (mkvalidator from 
https://www.matroska.org/downloads/mkvalidator.html


It never flushes the output, and it uses linefeed without carriage returns to 
overwrite existing text on the output.



The problem is, when I run it via QProcess (on windows, Qt 5.15.10), I get 
zero output until the process ends.  As if it was buffered, and the output was 
finally flushed


When running from the command line, I do get output continuously during the 
processing.


I setup a timer to waitForRead, didn’t do anything. I cant seem to force the 
QProcess to read all stdout or stderror info.


Any thoughts?


TIA

Scott


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

Hi,

I had the exact same problem (but without QProcess). You have to use a trick to 
disable the buffering, I don't know if its possible with QProcess, you will have 
to use QProcess::CreateProcessArgumentModifier or most likely CreateProcess 
directly.


If there is interest I can copy some of my data, but currently I can't access 
it.

Kind regards,
Björn.___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Cannot drag a Pane in Qml even on Qt 6.X

2023-03-06 Thread Nuno Santos
Hi,

It was not possible to drag a Pane on Qt 5.X

But I was almost convinced it was possible to do it on Qt 6.X

But now I have tried again and it seems it is not possible. Or maybe I’m doing 
something wrong.

Is there any strong reason a Pane cannot be draggable?

Thanks!

Nuno


import QtQuick
import QtQuick.Layouts
import QtQuick.Controls

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

Item {
width: 200; height: 200

DropArea {
x: 75; y: 75
width: 50; height: 50

Rectangle {
anchors.fill: parent
color: parent.containsDrag ? "green" : "gray"
}
}

//Rectangle {
Pane {
x: 10; y: 10
width: 20; height: 20
//color: "red"

Drag.active: dragArea.drag.active
Drag.hotSpot.x: 10
Drag.hotSpot.y: 10

MouseArea {
id: dragArea
anchors.fill: parent

drag.target: parent
}
}
}
}
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest