Re: [Interest] Running Qt app in a browser

2016-04-25 Thread Tony Rietwyk
K. Frank said: 

> Hi Larry!
> 
> On Mon, Apr 25, 2016 at 4:59 PM, Larry Martell 
> wrote:
> > Is it possible to run a Qt app in a browser? I have googled for this,
> > and found some hits, but none seen like they ever worked out. The most
> > promising seems to be http://wiki.qt.io/Qt_for_Google_Native_Client
> > but the readme link is broken, so that's discouraging. Anyone have any
> > pointers on if this can be done and if so how?
> 
> This doesn't answer your question, but as an aside, there is a
web-application
> framework called Wt:
> 
>https://www.webtoolkit.eu/wt
> 
> Wt shares some of the Qt philosophy -- application code (and the Wt
library)
> is written in C++, it is widget-based, and it uses signals and slots.  I
don't know
> Wt's history, but I think Qt that significantly influenced the design of
Wt.
> 
> Of course, high-level similarities notwithstanding, the details are
entirely
> different.  You couldn't, for example, compile a Qt application into a Wt
> application.
> 
> But if you like Qt and were starting a new web-application development
> project, Wt could make sense, and if you really needed to port a Qt
> application to the web, porting from Qt to Wt would still be a substantive
> port, but the similar philosophy might make the port a little smoother.
> 
> > Thanks!
> 
> Good luck!
> 
> K. Frank

I am currently creating a Wt based web application that reuses many of our
non-GUI Qt based classes.  I works really well based on the prototypes done
so far.  

Theoretically, you could create a QPaintEngine that uses the WPainter
interface to draw GUI objects, but I haven't investigated that. 

Tony


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


Re: [Interest] Running Qt app in a browser

2016-04-25 Thread K. Frank
Hi Larry!

On Mon, Apr 25, 2016 at 4:59 PM, Larry Martell  wrote:
> Is it possible to run a Qt app in a browser? I have googled for this,
> and found some hits, but none seen like they ever worked out. The most
> promising seems to be http://wiki.qt.io/Qt_for_Google_Native_Client
> but the readme link is broken, so that's discouraging. Anyone have any
> pointers on if this can be done and if so how?

This doesn't answer your question, but as an aside, there is a
web-application framework called Wt:

   https://www.webtoolkit.eu/wt

Wt shares some of the Qt philosophy -- application code (and the
Wt library) is written in C++, it is widget-based, and it uses signals
and slots.  I don't know Wt's history, but I think Qt that significantly
influenced the design of Wt.

Of course, high-level similarities notwithstanding, the details are
entirely different.  You couldn't, for example, compile a Qt application
into a Wt application.

But if you like Qt and were starting a new web-application development
project, Wt could make sense, and if you really needed to port a Qt
application to the web, porting from Qt to Wt would still be a substantive
port, but the similar philosophy might make the port a little smoother.

> Thanks!


Good luck!


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


Re: [Interest] PRO File defines

2016-04-25 Thread Hamish Moffatt

On 25/04/16 20:58, Francisco Ares wrote:


P.S.: by the way, I've been fiddling with some PRO files, and nowadays 
use a few tricks, like:


 using one source tree to build different executables, with different 
functionality:




