Re: [Interest] QSqlQuery bind value

2021-03-16 Thread Elvis Stansvik
Yea, you can always use db.driver()->escapeIdentifier(x,
QSqlDriver::TableName) if you want to sleep a little better anyway.

Elvis


Den tis 16 mars 2021 kl 21:52 skrev Jérôme Godbout :
>
> Thanks, that was the problems, this is annoying, but I do create the query 
> prepare with a String with arg (I known this is bad, but the tablename is 
> provided by inner code only, this is not user inputs of any sort).
>
> On Mar 16, 2021, at 4:23 PM, Elvis Stansvik  wrote:
>
> Den tis 16 mars 2021 kl 21:21 skrev Elvis Stansvik :
>
>
> Den tis 16 mars 2021 kl 20:19 skrev Jérôme Godbout :
>
>
> Hi,
>
> I’m trying to use the Sql with Sqlite with Qt. The database seem to be 
> working just fine, but I run into troubles with the bind value. The named 
> bind doesn’t seem to work (Qt 5.15.2, Mac OS):
>
> m_sql->m_create_table(m_database);
>
> m_sql->m_create_table.prepare(R"raw(CREATE TABLE IF NOT EXISTS :table name 
> (idkey TEXT PRIMARY KEY, data TEXT) WITHOUT ROWID)raw”);
>
>
> You can't use a bound parameter value for the table name. This would
> be the case even if you used the SQLite C library. I imagine this is
> the case in other database engines as well.
>
>
> Some good answers here:
> https://stackoverflow.com/questions/11312737/can-i-parameterize-the-table-name-in-a-prepared-statement
>
> Elvis
>
>
> Elvis
>
>
>
> Note: I did try to add the ending ; it make no difference. Is it required? I 
> do not see it in any example.
>
>
> The prepare return false for some reason, I did try with quotes this solve 
> the prepare but I thing the escaping should be done automatically?! Is the 
> value escape character automatically for named and positional args? What is 
> wrong with this query, the query work just fine into sqlite3.
>
> CREATE TABLE IF NOT EXISTS ':tablename’ (idkey TEXT PRIMARY KEY, data TEXT) 
> WITHOUT ROWID;
>
>
> It doesn’t complain, but create a table name :table name instead! The replace 
> doesn’t occur into the quote ‘ '
>
> This query work just fine into sqlite command line.
>
> CREATE TABLE IF NOT EXISTS toto (idkey TEXT PRIMARY KEY, data TEXT) WITHOUT 
> ROWID;
>
>
> What is wrong with this?! This seem to be just like the examples, is SQLite 
> any special in that regards (I known only a single statement is required for 
> sqlite).
>
> Thanks,
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
>
> Jerome Godbout
> Software/Firmare Lead Amotus
>
> C: (581) 777-0050
> O: (418) 800-1073 ext.: 114
> godbo...@amotus.ca
>
>
>
> dimonoff.com   |amotus.ca
>
> We have moved!
> 1015 Avenue Wilfrid-Pelletier, Québec, QC G1W 0C4, 4e étage
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QSqlQuery bind value

2021-03-16 Thread Jérôme Godbout
Thanks, that was the problems, this is annoying, but I do create the query 
prepare with a String with arg (I known this is bad, but the tablename is 
provided by inner code only, this is not user inputs of any sort).

On Mar 16, 2021, at 4:23 PM, Elvis Stansvik 
mailto:elvst...@gmail.com>> wrote:

Den tis 16 mars 2021 kl 21:21 skrev Elvis Stansvik 
mailto:elvst...@gmail.com>>:

Den tis 16 mars 2021 kl 20:19 skrev Jérôme Godbout 
mailto:godbo...@amotus.ca>>:

Hi,

I’m trying to use the Sql with Sqlite with Qt. The database seem to be working 
just fine, but I run into troubles with the bind value. The named bind doesn’t 
seem to work (Qt 5.15.2, Mac OS):

m_sql->m_create_table(m_database);

m_sql->m_create_table.prepare(R"raw(CREATE TABLE IF NOT EXISTS :table name 
(idkey TEXT PRIMARY KEY, data TEXT) WITHOUT ROWID)raw”);

You can't use a bound parameter value for the table name. This would
be the case even if you used the SQLite C library. I imagine this is
the case in other database engines as well.

Some good answers here:
https://stackoverflow.com/questions/11312737/can-i-parameterize-the-table-name-in-a-prepared-statement

Elvis


Elvis



