Re: [Interest] Two different layouts?

2019-08-16 Thread john
Thank you! That might be what I want. I'll check it out on Monday.

> On Aug 16, 2019, at 3:24 PM, Israel Brewster  wrote:
> 
> On Aug 14, 2019, at 1:06 PM, John Weeks  wrote:
>> 
>> I have a moderately complex window (more than 50 QWidget- and 
>> QLayout-derived components). I have decided that it would be nice to have 
>> two versions: a vertical layout and a horizontal layout. But it's not just a 
>> matter of QVBoxLayout vs QHBoxLayout.
>> 
>> I have developed a new .ui file with the vertical layout and the appropriate 
>> rearrangement of the widgets. All the widgets are the same, with the same 
>> names. The QLayout-derived items are different, but my code doesn't need to 
>> access them.
>> 
>> It would be great if I could instantiate one or the other of these layouts 
>> at run-time and get back a pointer (or something?) that I could use instead 
>> of the usual ui-> pointer. The members that I need to reference all have the 
>> same names in the two .ui files. Seems like there should be a C++ template 
>> way to do this, but I'm not as clever with that kind of stuff as I might be.
>> 
>> Has anyone developed a solution to this? Or do I need to make a wrapper 
>> class that has an accessor function for each of the widgets? That would be a 
>> pain to implement, and a source of bugs in the future when I change the 
>> layouts.
>> 
>> Any ideas greatly appreciated.
>> 
>> -John Weeks
>> 
> 
> It sounds like you may be looking for the QUiLoader Class 
> (https://doc.qt.io/qt-5/quiloader.html)? Create an empty QMainWindow (in 
> code), then at runtime in the constructor of said window load the proper UI 
> file using the QUILoader (what it loads is your ui-> pointer), and use the 
> setCentralWidget() method of the window to set the widgets from the UI file 
> into the window. I think that’s how it goes :-)
> 
> ---
> Israel Brewster
> Software Engineer
> Alaska Volcano Observatory 
> Geophysical Institute - UAF 
> 2156 Koyukuk Drive 
> Fairbanks AK 99775-7320
> Work: 907-474-5172
> cell:  907-328-9145
> 
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> https://lists.qt-project.org/listinfo/interest
> 

-John

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


Re: [Interest] Two different layouts?

2019-08-16 Thread Israel Brewster
On Aug 14, 2019, at 1:06 PM, John Weeks  wrote:
> 
> I have a moderately complex window (more than 50 QWidget- and QLayout-derived 
> components). I have decided that it would be nice to have two versions: a 
> vertical layout and a horizontal layout. But it's not just a matter of 
> QVBoxLayout vs QHBoxLayout.
> 
> I have developed a new .ui file with the vertical layout and the appropriate 
> rearrangement of the widgets. All the widgets are the same, with the same 
> names. The QLayout-derived items are different, but my code doesn't need to 
> access them.
> 
> It would be great if I could instantiate one or the other of these layouts at 
> run-time and get back a pointer (or something?) that I could use instead of 
> the usual ui-> pointer. The members that I need to reference all have the 
> same names in the two .ui files. Seems like there should be a C++ template 
> way to do this, but I'm not as clever with that kind of stuff as I might be.
> 
> Has anyone developed a solution to this? Or do I need to make a wrapper class 
> that has an accessor function for each of the widgets? That would be a pain 
> to implement, and a source of bugs in the future when I change the layouts.
> 
> Any ideas greatly appreciated.
> 
> -John Weeks
> 

It sounds like you may be looking for the QUiLoader Class 
(https://doc.qt.io/qt-5/quiloader.html 
)? Create an empty QMainWindow (in 
code), then at runtime in the constructor of said window load the proper UI 
file using the QUILoader (what it loads is your ui-> pointer), and use the 
setCentralWidget() method of the window to set the widgets from the UI file 
into the window. I think that’s how it goes :-)

---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
Work: 907-474-5172
cell:  907-328-9145

> ___
> 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] Interest Digest, Vol 95, Issue 19