op1=$$find(DEFINES,"_REGISTER")
count(op1,1){
include(../ModBus/QModBusMaster.pri)
op2=$$find(QT,network)
count(op2,0){
unix|win32:QT+=network
}


Yikes. Consider "contains(QT, network)" instead of that $$find() mess. 
Or just:


unix | win32: QT *= network

(meaning add network if it is not already there).


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


[Interest] ListView in Column

2016-04-25 Thread Kevin Mcintyre
I would've thought the ListView would appear below the Text, but that
doesn't prove to be the case for me.  SplitView and GridView behave as
expected...any feedback or minimal tweaks to get working is appreciated.

Column {
Text { text: 'test'}
ListView {...}
}
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Broken Android gdb debugging ?

2016-04-25 Thread Edward Sutton
After restore to r10e NDK, the debug problem was an Android 6.0 issue 
INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE.

Using adb to uninstall the package resolved. Qt Android deploy/debug is good 
again.  Thank you for your help Andre.


Installing Android package to device.
Running command "/Users/edward3/Library/Android/sdk/platform-tools/adb -s 
08f513c6 install -r 
/Users/edward3/Documents/projects/tsr-mobile-google-analytics/build-tsr-Android_for_armeabi_v7a_GCC_4_9_Qt_5_6_0-Debug/android-build//build/outputs/apk/android-build-debug.apk"
pkg: /data/local/tmp/android-build-debug.apk
Failure [INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE]
Android package built successfully in 8.406 ms.
-- It can now be run from the selected device/emulator.
-- File: 
/Users/edward3/Documents/projects/tsr-mobile-google-analytics/build-tsr-Android_for_armeabi_v7a_GCC_4_9_Qt_5_6_0-Debug/android-build//build/outputs/apk/android-build-debug.apk

http://stackoverflow.com/questions/34791561/failure-install-failed-permission-model-downgrade

-Ed

On Apr 25, 2016, at 4:32 PM, Edward Sutton 
> wrote:

Sorry, I went back to a sample app and now I can debug again.  I think 
reverting to r10e fixed the main problem.

It must have an Android Manifest or other issue.  Something I broke when trying 
to add support for Google Analytics.

Thank you for your time and other things to test.

-Ed


On Apr 25, 2016, at 4:21 PM, André Pönitz 
> wrote:

On Mon, Apr 25, 2016 at 09:02:13PM +, Edward Sutton wrote:
Thank you Andre.

After rolling back to r10E I still cannot deploy and debug.  It no
longer hangs at the deploy stage.  This is an improvement.

The Android Kit GDB Server is still pointing to the Android Studio
ndk-bundle even thought it has been removed.

I cannot seem to fix this?

I can't check right now.

Things to test:

If you have "Automatically create kits" checked in Qt Creator's
Android settings, remove and re-add the Qt version. This should
remove and re-add corresponding kits.

If that does not help and there's still an auto-detected kit with
some wrong settings, clone that kit, and replace the wrong setting
with the correct one. In case of compiler or debugger you might
need to add (and 'Apply'...) entries on the compiler/debugger pages
first. Then use this fixed kit.

Andre'


This email and any files transmitted with it from The Charles Machine Works, 
Inc. are confidential and intended solely for the use of the individual or 
entity to which they are addressed. If you have received this email in error 
please notify the sender. Our company accepts no liability for the contents of 
this email, or for the consequences of any actions taken on the basis of the 
information provided, unless that information is subsequently confirmed in 
writing. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.
___
Interest mailing list
Interest@qt-project.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.qt-2Dproject.org_mailman_listinfo_interest=CwIGaQ=G4BpsyPyB19LB50bn2swXw=cAG2c-SQES5P2qb8IW-uwnBOCX_f2qYJIlzenFnoHUc=2Ah1mksuo2wh8_M0Q7D3xQJUjW8puTMEU2RmmS0RvLg=pAcN6kEGHae3Ytb0L5mx58bOysxC9p05m4ojGGmYW6M=

This email and any files transmitted with it from The Charles Machine Works, 
Inc. are confidential and intended solely for the use of the individual or 
entity to which they are addressed. If you have received this email in error 
please notify the sender. Our company accepts no liability for the contents of 
this email, or for the consequences of any actions taken on the basis of the 
information provided, unless that information is subsequently confirmed in 
writing. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Broken Android gdb debugging ?

2016-04-25 Thread Edward Sutton
Sorry, I went back to a sample app and now I can debug again.  I think 
reverting to r10e fixed the main problem.

It must have an Android Manifest or other issue.  Something I broke when trying 
to add support for Google Analytics.

Thank you for your time and other things to test.

-Ed


> On Apr 25, 2016, at 4:21 PM, André Pönitz  wrote:
>
> On Mon, Apr 25, 2016 at 09:02:13PM +, Edward Sutton wrote:
>> Thank you Andre.
>>
>> After rolling back to r10E I still cannot deploy and debug.  It no
>> longer hangs at the deploy stage.  This is an improvement.
>>
>> The Android Kit GDB Server is still pointing to the Android Studio
>> ndk-bundle even thought it has been removed.
>>
>> I cannot seem to fix this?
>
> I can't check right now.
>
> Things to test:
>
> If you have "Automatically create kits" checked in Qt Creator's
> Android settings, remove and re-add the Qt version. This should
> remove and re-add corresponding kits.
>
> If that does not help and there's still an auto-detected kit with
> some wrong settings, clone that kit, and replace the wrong setting
> with the correct one. In case of compiler or debugger you might
> need to add (and 'Apply'...) entries on the compiler/debugger pages
> first. Then use this fixed kit.
>
> Andre'
>

This email and any files transmitted with it from The Charles Machine Works, 
Inc. are confidential and intended solely for the use of the individual or 
entity to which they are addressed. If you have received this email in error 
please notify the sender. Our company accepts no liability for the contents of 
this email, or for the consequences of any actions taken on the basis of the 
information provided, unless that information is subsequently confirmed in 
writing. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Broken Android gdb debugging ?

2016-04-25 Thread André Pönitz
On Mon, Apr 25, 2016 at 09:02:13PM +, Edward Sutton wrote:
> Thank you Andre.
> 
> After rolling back to r10E I still cannot deploy and debug.  It no
> longer hangs at the deploy stage.  This is an improvement.
> 
> The Android Kit GDB Server is still pointing to the Android Studio
> ndk-bundle even thought it has been removed.
> 
> I cannot seem to fix this?

I can't check right now.

Things to test:

If you have "Automatically create kits" checked in Qt Creator's
Android settings, remove and re-add the Qt version. This should
remove and re-add corresponding kits.

If that does not help and there's still an auto-detected kit with
some wrong settings, clone that kit, and replace the wrong setting
with the correct one. In case of compiler or debugger you might
need to add (and 'Apply'...) entries on the compiler/debugger pages
first. Then use this fixed kit.

Andre'

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


Re: [Interest] Running Qt app in a browser

2016-04-25 Thread Jérôme Godbout
Not a full solution, but just a thought, you could use some sort of CGI
script to call your Qt Application backend?

For the Gui, I wonder if rendering the image into a texture or an image.
Send the image to the client (delta compressed). Make the rendering into a
canvas and apply changed. You could send the mouse click from the client
back to the application as JSON call to your CGI as relative coordinate and
simulate them into the Qt application.

This would be bandwidth intensive, but depending on what you try to
achieve.

On Mon, Apr 25, 2016 at 4:59 PM, Larry Martell 
wrote:

> Is it possible to run a Qt app in a browser? I have googled for this,
> and found some hits, but none seen like they ever worked out. The most
> promising seems to be http://wiki.qt.io/Qt_for_Google_Native_Client
> but the readme link is broken, so that's discouraging. Anyone have any
> pointers on if this can be done and if so how?
>
> Thanks!
> ___
> 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] Broken Android gdb debugging ?