Note: I did try to add the ending ; it make no difference. Is it required? I do 
not see it in any example.


The prepare return false for some reason, I did try with quotes this solve the 
prepare but I thing the escaping should be done automatically?! Is the value 
escape character automatically for named and positional args? What is wrong 
with this query, the query work just fine into sqlite3.

CREATE TABLE IF NOT EXISTS ':tablename’ (idkey TEXT PRIMARY KEY, data TEXT) 
WITHOUT ROWID;


It doesn’t complain, but create a table name :table name instead! The replace 
doesn’t occur into the quote ‘ '

This query work just fine into sqlite command line.

CREATE TABLE IF NOT EXISTS toto (idkey TEXT PRIMARY KEY, data TEXT) WITHOUT 
ROWID;


What is wrong with this?! This seem to be just like the examples, is SQLite any 
special in that regards (I known only a single statement is required for 
sqlite).

Thanks,

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

Jerome Godbout
Software/Firmare Lead Amotus

C: (581) 777-0050
O: (418) 800-1073 ext.: 114
godbo...@amotus.ca

[cid:image007.png@01D70B66.39FB01C0]

dimonoff.com   |amotus.ca

We have moved!
1015 Avenue Wilfrid-Pelletier, Québec, QC G1W 0C4, 4e étage

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


Re: [Interest] QSqlQuery bind value

2021-03-16 Thread Elvis Stansvik
Den tis 16 mars 2021 kl 21:21 skrev Elvis Stansvik :
>
> Den tis 16 mars 2021 kl 20:19 skrev Jérôme Godbout :
> >
> > Hi,
> >
> > I’m trying to use the Sql with Sqlite with Qt. The database seem to be 
> > working just fine, but I run into troubles with the bind value. The named 
> > bind doesn’t seem to work (Qt 5.15.2, Mac OS):
> >
> > m_sql->m_create_table(m_database);
> >
> > m_sql->m_create_table.prepare(R"raw(CREATE TABLE IF NOT EXISTS :table name 
> > (idkey TEXT PRIMARY KEY, data TEXT) WITHOUT ROWID)raw”);
>
> You can't use a bound parameter value for the table name. This would
> be the case even if you used the SQLite C library. I imagine this is
> the case in other database engines as well.

Some good answers here:
https://stackoverflow.com/questions/11312737/can-i-parameterize-the-table-name-in-a-prepared-statement

Elvis

>
> Elvis
>
> >
> >
> > Note: I did try to add the ending ; it make no difference. Is it required? 
> > I do not see it in any example.
> >
> >
> > The prepare return false for some reason, I did try with quotes this solve 
> > the prepare but I thing the escaping should be done automatically?! Is the 
> > value escape character automatically for named and positional args? What is 
> > wrong with this query, the query work just fine into sqlite3.
> >
> > CREATE TABLE IF NOT EXISTS ':tablename’ (idkey TEXT PRIMARY KEY, data TEXT) 
> > WITHOUT ROWID;
> >
> >
> > It doesn’t complain, but create a table name :table name instead! The 
> > replace doesn’t occur into the quote ‘ '
> >
> > This query work just fine into sqlite command line.
> >
> > CREATE TABLE IF NOT EXISTS toto (idkey TEXT PRIMARY KEY, data TEXT) WITHOUT 
> > ROWID;
> >
> >
> > What is wrong with this?! This seem to be just like the examples, is SQLite 
> > any special in that regards (I known only a single statement is required 
> > for sqlite).
> >
> > 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] QSqlQuery bind value

2021-03-16 Thread Elvis Stansvik
Den tis 16 mars 2021 kl 20:19 skrev Jérôme Godbout :
>
> Hi,
>
> I’m trying to use the Sql with Sqlite with Qt. The database seem to be 
> working just fine, but I run into troubles with the bind value. The named 
> bind doesn’t seem to work (Qt 5.15.2, Mac OS):
>
> m_sql->m_create_table(m_database);
>
> m_sql->m_create_table.prepare(R"raw(CREATE TABLE IF NOT EXISTS :table name 
> (idkey TEXT PRIMARY KEY, data TEXT) WITHOUT ROWID)raw”);

You can't use a bound parameter value for the table name. This would
be the case even if you used the SQLite C library. I imagine this is
the case in other database engines as well.

Elvis

