[Interest] QQuick3DGeometry example not working

2020-09-26 Thread joao morgado via Interest
I'm trying to draw a line using QQuick3DGeometry but nothing is draw. 
I couldnt find a working example of QQuick3DGeometry, if anyone knows please 
share.

Also I dont need normals for a line, but not using them gives me a warning: 
QSSG.warning: Failed to bind attribute attr_norm

The full code example I did:
https://drive.google.com/file/d/1trroeJ_xXjwbW8M1CKiy3WXAVtOl8UHQ/view?usp=sharing
The relevant code:
//
class Entity_Line : public QQuick3DGeometry
{
    Q_OBJECT
    Q_PROPERTY(QVector3D p0 READ p0 WRITE setP0 NOTIFY p0Changed)
    Q_PROPERTY(QVector3D p1 READ p1 WRITE setP1 NOTIFY p1Changed)

public:
    Entity_Line(QQuick3DObject *ptr = nullptr);

    //~Entity_Line();


    QVector3D p0() const {return m_P0;}
    QVector3D p1() const {return m_P1;}

public slots:
    void setP0(const QVector3D &p0);
    void setP0(const float &px, const float &py, const float &pz);
    void setP1(const QVector3D &p1);
    void setP1(const float &px, const float &py, const float &pz);

Q_INVOKABLE void setupGeometry();

signals:
    void p0Changed(QVector3D newP0);
    void p1Changed(QVector3D newP1);

private:
    QVector3D m_P0;
    QVector3D m_P1;
};

//---
Entity_Line::Entity_Line(QQuick3DObject *ptr) :
    QQuick3DGeometry(ptr)
{
    setName("line");
    setP0(-50, -50, -10);
    setP1(50, 50, 10);

    setupGeometry();

}

void Entity_Line::setP0(const QVector3D &p0)
{
    if (m_P0 == p0)
    return;
    m_P0 = p0;
    emit p0Changed(p0);
}

void Entity_Line::setP0(const float &px, const float &py, const float &pz)
{
    QVector3D v(px, py, pz);
    setP0(v);
}

void Entity_Line::setP1(const QVector3D &p1)
{
    qDebug()<<"setP1(const QVector3D 
&p1)."<___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Queued signals lost in 5.15.0 (works in 5.12.5) (Windows)

2020-09-26 Thread Alexander Dyagilev

No. Have neither time nor willing to create one...

I don't believe it's not a wide spread case. But even if not - have no 
willing for this for now, sorry...


On 9/26/2020 6:47 PM, Giuseppe D'Angelo wrote:

On 26/09/2020 16:48, Alexander Dyagilev wrote:
I'm not sure what you mean exactly, but I've seen many such 
situations (when connection did not work because metatype was not 
registered) and never saw any warnings anywhere.




I mean that when you do a queued connection or a queued activation and 
some arguments are not registered, you should get a warning from Qt.


The lack of such a warning is a bug. Do you have a testcase?


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


Re: [Interest] Queued signals lost in 5.15.0 (works in 5.12.5) (Windows)

2020-09-26 Thread Alexander Dyagilev

Well, let me not to use it please, i want my app to continue to work lol.

On 9/26/2020 6:43 PM, Thiago Macieira wrote:

On Saturday, 26 September 2020 07:53:23 PDT Alexander Dyagilev wrote:

template 
inline void qRegisterMyMetaType(const char *name)
{
  if (QMetaType::type(name) == QMetaType::UnknownType)
  qRegisterMetaType(name);
}

Better implementation:

template 
inline void qRegisterMyMetaType(const char *name)
{
 Q_UNUSED(name);
 qRegisterMetaType();
}

#define Q_REGISTER_MY_METATYPE Q_DECLARE_METATYPE

This checks that whether the type is already registered without making a
function call.

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


Re: [Interest] QNetworkConfigurationManager::isOnline always returns false on Android 11

2020-09-26 Thread ekke

Am 26.09.20 um 18:46 schrieb Marian Beermann:

An interface like this is inherently racy. QNCM (obsolete) may tell you
you are online, you connect to the server, send your stuff, and while
that happens the device goes offline and you get an error. You probably
handle this case already.


yes - I'm handling this and other kinds of error from server

if getting some specific errors, queue will be paused and user get's a 
message