2016-04-25 Thread Edward Sutton
Thank you Andre.

After rolling back to r10E I still cannot deploy and debug.  It no longer hangs 
at the deploy stage.  This is an improvement.

The Android Kit GDB Server is still pointing to the Android Studio ndk-bundle 
even thought it has been removed.

I cannot seem to fix this?



I unchecked NDK 12 from Android Studio SDK Manager and removed it.

Then I downloaded/installed r10E from:

http://dl.google.com/android/repository/android-ndk-r10e-darwin-x86_64.zip

Removed Qt 5.6.0 and reinstalled.

Changed Qt -> Android, NDK Location from Android NDK location of:
~/Library/Android/sdk/ndk-bundle

To
~/android/android-ndk-r10e

In Application Output I see::

Debugging starts
Debugging has finished

sStarting debugger "GdbEngine" for ABI "arm-linux-android-elf-32bit"...
dStart parameters: 'com.ditchwitch.tsr' mode: 6
dABI: arm-linux-android-elf-32bit
dLanguages: c++
dExecutable: 
/Users/edward3/Documents/projects/tsr-mobile-google-analytics/build-tsr-Android_for_armeabi_v7a_GCC_4_9_Qt_5_6_0-Debug/app_process
dDebugger: 
/Users/edward3/android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gdb
dProject: 
/Users/edward3/Documents/projects/tsr-mobile-google-analytics/sourceAddtional 
Search Directories:
dRemote: :5039
dSysroot:
dDebug Source Location:
dDebugger settings:
dBreakOnWarning: false (default: false)
dShowQmlObjectTree: true (default: true)
dBreakOnAbort: false (default: false)
dSelectedPluginBreakpointsPattern: .* (default: .*)
dNoPluginBreakpoints: false (default: false)
dBreakOnCatch: false (default: false)
dBreakOnThrow: false (default: false)
dQmlInspector.ShowAppOnTop: false (default: false)
dLoadGdbDumpers2: false (default: false)
dLoadGdbInit: true (default: true)
dGdbStartupCommands: (default: )
dAttemptQuickStart: false (default: false)
dCDB_Console: false (default: false)
dBreakOnCrtDbgReport: false (default: false)
dIgnoreFirstChanceAccessViolation: false (default: false)
dBreakpointCorrection: true (default: true)
dWarnOnReleaseBuilds: true (default: true)
dTargetAsync: false (default: false)
dIntelFlavor: false (default: false)
dMultiInferior: false (default: false)
dWatchdogTimeout: 20 (default: 20)
dGdbPostAttachCommands: (default: )
dUseDynamicType: true (default: true)
dAutoEnrichParameters: true (default: true)
dShowQtNamespace: true (default: true)
dShowStandardNamespace: true (default: true)
dAutoDerefPointers: true (default: true)
dSortStructMembers: true (default: true)
dMaximalStackDepth: 20 (default: 20)
dIdentifyDebugInfoPackages: false (default: false)
dAllPluginBreakpoints: true (default: true)
dAdjustBreakpointLocations: true (default: true)
dSelectedPluginBreakpoints: false (default: false)
dDisplayStringLimit: 100 (default: 100)
dMaximalStringLength: 1 (default: 1)
dEnableReverseDebugging: false (default: false)
dSkipKnownFrames: false (default: false)
dAutoQuit: false (default: false)
dVerboseLog: false (default: false)
dLogTimeStamps: false (default: false)
dUseAlternatingRowColours: false (default: false)
dUseMessageBoxForSignals: true (default: true)
dFontSizeFollowsEditor: false (default: false)
dRaiseOnInterrupt: true (default: true)
dBreakpointsFullPath: false (default: false)
dUseDebuggingHelper: true (default: true)
dStationaryEditorWhileStepping: false (default: false)
dCloseBuffersOnExit: false (default: false)
dSwitchModeOnExit: false (default: false)
dCloseMemoryBuffersOnExit: true (default: true)
dUseToolTipsInBreakpointsView: true (default: true)
dUseToolTipsInBreakpointsView: true (default: false) ***
dUseAddressInStackView: false (default: false)
dUseAddressInBreakpointsView: false (default: false)
dShowThreadNames: false (default: false)
dUseCodeModel: true (default: true)
dUseToolTipsInLocalsView: false (default: false)
dUseToolTips: true (default: true)
dSymbolPaths: (default: )
dAdditionalArguments: (default: )
dBreakEvent: (default: )
dSourcePaths: (default: )
dAlwaysAdjustColumnWidths: true (default: true)
dGdbCustomDumperCommands: (default: )
dExtraDumperFile: (default: )
dBreakOnFatal: false (default: false)
dState changed from DebuggerNotReady(0) to EngineSetupRequested(1) [master]
dQUEUE: SETUP ENGINE
dCALL: SETUP ENGINE
dTRYING TO START ADAPTER
dNOTE: REQUEST REMOTE SETUP