2019-08-16 Thread Roland Hughes


On 8/14/19 11:15 PM, John Weeks  wrote:

I have a moderately complex window (more than 50 QWidget- and QLayout-derived 
components). I have decided that it would be nice to have two versions: a 
vertical layout and a horizontal layout. But it's not just a matter of 
QVBoxLayout vs QHBoxLayout.

I have developed a new .ui file with the vertical layout and the appropriate 
rearrangement of the widgets. All the widgets are the same, with the same 
names. The QLayout-derived items are different, but my code doesn't need to 
access them.

It would be great if I could instantiate one or the other of these layouts at 
run-time and get back a pointer (or something?) that I could use instead of the 
usual ui-> pointer. The members that I need to reference all have the same 
names in the two .ui files. Seems like there should be a C++ template way to do 
this, but I'm not as clever with that kind of stuff as I might be.

Has anyone developed a solution to this? Or do I need to make a wrapper class 
that has an accessor function for each of the widgets? That would be a pain to 
implement, and a source of bugs in the future when I change the layouts.

Any ideas greatly appreciated.


Had to do that under 4.8 years ago for a medical device touch screen. We 
had everything configured in "bricks" for vitals readings and based on 
the current patient "profile" not only did the arrangement of the bricks 
change but their sizes.


I'm kind of busy this weekend. Drop me a note off-list if you really 
need me to look it up. I may have some of the stuff laying around. 
Here's the thumbnail sketch.


You aren't granular enough.

Our bricks were really complex. They had a lot of stuff going on in them 
despite their tiny size. By and large they were autonomous. They were in 
one big widget contained in a stacked widget. When the big widget became 
visible it looked at the current patient profile and last manual 
arrangement (yes, the user could manually re-arrange via dragging) then 
re-displayed the widgets in the correct order and size. (A user could 
have been on a configuration or patient screen which caused the current 
patient profile to change.)


In short, you don't have enough functionality in your objects if you are 
trying to use ui-> directly in a main window.


IF you are really insisting on your current architecture then create one 
big widget which contains a stacked widget and create an instance of one 
UI in one frame and the other in another frame and an access function in 
the big widget class.


I don't know if any of your widgets are connecting to 
devices/database/whatever and I don't know if they do anything 
global-ish so I don't know if having two different instances will cause 
you a problem.


The shortest of short answers is to make each widget its own UI file and 
delete the UI files you currently have. Create each of the UI instances 
once and have the main window decide where to place them when it becomes 
visible.


--
Roland Hughes, President
Logikal Solutions
(630)-205-1593  (cell)
http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com

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


Re: [Interest] Qt free software policy

2019-08-16 Thread Roland Hughes

+5

At the time I was working on the IP Ghoster project (don't remember 
year) I inquired. They wanted $5K +- _and_ royalties. There was no 
license which would allow a lone developer to deliver a project to a 
client. You had to use the client's license and the client had to pay 
royalties and having to use client provided resources gets many people 
in trouble with the I and the R and the S.



https://www.regent.edu/admin/busoff/pdf/20-questions1099test.pdf

Scroll down to number 14.


On 8/14/19 11:15 PM, David M. Cotter wrote:
i’m in a similar boat. i’m sure there are others who are NOT on this 
list who are also in the same boat.

On Aug 14, 2019, at 1:22 PM, John Weeks  wrote:

We are a small company selling a very large and complex application which is 
now based on Qt open source. At the time we first considered porting to Qt 
(version 4.3?) the license was very expensive for small company (six 
programmers) and the evaluation period simply wasn't adequate to deciding if it 
was the right way to go. So we went open-source when it became available when 
Nokia took over.

Since then, we have wished that we had a commercial license in order to get a 
bit more traction on some bugs. The Qt Company wanted us to pay for all the  
licensing that had accrued since we started using the LGPL version. That 
up-front cost is prohibitive, so we haven't done it.

Perhaps, if you are trying to nudge folks toward commercial licensing, you 
could provide a path that isn't so expensive. Or maybe you have? We haven't 
bothered to look into it lately.