Stuff like this is "informational" and you can't assume stuff will work,
because the API said you're online. Conversely, your servers might be
reachable even if it says the device is "offline". (What does "internet
connectivity" mean, after all? It's pretty hard to define...)

I second Thiago's suggestion - just keep trying quietly in the
background, don't rely on "device is online" indicators (either in Qt,
or in other frameworks/APIs).
I think it will use more battery always trying to send data to server 
instead of waiting for a signal from the underlying OS


If you only have a "heavy" API endpoint to use, I'd ask the backend
developers to add a lightweight "status" API endpoint you can use to
check if you can reach the server without necessarily doing any hard work.


there's a ping api - so I could try this before sending heavy data

(the size of data to be sent is different - sometimes only some bytes, 
sometimes an image (wound image per ex))


ekke

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


Re: [Interest] QNetworkConfigurationManager::isOnline always returns false on Android 11

2020-09-26 Thread ekke

Am 26.09.20 um 18:15 schrieb Thiago Macieira:

On Saturday, 26 September 2020 08:53:52 PDT ekke wrote:

Am 26.09.20 um 17:39 schrieb Thiago Macieira:

On Friday, 25 September 2020 23:58:26 PDT Alexander Dyagilev wrote:

Hello,

Tested with Qt 5.12.9. Any workarounds?

Suggestion: stop trying to check and assume that you are online.

imagine a mobile app for outpatient services, where a nurse visits
patients and at each patient has to confirm services done and to send
vital values and so on...

while on tour and visiting the patients the device sometimes is online,
sometimes offline

Ok, stipulated.


all service items done are written to a queue. queue watches online
state and always when the device is online items waiting in the queue
are sent to server

Ok.


in the evening when all work is done user can only log out if all work
is sent to server - if not online he/she gets an info "you're not online
- work items cannot be sent" ...

No. You don't need to know if you're online for that. You need to get the
confirmation from the server that the server received the data. That completes
the information loop properly.


assuming that the device is online won't work in such kind of use-cases,
pulling also is no good idea

Yes, it is. Just try to connect. If you're offline, then you can't. If you're
online but there's another network problem, then you can't either.

I don't know what you mean by pulling. Did you mean a push API? I don't see
how that would be relevant.


I meant using a Timer and try again every x minutes to send data to server

in my current apps on iOS I'm using iOS Reachability Classes to wat5ch 
online state,


on Android I'm using QNCM online state changed signal to watch online state

this works very well

If I'm following your suggestion trying to connect - what should I do if 
I cannot connect ?


start a Timer and try again ?

of course it'e easier to watch online state signal




(have some more mobile apps where it's also important always to know the
online state)

You're online. That's what Qt 6 will tell you.


sounds good

ekke

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


Re: [Interest] QNetworkConfigurationManager::isOnline always returns false on Android 11

2020-09-26 Thread Thiago Macieira
On Saturday, 26 September 2020 08:53:52 PDT ekke wrote:
> Am 26.09.20 um 17:39 schrieb Thiago Macieira:
> > On Friday, 25 September 2020 23:58:26 PDT Alexander Dyagilev wrote:
> >> Hello,
> >> 
> >> Tested with Qt 5.12.9. Any workarounds?
> > 
> > Suggestion: stop trying to check and assume that you are online.
> 
> imagine a mobile app for outpatient services, where a nurse visits
> patients and at each patient has to confirm services done and to send
> vital values and so on...
> 
> while on tour and visiting the patients the device sometimes is online,
> sometimes offline

Ok, stipulated.

> all service items done are written to a queue. queue watches online
> state and always when the device is online items waiting in the queue
> are sent to server

Ok.

> in the evening when all work is done user can only log out if all work
> is sent to server - if not online he/she gets an info "you're not online
> - work items cannot be sent" ...

No. You don't need to know if you're online for that. You need to get the 
confirmation from the server that the server received the data. That completes 
the information loop properly.

> assuming that the device is online won't work in such kind of use-cases,
> pulling also is no good idea

Yes, it is. Just try to connect. If you're offline, then you can't. If you're 
online but there's another network problem, then you can't either.

I don't know what you mean by pulling. Did you mean a push API? I don't see 
how that would be relevant.

> (have some more mobile apps where it's also important always to know the
> online state)

You're online. That's what Qt 6 will tell you.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering



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


Re: [Interest] QNetworkConfigurationManager::isOnline always returns false on Android 11

2020-09-26 Thread ekke

Am 26.09.20 um 17:39 schrieb Thiago Macieira:

On Friday, 25 September 2020 23:58:26 PDT Alexander Dyagilev wrote:

Hello,

Tested with Qt 5.12.9. Any workarounds?

Suggestion: stop trying to check and assume that you are online.

imagine a mobile app for outpatient services, where a nurse visits 
patients and at each patient has to confirm services done and to send 
vital values and so on...


while on tour and visiting the patients the device sometimes is online, 
sometimes offline


all service items done are written to a queue. queue watches online 
state and always when the device is online items waiting in the queue 
are sent to server


in the evening when all work is done user can only log out if all work 
is sent to server - if not online he/she gets an info "you're not online 
- work items cannot be sent" ...


assuming that the device is online won't work in such kind of use-cases, 
pulling also is no good idea


(have some more mobile apps where it's also important always to know the 
online state)


ekke

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


Re: [Interest] Queued signals lost in 5.15.0 (works in 5.12.5) (Windows)

2020-09-26 Thread Giuseppe D'Angelo via Interest

On 26/09/2020 16:53, Alexander Dyagilev wrote:

I use this helper macro for this (register a metatype in runtime):

template 
inline void qRegisterMyMetaType(const char *name)
{
     if (QMetaType::type(name) == QMetaType::UnknownType)
     qRegisterMetaType(name);
}

#define Q_REGISTER_MY_METATYPE(type) qRegisterMyMetaType(#type);


Usage example:

Q_REGISTER_MY_METATYPE(QCryptographicHash::Algorithm);



This machinery is not strictly needed -- it's perfectly fine to call 
qRegisterMetatype multiple times (you could for instance put it in 
the constructor of T itself). The point is that you have to call it 
before emitting (in case of a queued activation on an autoconnection) or 
even before connecting (in case you're forcing a queued connection).


Either way, if you forget, Qt should emit a warning telling you exactly 
what to do.


HTH,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts



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


Re: [Interest] Queued signals lost in 5.15.0 (works in 5.12.5) (Windows)

2020-09-26 Thread Giuseppe D'Angelo via Interest

On 26/09/2020 16:48, Alexander Dyagilev wrote:
I'm not sure what you mean exactly, but I've seen many such situations 
(when connection did not work because metatype was not registered) and 
never saw any warnings anywhere.




I mean that when you do a queued connection or a queued activation and 
some arguments are not registered, you should get a warning from Qt.


The lack of such a warning is a bug. Do you have a testcase?

--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts



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


Re: [Interest] Queued signals lost in 5.15.0 (works in 5.12.5) (Windows)

2020-09-26 Thread Thiago Macieira
On Saturday, 26 September 2020 07:53:23 PDT Alexander Dyagilev wrote:
> template 
> inline void qRegisterMyMetaType(const char *name)
> {
>  if (QMetaType::type(name) == QMetaType::UnknownType)
>  qRegisterMetaType(name);
> }

Better implementation:

template 
inline void qRegisterMyMetaType(const char *name)
{
Q_UNUSED(name);
qRegisterMetaType();
}

#define Q_REGISTER_MY_METATYPE Q_DECLARE_METATYPE

This checks that whether the type is already registered without making a 
function call.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering



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


Re: [Interest] QNetworkConfigurationManager::isOnline always returns false on Android 11

2020-09-26 Thread Thiago Macieira
On Friday, 25 September 2020 23:58:26 PDT Alexander Dyagilev wrote:
> Hello,
> 
> Tested with Qt 5.12.9. Any workarounds?

Suggestion: stop trying to check and assume that you are online.

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



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


Re: [Interest] Queued signals lost in 5.15.0 (works in 5.12.5) (Windows)

2020-09-26 Thread Alexander Dyagilev

I use this helper macro for this (register a metatype in runtime):

template 
inline void qRegisterMyMetaType(const char *name)
{
    if (QMetaType::type(name) == QMetaType::UnknownType)
    qRegisterMetaType(name);
}

#define Q_REGISTER_MY_METATYPE(type) qRegisterMyMetaType(#type);


Usage example:

Q_REGISTER_MY_METATYPE(QCryptographicHash::Algorithm);

:)


On 9/26/2020 5:48 PM, Alexander Dyagilev wrote:


I'm not sure what you mean exactly, but I've seen many such situations 
(when connection did not work because metatype was not registered) and 
never saw any warnings anywhere.


On 9/26/2020 12:02 PM, Giuseppe D'Angelo via Interest wrote:

Il 26/09/20 07:55, Alexander Dyagilev ha scritto:
Yeah, it's possible that some metatype (used in signal) is 
registered in