dNOTE: INFERIOR EXITED
dState changed from EngineSetupRequested(1) to InferiorShutdownOk(18) [master]
dState changed from InferiorShutdownOk(18) to EngineShutdownRequested(19) 
[master]
dQUEUE: SHUTDOWN ENGINE
dCALL: SHUTDOWN ENGINE
dINITIATE GDBENGINE SHUTDOWN IN STATE 0, PROC: 0
dNOTE: ENGINE SHUTDOWN OK
dState changed from EngineShutdownRequested(19) to EngineShutdownOk(21) [master]
dState changed from EngineShutdownOk(21) to DebuggerFinished(22) [master]
dQUEUE: FINISH DEBUGGER
dNOTE: FINISH DEBUGGER
dHANDLE RUNCONTROL FINISHED
sDebugger finished.

-Ed

On Apr 25, 2016, at 3:11 PM, André Pönitz 
> wrote:

On Mon, Apr 25, 2016 at 07:57:55PM +, Edward 

Re: [Interest] Broken Android gdb debugging ?

2016-04-25 Thread André Pönitz
On Mon, Apr 25, 2016 at 07:57:55PM +, Edward Sutton wrote:
> My Android gdb debugging and deployment broke recently after I switched from 
> Eclipse to Android Studio and installed Qt 5.6.0.
> 
> I am not sure what to check?

Try NDK 10e, not 11b or 11c

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


[Interest] Broken Android gdb debugging ?

2016-04-25 Thread Edward Sutton
My Android gdb debugging and deployment broke recently after I switched from 
Eclipse to Android Studio and installed Qt 5.6.0.

I am not sure what to check?

The Android for armeabi-v7a (GCC 4.9, Qt 5.6.0) kit can no longer find gdb.

~/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gdb

I can still find gdbserver:

~/Library/Android/sdk/ndk-bundle/prebuilt/android-arm/gdbserver/gdbserver

The Android NDK mentions an ndk-gdb script.  Does this replaced gdb?

~/Library/Android/sdk/ndk-bundle/ndk-gdb

Has Qt Android switched too LLDB for Android?

-Ed



This email and any files transmitted with it from The Charles Machine Works, 
Inc. are confidential and intended solely for the use of the individual or 
entity to which they are addressed. If you have received this email in error 
please notify the sender. Our company accepts no liability for the contents of 
this email, or for the consequences of any actions taken on the basis of the 
information provided, unless that information is subsequently confirmed in 
writing. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Howto keep a pushButton style while changing the backgroundcolor

2016-04-25 Thread anton
Thanks a lot Tony,

yes it works :-)

Anton

Tony Rietwyk wrote:

> Hope that helps,
> 


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


Re: [Interest] Few questions regarding Qt Quick Scene Graph

2016-04-25 Thread Artem Fedoskin
Thank you for your reply Gunnar,

Can you please tell me - can I store a pointer to the object of external
class (even not a QQuickItem derived one) in QSGNode derived class? Each
object of the class Data is associated with corresponding Triangle in View.
Whenever View is updated, it checks in loop Data objects on special
condition and based on that sets the corresponding Triangle to visible or
invisible state. If Triangle is visible, Triangle itself calls a bunch of
functions from external classes and uses pointer on object Data to retrieve
Data's info about coordinates then accesses function from another class to
convert the received coordinates to x,y positions.