-John


--
Roland Hughes, President
Logikal Solutions
(630)-205-1593  (cell)
http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com

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


Re: [Interest] Qt free software policy

2019-08-16 Thread Roland Hughes


On 8/14/19 11:15 PM, Thiago Macieira wrote:

On Wednesday, 14 August 2019 12:09:02 PDT Roland Hughes wrote:

If you do not need the latest bells and whistles, drop back to Qt 4.8

No, don't. That is not receiving security fixes.


That's exactly what is happening in many places and it should be done. A 
number of shops have their own forks of 4.8, some have shared forks.


"not receiving security fixes" is a bit of FUD. I'm not challenging you 
or calling you a liar, it just is a bit of FUD. For many (possibly most) 
embedded systems, at least in the FDA regulated world, it does not apply.


To start with, there is no version of OpenSSL which is secure. Whoever 
is using Qt just because it makes using SSL easy(ier) shouldn't be using 
Qt anyway because they are releasing an insecure app they incorrectly 
feel is secure.


Most medical devices I've been exposed to don't even allow "the 
application" to perform any communication. Yes, a patient monitor can 
transmit but the application doesn't do it. A "Comm Module" which is not 
field flashable and is written with some other tool set, usually running 
an RTOS contains all of the communications and security. It can only 
communicate with the host which has been "burned" into it if and only if 
that host has the proper set of keys. You cannot take a vitals monitor 
from Hospital A and have it "just work" at Hospital B because it has the 
wrong "Comm Module."


A proprietary (and severely limited) API exists between the application 
and the "Comm Module." The outside world generally cannot pull data from 
the device, only announce that it is available and ready to receive. 
When "the application" sends data to the "Comm Module" it munges it up 
per the API and the "Comm Module" handles the multiple levels of 
security between itself and the paired host module.


This optical isolation is done for many reasons, not the least of which 
is that the "Comm Module" gets re-used on many different devices. When 
you want to change something in the communication (add a 7 level book 
code, 4 more encryption routines, whatever) it is an incredibly simpler 
FDA approval process. You just have to prove you didn't change the 
application API and that the "Comm Module" still communicates with the 
"Host Module."


As far as the divide by zero error mentioned later in the thread, all of 
the repeatable testing for a device will shake out if that is even in 
any execution path. Depending on where it is, those classes may not even 
be part of the application.


Pretty much everyone should be falling back to Qt 4.8 and staying there 
until this ex-wife alimony licensing mentality gives Qt yet another new 
owner. 99.999% of all companies refuse to pay royalties. No, 
negotiating an up-front buy out for a license isn't paying royalties. 
That's what my last customer did, but it was touch and go. They were 
ready to kick Qt to the curb despite all of the proof of concept work 
done with it.


In my new book with the working title "The Phallus of AGILE and Other 
Ruminations" I have an essay titled "Royalties - Every Stupid Idea Comes 
Around Again." It's pretty good. One of the case studies used is that of 
RTLINK vs. Blinker. RTLINK was massively expensive. It had a lot of 
library functions which could make things great, but it would only 
overlay at the OBJ level. Blinker did wonderful things, was less 
expensive and would overlay at the memory page level. RLINK decided it 
wasn't making enough from its massively expensive (2-3 times the price 
of Blinker) so it went to a royalty model. RTLINK basically went under, 
got consumed by CA and rolled into Clipper before disappearing from the 
marketplace. Blinker is still being sold and used in the embedded DOS 
world today. There is even a cottage/niche desktop DOS industry.


Before anybody poo-hoos embedded DOS let me inform them that AGCO uses 
embedded DOS in pretty much all its Combines. Possibly all of their ag 
equipment, I only know about the combines designed in Kansas. They have 
a $5+ Billion market cap.


https://finance.yahoo.com/quote/AGCO/

While we are on the royalty topic I'm fielding an increasing number of 
contacts from companies looking for Qt consultants willing to port 
projects OFF Qt because of the licensing.