>
>
> Note: I did try to add the ending ; it make no difference. Is it required? I 
> do not see it in any example.
>
>
> The prepare return false for some reason, I did try with quotes this solve 
> the prepare but I thing the escaping should be done automatically?! Is the 
> value escape character automatically for named and positional args? What is 
> wrong with this query, the query work just fine into sqlite3.
>
> CREATE TABLE IF NOT EXISTS ':tablename’ (idkey TEXT PRIMARY KEY, data TEXT) 
> WITHOUT ROWID;
>
>
> It doesn’t complain, but create a table name :table name instead! The replace 
> doesn’t occur into the quote ‘ '
>
> This query work just fine into sqlite command line.
>
> CREATE TABLE IF NOT EXISTS toto (idkey TEXT PRIMARY KEY, data TEXT) WITHOUT 
> ROWID;
>
>
> What is wrong with this?! This seem to be just like the examples, is SQLite 
> any special in that regards (I known only a single statement is required for 
> sqlite).
>
> 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


[Interest] QSqlQuery bind value

2021-03-16 Thread Jérôme Godbout
Hi,

I’m trying to use the Sql with Sqlite with Qt. The database seem to be working 
just fine, but I run into troubles with the bind value. The named bind doesn’t 
seem to work (Qt 5.15.2, Mac OS):


m_sql->m_create_table(m_database);

m_sql->m_create_table.prepare(R"raw(CREATE TABLE IF NOT EXISTS :table name 
(idkey TEXT PRIMARY KEY, data TEXT) WITHOUT ROWID)raw”);


Note: I did try to add the ending ; it make no difference. Is it required? I do 
not see it in any example.

The prepare return false for some reason, I did try with quotes this solve the 
prepare but I thing the escaping should be done automatically?! Is the value 
escape character automatically for named and positional args? What is wrong 
with this query, the query work just fine into sqlite3.

CREATE TABLE IF NOT EXISTS ':tablename’ (idkey TEXT PRIMARY KEY, data TEXT) 
WITHOUT ROWID;


It doesn’t complain, but create a table name :table name instead! The replace 
doesn’t occur into the quote ‘ '


This query work just fine into sqlite command line.

CREATE TABLE IF NOT EXISTS toto (idkey TEXT PRIMARY KEY, data TEXT) WITHOUT 
ROWID;


What is wrong with this?! This seem to be just like the examples, is SQLite any 
special in that regards (I known only a single statement is required for 
sqlite).

Thanks,

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


Re: [Interest] Mixing Commercial and Open Source license for different projects

2021-03-16 Thread Tuukka Turunen
Hi James,

You asked if it is allowed for a developer who has purchased commercial license 
of Qt for project A to work on project B using open-source license of Qt. 
Assuming that these projects are separate (independent and not related to each 
other in any way), this is possible. The reason for limitation of mixing 
open-source and commercial versions is indented to prevent some person(s) who 
do not have a commercial license to use open-source version of Qt for work 
benefitting the commercially licensed software. This is not the case in the 
situation you described as long as these projects really are separate (not just 
paid by different companies).

Yours,

Tuukka

From: Interest  on behalf of James Maxwell 

Date: Sunday, 14. March 2021 at 16.32
To: interest@qt-project.org 
Subject: [Interest] Mixing Commercial and Open Source license for different 
projects
Hi,

I am confused by the requirement of not mixing licenses, see the discussion in 
this thread:
https://lists.qt-project.org/pipermail/interest/2020-March/034737.html

The situation is as follows: I am an independent software developer. If my 
customer A wants to use a commercial license and my customer B wants to use the 
GPL orLGPL license, can I still develop software for both?
For A I need a commercial license. Am I then still allowed to use QtCreator 
under my commercial license to develop a LGPL project for customer B?

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


Re: [Interest] Mixing Commercial and Open Source license for different projects

2021-03-16 Thread James Maxwell
Yes, such a setup would be is possible for me.

Am Di., 16. März 2021 um 17:02 Uhr schrieb Giuseppe D'Angelo <
giuseppe.dang...@kdab.com>:

> Il 15/03/21 16:16, James Maxwell ha scritto:
> > Is there even a difference between the GPL creator and commercial
> > creator? I feared that once I have a license, whenever I use any
> > QtCreator it is commercially licensed.
> >
> > But using QtCreator is not actually my main concern. If I have a
> > commercial Qt license, can I still develop for projects which are going
> > to be released under LGPL where also other people don't have a Qt
> > license (of course assuming we only use LGPL Qt and nothing of the
> > commercial only parts).
>
> No matter what the eventual differences between commercial Creator /
> open source Creator are (if any); but would it be a problem for you to
> use commercial Qt / Qt Creator for the commercial customer, and open
> source Qt / Qt Creator for the open source code?
>
> (Not dealing with the practical aspects of having multiple Qt
> installations and what not. Again, I'm just asking if such a setup is
> not possible for some specific reasons.)
>
> Thank you,
>
> --
> 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
>
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Mixing Commercial and Open Source license for different projects