I understand that it is not safe to access QSGNode not from updatePaintNode(),
but is it actually safe to access other classes from QSGNode itself? How
far can I go in QSGNode in accessing things in GUI thread?

Could you please also tell me - what is the way to hide QSGNode explicitly
like for example setting QQuickItem::visible property to false. I found
your E-Mail here
http://lists.qt-project.org/pipermail/interest/2015-February/015285.html
but I'm afraid that deallocating and allocating QSGNode will take
unnecessary overhead as the visibility of nodes in my app will be often
turned off/on. Is it a good idea to use QSGNode::removeChildNode() for this?

How do you think - maybe instead of allocating directly QSGNodes I should
just subclass instance of Data from QQuickItem and set its visual parent to
View? Is allocating 1000 QSGNodes in View significantly faster than
creating 1000 QQuickItems with the same painting logic and then setting its
visual parent to View?

Thank you

Regards,
Artem

2016-04-25 9:06 GMT+02:00 Gunnar Sletta :

>
> > On 24 Apr 2016, at 16:49, Artem Fedoskin  wrote:
> >
> > I'm sorry. My first E-Mail was sent accidentally. Here is the final
> version of my E-Mail.
> > Hello everybody. I have a project where a lot of objects are painted on
> the screen whenever the user interacts with the app (pan, zoom, move) I
> would be really grateful to you if you could answer a few questions
> regarding the internals of Qt Quick Scene Graph:
> >
> >   • Imagine that I add 1000 nodes with the same color inside
> QQuickItem::updatePaintNode() function of some QQuickItem derived class.
> Will they be drawn in batch as described in
> http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph-renderer.html#batching
> ?
>
> Depends on the cirucmstances, but if they share clipping their
> QSGMaterial::compare() indicates they are all identical, they will be
> batched, yes. Verify with QSG_VISUALIZE=batches, as indicated by this same
> document.
>
> >   • Can I call the function of some other class in
> QQuickItem::updatePaintNode()? I have some class named Data, class named
> View and a subclass of QSGGeometryNode Triangle. Imagine that after objects
> of these classes are created the Data asks View to create 10 Triangles. The
> View creates 10 Triangles during the updatePaintNode() call and passes to
> them pointers to the object of class Data, that required their
> instantiation. The Triangles refers to the Data and get some values from it
> and converts them to x,y coordinates. Is it something possible?
> > Do I violate the rule stated here
> http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph.html#scene-graph-and-rendering
> "Warning: It is crucial that OpenGL operations and interaction with the
> scene graph happens exclusively on the render thread, primarily during the
> updatePaintNode() call. The rule of thumb is to only use classes with the
> "QSG" prefix inside the QQuickItem::updatePaintNode() function." ?
>
> The point here is really that on many systems, there will be two threads
> that are running. The GUI thread where your QQuickItems live and the render
> thread where your QSGXxx objects live. updatePaintNode() is called on the
> render thread while the GUI thread is blocked, so you are safe to read
> state out of the QQuickItem at that time and use that to
> create/update/modify/delete your QSGXxx objects accordingly. At any other
> time, the two worlds live separate lives and should have no connection.
>
> There are other places where interaction between the threads are also ok,
> as outlined in the QQuickItem docs, but by sticking to the rule outlined in
> the updatePaintNode() function, 99% of all usecases will be covered.
>
> For your usecase you are free to construct View, Data, x number of
> Triangles during updatePaintNode() and then store that under some subclass
> of a QSGNode. On the next call,  you can update your structure if needed.
> Your QQuickItem does not store a pointer to this QSGNode, it only exists
> inside the scene graph and during the updatePaintNode() function.
>
> cheers,
> Gunnar
>
> >
> > At first I was thinking about deriving classes like Triangle from
> QQuickItem and then reparenting them to the View but the direct creation of
> QSGGeometryNodes 

Re: [Interest] Howto keep a pushButton style while changing the backgroundcolor

2016-04-25 Thread Tony Rietwyk
Anton said: 

> Sent: Tuesday, 26 April 2016 2:53 AM
> Hi,
> 
> I am experimenting with qt 5.6.0.
> 
> 1. I create a QtWidgts application.
> 2. I drop a pushButton in the Main Window 3. I change the styleSheet of
the
> QMainWindow
>to: background-color: rgb(85, 170, 255);
> 
> Now the button has the same background color too.
> 
> How can I leave the style of the pushbutton as it is?
> (without inheriting the blue background color from the QMainWindow)
> 
> I didn't find any solution and I do not want to set a background bitmap
for
> such a simple problem.
> 
> What point did I miss?
> 
> Thanks for a hint.
> 
> Anton