Qt 5.12 and is NOT registered in Qt 5.15, thus connection does not work
between objects in different threads.

It's required to register it manually then.


Do you know of a case where this wouldn't spit the usual "arguments 
are not registered" warning? (If so, that's a bug)


Thanks,

___
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] Queued signals lost in 5.15.0 (works in 5.12.5) (Windows)

2020-09-26 Thread Alexander Dyagilev
I'm not sure what you mean exactly, but I've seen many such situations 
(when connection did not work because metatype was not registered) and 
never saw any warnings anywhere.


On 9/26/2020 12:02 PM, Giuseppe D'Angelo via Interest wrote:

Il 26/09/20 07:55, Alexander Dyagilev ha scritto:

Yeah, it's possible that some metatype (used in signal) is registered in
Qt 5.12 and is NOT registered in Qt 5.15, thus connection does not work
between objects in different threads.

It's required to register it manually then.


Do you know of a case where this wouldn't spit the usual "arguments 
are not registered" warning? (If so, that's a bug)


Thanks,

___
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] Queued signals lost in 5.15.0 (works in 5.12.5) (Windows)

2020-09-26 Thread Volker Hilsheimer
> On 25 Sep 2020, at 21:26, Giuseppe D'Angelo via Interest 
>  wrote:
> 
> Il 24/09/20 17:55, Rainer Wiesenfarth ha scritto:
>> - if I take the application built and running without this issue with Qt 
>> 5.12.5 and replace the DLLs with those from Qt 5.15.0, the issue appears. 
>> That means there is a change in the event handling between 5.12.5 and 5.15.0 
>> that causes the issue to appear.
> 
> It's super hard telling what might be going wrong without a testcase.
> 
> I'd anyway start by using 5.15.1/2 (not 0) and actually recompiling the 
> application, just to exclude subtle binary compatibility breaks.
> 
> You may also want to inspect the event posting and delivery (e.g. by 
> overriding QCA::notify(); and/or by using ETW tracing; and/or by posting and 
> dispatching your custom "metacall" events instead of using a queued 
> invocation in the same thread).
> 
> HTH,
> 
> -- 
> Giuseppe D’Angelo


If none of the previous hints help, can you share more info about the event 
loop of the thread in which the receiving object lives?

There have been changes to the event loop implementation on Windows in Qt 5.15, 
such as

* 81408c0e76616b127c46779dc14bbcf084a3d87b
* e0d80167c18b5a71acf4dac59f3e6f37292fa397

to better the integration with foreign event loops, but you should updating to 
5.15.1 which has e.g

fb6f62354ff8d29152db7cfa479b2689a25ae7a9 which fixes 
https://bugreports.qt.io/browse/QTBUG-85981

to fix one reported regression in such a scenario.

Volker

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


Re: [Interest] Queued signals lost in 5.15.0 (works in 5.12.5) (Windows)

2020-09-26 Thread Giuseppe D'Angelo via Interest

Il 26/09/20 07:55, Alexander Dyagilev ha scritto:

Yeah, it's possible that some metatype (used in signal) is registered in
Qt 5.12 and is NOT registered in Qt 5.15, thus connection does not work
between objects in different threads.

It's required to register it manually then.


Do you know of a case where this wouldn't spit the usual "arguments are 
not registered" warning? (If so, that's a bug)


Thanks,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts



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


Re: [Interest] Android virtual device: forced cold boot from Qt Creator

2020-09-26 Thread Alexander Dyagilev
I.e. what I would like to know is if there is a way to make Qt Creator 
"compatible" with Android Studio so both can use the same saved state of 
the virtual machine without having to boot in cold mode...



On 9/25/2020 9:17 PM, Alexander Dyagilev wrote:


The same thing happens when I start from Android Studio after Qt 
Creator...


On 9/25/2020 8:26 PM, Alexander Dyagilev wrote:


Hello,

I use both Android Studio and Qt Creator. In Android Studio virtual 
device starts with saved state (it's fast).


But when I start it from Qt Creator, it always starts with cold boot.

Why? Can anything be done to fix this?

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


[Interest] QNetworkConfigurationManager::isOnline always returns false on Android 11

2020-09-26 Thread Alexander Dyagilev

Hello,

Tested with Qt 5.12.9. Any workarounds?

I've created the bug report here: 
https://bugreports.qt.io/browse/QTBUG-86981


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