There is a 6 month gig in St. Paul, MN for a system running on RHEL 
where they are looking to dump Qt, ostensibly over the licensing. 
Swanktek is shopping the gig around for those interested. I'm not. I 
just got back from a winter project in Minnesota.



--
Roland Hughes, President
Logikal Solutions
(630)-205-1593  (cell)
http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com

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


Re: [Interest] Add row to model *with data*?

2019-08-16 Thread Matthew Woehlke
On 16/08/2019 09.27, Jérôme Godbout wrote:
> Maybe you can add a type to your model and make a map of type to 
> Component, when initalizing the view element, use a Loader that will 
> create the proper Item view based on your type. Not sure this is
> what you are looking for.

I honestly didn't follow any of that.

Right now, my work-around is to make all of my models subclass some
intermediate interface type (which itself subclasses QAbstractItemModel)
that provides an 'addRowWithData' method. This version doesn't take an
index; instead it *returns* the index where insertion happened. (Anyway,
the design of my models is that they present data in an arbitrary order,
with the expectation that a QSortFilterProxyModel will be used to
present them.)

> As for sorting, if you use a QVariantList, you can call javascript 
> sort() on the array if you have a small list or you could make your
> own method in C++ that will sort the element.

I don't see how this relates?

My model isn't using QVariantList. The actual model data is backed by a
custom container type that has specific ordering requirements. As a
result, users of the model cannot control the order in which rows are
inserted. Instead, they must ask to insert a row *with data*, and the
underlying container will determine *where* that rowdata *must* be inserted.

I don't need sorting. I need for users to be able to ask to insert a row
without specifying  *where* to insert the row.

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


Re: [Interest] Add row to model *with data*?

2019-08-16 Thread Jérôme Godbout
Maybe you can add a type to your model and make a map of type to Component, 
when initalizing the view element, use a Loader that will create the proper 
Item view based on your type. Not sure this is what you are looking for.

As for sorting, if you use a QVariantList, you can call javascript sort() on 
the array if you have a small list or you could make your own method in C++ 
that will sort the element. Note, if you use the QQmlListProperty binding on 
content might not be notified of changed for the method to be revaluate 
properly (since the list doesn't emit changed when content changes).

-Original Message-
From: Interest  On Behalf Of Matthew Woehlke
Sent: August 15, 2019 5:42 PM
To: qt qt 
Subject: [Interest] Add row to model *with data*?

So... I have a (subclass of) QAbstractItemModel. This class internally 
represents data using some other container, which has specific requirements on 
both the item, and on the order of items. Thus, I can't just add rows anywhere 
and with no data, to be filled in later.

My users are intended to work with *just* the QAbstractItemModel API. (I 
eventually expect to have multiple model implementations.)

Is there any way, with the existing QAbstractItemModel API, to specify the data 
that the row should contain in the same call that adds the row?
Even better, is there any way to ask the model to add a row, with data, but 
*not* specify where the row is to be added? (The model would then return the 
new row index, or -1 if it could not complete the operation as requested.)

If not, is this something that would make sense to add?

--
Matthew
___
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] GStreamer installation is missing a plug-in

2019-08-16 Thread Bhupendra Singh
Dear All

I am trying to make a Qt application QML-GUI that will show live streaming
of ip-camera. but when in run qt-application on my Embedded Device then I
got 

Some problem .   

 

shared memfd open() failed: Function not implemented

Warning: "No decoder available for type 'application/x-rtp,
media=(string)video, payload=(int)35, clock-rate=(int)9,
encoding-name=(string)H264, packetization-mode=(string)1,
profile-level-id=(string)4d0029,
sprop-parameter-sets=(string)\"Z00AKZpkA8ARPy4C1AQEFAg\\=\\,aO48gA\\=\\=\",
a-recvonly=(string)\"\", npt-start=(guint64)0, play-speed=(double)1,
play-scale=(double)1'."

Error: "Your GStreamer installation is missing a plug-in."

 

I am using -

Embedded Device(SOC) - Colibri-T20  (NVIDIA,Toradex)