You missed some CSS.  Without a CSS selector, the background-color
recursively applies to all widgets parented by the main window. 

Try setStyleSheet( "QMainWindow { background-color: rgb(85, 170, 255); }" );
or
  setStyleSheet( "#mainWindowObjectName { background-color: rgb(85, 170,
255); }" ); 

Hope that helps, 

Tony


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


[Interest] Howto keep a pushButton style while changing the backgroundcolor

2016-04-25 Thread anton
Hi,

I am experimenting with qt 5.6.0.

1. I create a QtWidgts application.
2. I drop a pushButton in the Main Window
3. I change the styleSheet of the QMainWindow 
   to: background-color: rgb(85, 170, 255);

Now the button has the same background color too.

How can I leave the style of the pushbutton as it is?
(without inheriting the blue background color from the QMainWindow)

I didn't find any solution and I do not want to set a background bitmap
for such a simple problem.

What point did I miss?

Thanks for a hint.

Anton

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


Re: [Interest] [Qt3d] Does the duration of NumberAnimation update when you change its value?

2016-04-25 Thread Sean Harmer
Hi,

On Monday 25 April 2016 16:23:31 Ramy Atalla via Interest wrote:
> Hi,I am trying to do a rotation animation and control the rotation speed by
> changing the value of the duration, But it doesn't work . My question is it
> feasible or there another way ?
> 
> QQ2.NumberAnimation {id:wheelanimation property int carspeed:0   
> targets: [wheel1Transform , rim1Transform,wheel2Transform ,
> rim2Transform,wheel3Transform , rim3Transform,wheel4Transform ,
> rim4Transform]property: "userAngle"duration: carspeedfrom: 0   
> to: 360loops: QQ2.Animation.Infiniterunning: true }
> QQ2.NumberAnimation {duration: 100loops: QQ2.Animation.Infinite   
> target: wheelanimationproperty: "carspeed"from: 0.0to: 3000   
> running: true }

I don't think this works unless you stop/restart the animation which is not 
ideal. A work around is to have a simple NumberAnimation changing a "progress" 
value, then in your actual property that you wish to animate, multiply this 
progress property by your rotationSpeed property. It requires some extra 
gymnastics to cope with non-integer numbers of rotations per cycle of the 
progress property.

Something like this should do it (not tested):

Entity {
id: root
property real progress: 0.0
property real rotationSpeed: 10.0
property real angle: previousAngle + ( progress * rotationSpeed )
property real previousAngle: 0.0

function updatePreviousRotation() {
root.previousAngle = root.angle;
}

SequentialAnimation {
running: true
loops: Animation.Infinite

NumberAnimation {
from: 0; to: 1
duration: 1000
}

ScriptAction { script: updatePreviousRotation() }
}
}

This is a limitation of what can be expressed with the Qt Quick 2 animation 
framework at present. When we look at adding an animation aspect to Qt 3D for 
Qt 5.8 or 5.9, this is one of the things I want to address along with morph 
target, key frame and skeletal animations. More likely for 5.9 given we're 
already well into the development cycle for 5.8 and we're still putting all 
efforts into 5.7.

Hope this helps,

Sean
--
Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. UK +44 (0)1625 809908, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] [Qt3d] Does the duration of NumberAnimation update when you change its value?

2016-04-25 Thread Ramy Atalla via Interest
Hi,I am trying to do a rotation animation and control the rotation speed by 
changing the value of the duration, But it doesn't work . My question is it 
feasible or there another way ?

QQ2.NumberAnimation {id:wheelanimation property int carspeed:0
targets: [wheel1Transform , rim1Transform,wheel2Transform , 
rim2Transform,wheel3Transform , rim3Transform,wheel4Transform , 
rim4Transform]property: "userAngle"duration: carspeedfrom: 0to: 
360loops: QQ2.Animation.Infiniterunning: true
}
QQ2.NumberAnimation {duration: 100loops: QQ2.Animation.Infinite
target: wheelanimationproperty: "carspeed"from: 0.0to: 3000
running: true
}
ThanksRamy___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] PRO File defines

2016-04-25 Thread Francisco Ares
2016-04-25 2:39 GMT-03:00 Igor Mironchik :