2021-03-16 Thread Florian Bruhin
Hey,

On Mon, Mar 15, 2021 at 04:16:53PM +0100, James Maxwell wrote:
> If I have a commercial Qt license, can I still develop for projects
> which are going to be released under LGPL where also other people
> don't have a Qt license (of course assuming we only use LGPL Qt and
> nothing of the commercial only parts).
> 
> I am afraid of the following: "(ii) use Licensed Software for creation of
> any software created with or incorporating Open Source Qt"
> what does licensed software mean? If I have Qt commercial, do I always use
> Qt under commercial license and thus cannot create any software using open
> source qt?

The license text has a definition of "Licensed Software". Most notably,
"Licensed Software does not include [...] Open Source Qt.".

FWIW the licensing FAQ[1] says:

Mixing Qt commercial licenses with Qt open-source licenses *in one
project/product* is not permitted.

(emphasis mine), and in the earlier discussion here[2], Tuukka Turunen
said:

For completely independent projects/products this is fine. Note that
these really should not be same or in practice the same - or in any
way depending, relating, using etc each other as defined in the
license agreement. 

That all being said, I'm not a lawyer, and I'm not associated with
The Qt Company in any way.

Florian

[1] 
https://www.qt.io/faq/2.7.-can-some-developers-in-our-team-working-on-the-same-project-use-open-source-version-of-qt-and-some-developers-use-commercial-version-of-qt
[2] https://lists.qt-project.org/pipermail/interest/2020-March/034786.html

-- 
m...@the-compiler.org | https://www.qutebrowser.org 
   https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
   GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
 I love long mails! | https://email.is-not-s.ms/


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


Re: [Interest] Mixing Commercial and Open Source license for different projects

2021-03-16 Thread Giuseppe D'Angelo via Interest

Il 15/03/21 16:16, James Maxwell ha scritto:
Is there even a difference between the GPL creator and commercial 
creator? I feared that once I have a license, whenever I use any 
QtCreator it is commercially licensed.


But using QtCreator is not actually my main concern. If I have a 
commercial Qt license, can I still develop for projects which are going 
to be released under LGPL where also other people don't have a Qt 
license (of course assuming we only use LGPL Qt and nothing of the 
commercial only parts).


No matter what the eventual differences between commercial Creator / 
open source Creator are (if any); but would it be a problem for you to 
use commercial Qt / Qt Creator for the commercial customer, and open 
source Qt / Qt Creator for the open source code?


(Not dealing with the practical aspects of having multiple Qt 
installations and what not. Again, I'm just asking if such a setup is 
not possible for some specific reasons.)


Thank you,

--
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] [Qt3d] Rendering 3D object with 2D coordinates

2021-03-16 Thread Alex john
I did the following changes to the wireframe example (Trefoilknot.qml file
translation property of transform) but still unable to get the modelView
Matrix,  and also not sure whether the following changes to translation are
right If anyone can confirm and let me know

property var mainCam   // got the mainCamera ID from main.qml (wireframe
example)
property var forwardRenderer //forwardRendered id from main.qml (wireframe
example)

 Transform {
id: trefoilMeshTransform
*translation:Qt.vector3d(Qt.vector2D(4, 4)).unproject( *modelView*
,mainCam.projectionMatrix, forwardRenderer.viewportRect)*
property real theta: 0.0
property real phi: 0.0
property real roll: 0.0
rotation: fromEulerAngles(theta, phi, roll)
scale: root.scale
}
/*
 *translation* : Qt.vector2D(100, 100) is where I intend to give window 2d
coordinates(here its x:100, y:100)and I assume that unproject api will
convert the 2d points to 3d and renders the 3d object exactly at 100, 100
pixel 2d location
*/

I got the projectionMatrix from camera, viewPortRect from ForwardRenderer
in Rendering settings. I'm completely stuck for this step. If anyone can
please confirm the changes and let me know the modelView matrix.


On Mon, Mar 15, 2021 at 5:14 PM Alex john  wrote:

> > Going the other way round (back-projection) can be done by e.g.
> QVector3D::unproject()
>
> Thanks, as I'm referring the the wireframe example I was able to get
> the camera projection matrix from Camera Qml.  However, I'm unsure how
> to get the ModelView matrix and the viewport.
>
> As I have loaded my custom obj in wireframe example and using the same
> geometry and camera settings as its for wireframe, therefore can you
> please let me know how this can be done at QML side? I did try to find
> this in the documentation but didn't find the usage.
>
>
>
>
> > On Mon, Mar 15, 2021 at 11:03 AM Alex john 
> wrote:
> >>
> >> Hello ,
> >>
> >> Im successessfully able to load the obj file in Scene3D, and by using
> >> fromEulerAngles I'm able to get the required yaw, pitch and
> >> roll.However, I'm not able to use the right translation to get the
> >> object rendered. I get the x,y coordinates in pixels from the other
> >> module and I need to render the 3d model exactly at that pixel
> >> location. It turns out that the Transform type has translation and it
> >> takes the input in 3d coordinates (not sure which unit) if I try to
> >> assign the x,y coordinates to the 3d coordinates it renders somewhere
> >> else. Seems like the x,y in the translation is not the pixel 2d
> >> values, as even with a x=0.3 it deflects more than expected.
> >>
> >> Is there a way to assign the x,y 2d pixel values (as we do for
> >> Rectangle {x: 100, y:100}) to the translation so that it is rendered
> >> to the right place where it's desired.
> >> ___
> >> 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] Qt nosql embedded file db

2021-03-16 Thread Jérôme Godbout
Hi,

Is anybody aware of some nosql file db that play well with Qt on Windows / 
MacOS / iOS / Android / Linux that doesn’t cost an arm and a leg. I have seen 
the following so far:

  *   Unqlite open source until you want to encrypt the database with cost 
10K$US
  *   EJDB2 seem to require to change some naming, since some name clash into C 
files.

There is many that goes native, but not so much that I can see expose C or C++ 
API directly. I would like to have BSON or JSON data support but this is not 
mandatory. If anybody have a success story or any info, that would be great.

Jerome Godbout
Software/Firmare Lead Amotus

C: (581) 777-0050
O: (418) 800-1073 ext.: 114
godbo...@amotus.ca
[cid:image007.png@01D70B66.39FB01C0]

dimonoff.com   |amotus.ca

We have moved!
1015 Avenue Wilfrid-Pelletier, Québec, QC G1W 0C4, 4e étage

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


Re: [Interest] Mixing Commercial and Open Source license for, different projects

2021-03-16 Thread Roland Hughes

That would be the FUD

On 3/16/21 6:00 AM, James Maxwell wrote:

I am afraid of the following: "(ii) use Licensed Software for creation of
any software created with or incorporating Open Source Qt"
what does licensed software mean? If I have Qt commercial, do I always use
Qt under commercial license and thus cannot create any software using open
source qt?


Been hashed out on here many times. __Never__ fully resolved.

At one point the licensing was worded in such a way that if you were 
using Qt commercial you could not use Wireshark, Doxygen, or any of the 
OpenSource projects built with Qt. Visit the archive page: 
https://lists.qt-project.org/pipermail/interest/ pull down the zipped 
files for the past 18 months or so and unzip them into a directory tree. 
Use Sublime Text 3, Emacs, or just plain grep to search for wireshark, 
doxygen, and commercial in different searches. That should identify all 
of the message threads.


There was no real resolution.

At one point the wording was so broad and vague that if anyone anywhere 
at Intel had a commercial license, Thiago couldn't work on OpenSource 
Qt. You will find that discussion in the archive as well.


Many of the companies I'm in contact with have either begun or completed 
the abandonment of Qt.


For now my policy has been:

If a client wants me to use commercial Qt, it is their license on their 
machine. Period.


The half dozen machines in my office have only the OpenSource stuff.

If you feel compelled to straddle the fence, then go onto eBay (or where 
ever) and get yourself a ~$300 off-lease computer for your OpenSource 
development and a KVM switch so you can use your same monitors and 
toggle between two machines.


Right now that is the only way I have found to be "sure."

Study up on the alternatives because an industry wide migration appears 
to be happening. One of the best known manufacturers of high end 
video/audio products for concert halls, movie making, theaters, all the 
way down to conference rooms and your own home theater dumped Qt during 
the pandemic. As entrenched as Qt was there I didn't think it was 
physically possible. They did it in under a year. That was the solution 
they were forced into.


FUD + death-of-perpetual-license = mass-company-exit

--
Roland Hughes, President
Logikal Solutions
(630)-205-1593

http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com
http://www.logikalblog.com
http://www.interestingauthors.com/blog

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