Os -Angstrom v2017.12 - Kernel   

Colibri-T20_Qt5-X11-Image 2.8b6 20190816

 

If am running this application on my Desktop it works correctly .

 

 

Thanks & Regards

Bhupendra Singh

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


Re: [Interest] Add row to model *with data*?

2019-08-16 Thread Giuseppe D'Angelo via Interest

Il 15/08/19 23:42, Matthew Woehlke ha scritto:

Is there any way, with the existing QAbstractItemModel API, to specify
the data that the row should contain in the same call that adds the row?
Even better, is there any way to ask the model to add a row, with data,
but*not*  specify where the row is to be added? (The model would then
return the new row index, or -1 if it could not complete the operation
as requested.)


There isn't such an API. Maybe you can fake it via a drop?

My 2 c,

--
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] Qt free software policy

2019-08-16 Thread Tuukka Turunen
“Well you said "Alternative for using GPLv3 and commercial would be to only 
offer these add-ons separately under a commercial license".
You did not say _only alternative_ explicitly, but it does sound, at least to 
me, like it is implicitly here.”

Sorry for that. I also should have used words “did not mean” not “did not say” 
in my reply.

Emails as a medium is tricky, easy to misunderstand the tone.

I do agree that we should clarify this, especially the GPLv2 and GPLv3 part is 
not clearly explained at qt.io websites. The approach is to use the v3 of both 
LGPL and GPL for new things, but to keep GPLv2 option for Essentials and those 
Add-ons that existed in December 2015, see clause 4.4 and 4.6 in  
https://kde.org/community/whatiskde/Software_License_Agreement_2015.pdf

Yours,

Tuukka



From: Interest  on behalf of Benjamin TERRIER 

Date: Thursday, 15 August 2019 at 12.18
To: qt qt 
Subject: Re: [Interest] Qt free software policy



Le jeu. 15 août 2019 à 09:18, Vadim Peretokin 
mailto:vpereto...@gmail.com>> a écrit :
Still, it reads like the Instagram influencer argument: "Give me free stuff and 
I'll get you exposure.", and we all know how silly that sounds like.

That is a bit insulting toward Qt contributors.
And comparing free software projects (including Qt) with Instagram's "Give me 
free stuff and I'll get you exposure" is inappropriate.

If you look at the stats of Qt Base a large percentage of the commits (~40% I'd 
say) are made by people external to The Qt Company.
You can have a look on Thiago's blog: 
https://macieira.org/~thiago/qt-stats/current/qtbase.employer.relative.png
(BTW Thiago, if you read this, the SSL certificate is invalid and some charts 
are broken)

My point is that The Qt Company is not providing free stuff merely for 
exposure. It also gets many other things including developers
committing code for free, code that The Qt Company is then able to sell under 
its commercial license.

Also I never asked for anything free here. I am asking if "GPLv3 only" is and 
will be the standard licensing scheme for new modules
made by The Qt Company. I feel that it needs to be made clear, at least so that 
if an LGPL user need something he knows
that he should not expect to have it in a future version of Qt, but should 
rather contribute it himself ensuring that it will be available under LGPL.
I have also expressed my concerns that the lack of support for GPLv2 can be an 
issue for some projects.
I would also like that some modules, if they are not good sale arguments, could 
be licensed under LGPL as if they do not help
The Qt Company sales, they could at least contribute to growing the community.


On Thu, Aug 15, 2019 at 6:17 AM Tuukka Turunen 
mailto:tuukka.turu...@qt.io>> wrote:

“This is wrong to say that the only alternative to Commercial + GPLv3 is 
Commercial only.”

I did not say the _only_ alternative. Some new things are LGPL exactly to grow 
the user base. Qt for Python being one of such.


Well you said "Alternative for using GPLv3 and commercial would be to only 
offer these add-ons separately under a commercial license".
You did not say _only alternative_ explicitly, but it does sound, at least to 
me, like it is implicitly here.

+1 for Qt for Python.


BR

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