> Hi,
>
> On 25.04.2016 00:29, Gianluca wrote:
>
> It’s not the first time that I see people knowing some “secrets” of Qmake …
> … where is the full documentation of all these details ?
>
>
> I found that here:
>
> http://doc.qt.io/qt-5/building-from-source-ios.html
>
> *Note: *A default build will include both simulator and device libraries.
> If you want to build for a single target, use the -sdk argument with
> either iphoneos or iphonesimulator.
>
> But I don't remember where I found that first time, just google a
> little... :)
>
> Il giorno 24/apr/2016, alle ore 18:47, Igor Mironchik 
>   ha scritto:
>
>
> Hi,
>
> For real device you can use:
>
> ios {
>  iphoneos {
># Here is the real device
>  }
> }
>
> On 24.04.2016 20:45, mark diener wrote:
>
> Hello List:
>
> Who can tell me how to detect whether a build is for IOS or IOS Simulator
> in the project PRO file.
>
> ios {
> QMAKE_IOS_DEPLOYMENT_TARGET=8.0
> QMAKE_IOS_TARGETED_DEVICE_FAMILY=1,2
> }
>
> But how to I differentiate between IOS builds and IOS-simulator builds?
>
> Thanks,
>
> Marco
> ___
> Interest mailing 
> listInterest@qt-project.orghttp://lists.qt-project.org/mailman/listinfo/interest
>
> ___
> Interest mailing 
> listInterest@qt-project.orghttp://lists.qt-project.org/mailman/listinfo/interest
>
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>

There's this link, also, which I found most interesting:

http://doc.qt.io/qt-5/qmake-manual.html

Good luck and
Best regards,
Francisco


P.S.: by the way, I've been fiddling with some PRO files, and nowadays use
a few tricks, like:

 using one source tree to build different executables, with different
functionality:



op1=$$find(DEFINES,"_REGISTER")

count (op1,1) {

include(../ModBus/QModBusMaster.pri)

op2=$$find(QT, network)

count(op2,0) {

unix|win32: QT += network

}

TARGET = WebR

}

count(op1,0) {

TARGET = Web

}



building a usable string with the revision number, which considers the
subversion's own revision number:





REV_MAJOR_CODE = 1
REV_MINOR_CODE = 7
REV_PATCH_CODE = 0

win32 {
defineReplace(Revisions){
NUMBERS = $$system(set LANG=en_US && svn info | sed --quiet 
/Rev:/p
| cut -d: -f2 )
# message($$NUMBERS)
return ($$NUMBERS)
}
}

unix {
defineReplace(Revisions){
NUMBERS = $$system(A=`LC_ALL=C svn info | grep "Rev:" | cut 
-d\" \"
 -f4` && echo $A)
# message($$NUMBERS)
return ($$NUMBERS)
}
}

VER = $$REV_MAJOR_CODE $$REV_MINOR_CODE $$REV_PATCH_CODE $$Revisions()
VERSION = $$join(VER, ".")

DEFINES += \
REV_SUBVN_CODE=$$Revisions() \
REV_PATCH_CODE=$$REV_PATCH_CODE \
REV_MINOR_CODE=$$REV_MINOR_CODE \
REV_MAJOR_CODE=$$REV_MAJOR_CODE \
REV_CODE=\\\"$$VERSION\\\" \
APP_VERSION=\\\"$$VERSION\\\" \
APP_NAME=\"$$TARGET\" \
QT_DLL

message($$TARGET v.: $$VERSION  -  Qt $$QT_VERSION)


So, like this, the source may use the PRO file defined REV_CODE
variable to show it anywhere as desired, for instance.


Knowledge and practice really does something!
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Convert IPv6 to IPv4 ?

2016-04-25 Thread Alexander Carôt
Hello Thiago, Hello Benjamin,

thanks for your replies !

In fact Thiago was precisely right with this:

> You probably mean you've got a v4-mapped IPv6 address, as
> :::192.0.2.1

As a quick hack I first converted this to a string and removed the first 7 
characters but of course Thiagos solution is the way to do it. It works well - 
thanks a lot,

best regards

Alex


--
http://www.carot.de
Email : alexan...@carot.de
Tel.: +49 (0)177 5719797


> Gesendet: Donnerstag, 21. April 2016 um 19:02 Uhr
> Von: "Thiago Macieira" 
> An: interest@qt-project.org
> Betreff: Re: [Interest] Convert IPv6 to IPv4 ?
>
> On quinta-feira, 21 de abril de 2016 14:05:52 PDT Alexander Carôt wrote:
> > Hello,
> > 
> > I noticed that retrieving a sender's IP address of a QWebSocket via
> > ->peerAddress() returns an IPv6 socket address.
> > 
> > For certain reasons I need an IPv4 address so I wonder how it is possible to
> > either let ->peerAddress() return an IPv4 address or convert the IPv6
> > address to an IPv4 address.
> 
> Hello Alex
> 
> You probably mean you've got a v4-mapped IPv6 address, as
>   :::192.0.2.1
> 
> You should code as:
> 
>   bool ok;
>   quint32 ipv4 = hostaddr.toIPv4Address();
>   if (ok) {
>   // check my IPv4 ACL
>   } else if (hostaddr.protocol() == QAbstractSocket::IPv6Protocol) {
>   // check my IPv6 ACL
>   } else {
>   // uh... what?
>   }
> 
> 
> -- 
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
> 
> ___
> 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] QtLabsControls Button - Invalid property name "label".

2016-04-25 Thread J-P Nurmi
On 25 Apr 2016, at 10:01, Viktória Nemkin 
> 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


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

2016-04-25 Thread Viktória Nemkin
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?

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


Re: [Interest] Few questions regarding Qt Quick Scene Graph

2016-04-25 Thread Gunnar Sletta

> On 24 Apr 2016, at 16:49, Artem Fedoskin  wrote:
> 
> I'm sorry. My first E-Mail was sent accidentally. Here is the final version 
> of my E-Mail.
> Hello everybody. I have a project where a lot of objects are painted on the 
> screen whenever the user interacts with the app (pan, zoom, move) I would be 
> really grateful to you if you could answer a few questions regarding the 
> internals of Qt Quick Scene Graph:
> 
>   • Imagine that I add 1000 nodes with the same color inside 
> QQuickItem::updatePaintNode() function of some QQuickItem derived class. Will 
> they be drawn in batch as described in 
> http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph-renderer.html#batching?

Depends on the cirucmstances, but if they share clipping their 
QSGMaterial::compare() indicates they are all identical, they will be batched, 
yes. Verify with QSG_VISUALIZE=batches, as indicated by this same document.

>   • Can I call the function of some other class in 
> QQuickItem::updatePaintNode()? I have some class named Data, class named View 
> and a subclass of QSGGeometryNode Triangle. Imagine that after objects of 
> these classes are created the Data asks View to create 10 Triangles. The View 
> creates 10 Triangles during the updatePaintNode() call and passes to them 
> pointers to the object of class Data, that required their instantiation. The 
> Triangles refers to the Data and get some values from it and converts them to 
> x,y coordinates. Is it something possible?
> Do I violate the rule stated here 
> http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph.html#scene-graph-and-rendering
>  "Warning: It is crucial that OpenGL operations and interaction with the 
> scene graph happens exclusively on the render thread, primarily during the 
> updatePaintNode() call. The rule of thumb is to only use classes with the 
> "QSG" prefix inside the QQuickItem::updatePaintNode() function." ? 

The point here is really that on many systems, there will be two threads that 
are running. The GUI thread where your QQuickItems live and the render thread 
where your QSGXxx objects live. updatePaintNode() is called on the render 
thread while the GUI thread is blocked, so you are safe to read state out of 
the QQuickItem at that time and use that to create/update/modify/delete your 
QSGXxx objects accordingly. At any other time, the two worlds live separate 
lives and should have no connection. 

There are other places where interaction between the threads are also ok, as 
outlined in the QQuickItem docs, but by sticking to the rule outlined in the 
updatePaintNode() function, 99% of all usecases will be covered. 

For your usecase you are free to construct View, Data, x number of Triangles 
during updatePaintNode() and then store that under some subclass of a QSGNode. 
On the next call,  you can update your structure if needed. Your QQuickItem 
does not store a pointer to this QSGNode, it only exists inside the scene graph 
and during the updatePaintNode() function.

cheers,
Gunnar

> 
> At first I was thinking about deriving classes like Triangle from QQuickItem 
> and then reparenting them to the View but the direct creation of 
> QSGGeometryNodes seems to me to be less memory requiring approach.
> 
> Regards,
> Artem Fedoskin
> 
> 2016-04-24 16:41 GMT+02:00 Artem Fedoskin :
> Hello everybody. I have a project where a lot of objects are painted on the 
> screen whenever the user interacts with the app (pan, zoom, move) I would be 
> really grateful to you if you could answer a few questions regarding the 
> internals of Qt Quick Scene Graph:
> 
>   • Imagine that I add 1000 nodes with the same color inside 
> QQuickItem::updatePaintNode() function of some QQuickItem derived class. Will 
> they be drawn in batch as described in 
> http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph-renderer.html#batching?
>   • Can I call the function of some other class in 
> QQuickItem::updatePaintNode()? I have some class named Data, class named View 
> and a subclass of QSGGeometryNode Triangle. Imagine that after objects of 
> these classes are created the Data asks View to create 10 Triangles. The View 
> creates 10 Triangles during the updatePaintNode() call and passes pointers to 
> the object of class Data, that required their instantiation. The Triangles 
> refers to the Data and get coordinates from it. Is it something possible. Do 
> I violate the rule stated here "Warning: It is crucial that OpenGL operations 
> and interaction with the scene graph happens exclusively on the render 
> thread, primarily during the updatePaintNode() call. The rule of thumb is to 
> only use classes with the "QSG" prefix inside the 
> QQuickItem::updatePaintNode() function."
> 
> 
> 
>   • For example, I want to get new coordinates of the object and to do 
> that I should refer to function of some other not QSGNode derived object and 
> then use these coordinates for rendering one