[Interest] [QGView] Center align text item that ignores inherited transformation

2016-11-22 Thread Ch'Gans
Hi there,

I'm trying to add a QGraphicsSimpleTextItem as a child of another (shape) item.
I want the text to not follow scaling of the view (I use
QGraphicsItem::ItemIgnoreTransformations flag), *and* be always
centered on it's parent shape.
Ideally, i'm looking at a solution that doesn't require to create a
custom QGItem.

My problem is the centering of the text item itself, without
centering, here is what i do:
--
auto item = new ...
...
auto text = new QGraphicsSimpleTextItem(item);
text->setText(...);
text->setFlag(QGraphicsItem::ItemIgnoresTransformations);
auto itemCenter = QPointF(item->boundingRect().width()/2.0,
item->boundingRect().height()/2.0);
text->setPos(itemCenter);
--

This work fine, but (as expected) the top-left of the text is
positioned on the center of the parent item.
To center-align, I tried:
---
auto textCenter = QPointF(text->boundingRect().width()/2.0,
   text->boundingRect().height()/2.0);
text->setTransform(QTransform::fromTranslate(-textCenter.x, -textCenter));
---

But this doesn't work because textCenter is an offset in a coordinate
system that doesn't follow view scaling... and the text transform
seems to be applied in the "scaled space".

Basically my problem is that it seems that I need a dynamic
positioning wrt the parent that depends on the view transform...

Does anyone know some tricks on how to achieve this?

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


Re: [Interest] Building Qt from source for iOS - make install fails

2016-11-22 Thread bralchenko
Thanks Jake for your response.

5.8 did not work for me either, but I did not capture the exact error, it was 
related to signing, similar to 5.7.1. 

I have tried to build 5.8 something like 5 days ago, may have changed since. 

 
Regards,
Boris Ralchenko.





> On Nov 22, 2016, at 4:12 PM, Jake Petroules  wrote:
> 
> Responses inline. Did 5.8 work for you? You didn't specify.
> 
>> On Nov 22, 2016, at 12:59 PM, bralche...@ics.com wrote:
>> 
>> Hi,
>> 
>> I was trying to build Qt from source specifically for iOS, I wanted to check 
>> something. The build succeeds, but make install fails on number of version, 
>> I tried 5.6.2, 5.7.1 and 5.8. Interesting thing is that errors are different 
>> for each one. I tried to build and to install without any changes, just 
>> source from qt.io first.
>> 
>> I am building in on MacOS 10.12.1, Xcode 8.1 (8B62). 
>> 
>> There are my config parameters:
>> 
>> ../qt-everywhere-opensource-src-5.7.1/configure -prefix /opt/Qt-5.7-src -sdk 
>> iphoneos -xplatform macx-ios-clang -release -nomake examples -nomake tests
>> 
>> They are the same for all my attempt except of directories’ names.
>> 
>> make install error on 5.6.2:
>> 
>> /Users/boris/Projects/ICS/Qt_5-6.2/qt-everywhere-opensource-src-5.6.2/qtconnectivity/src/bluetooth/osx/osxbtledeviceinquiry.mm:207:33:
>>  error: cannot initialize a variable of type 'const CBCentralManagerState' 
>> with an rvalue of type 'CBManagerState'
>>const CBCentralManagerState cbState(central.state);
>>^   ~
>> 1 error generated.
>> make[3]: *** [.obj/osxbtledeviceinquiry.o] Error 1
>> make[2]: *** [sub-bluetooth-install_subtargets] Error 2
>> make[1]: *** [sub-src-install_subtargets] Error 2
>> make: *** [module-qtconnectivity-install_subtargets] Error 2
> 
> Fixed by https://codereview.qt-project.org/#/c/172072/ 
> . Will be in 5.6.3 + 5.7.1 + 
> 5.8.0.
> 
>> 
>> make install error on 5.7.1:
>> 
>> 
>> Check dependencies
>> No profiles for 'com..qtplugininfo' were found: Xcode couldn't find 
>> a provisioning profile matching 'com.7071973Canada.qtplugininfo'.
>> Code signing is required for product type 'Application' in SDK 'iOS 10.1'
>> 
>> ** INSTALL FAILED **
> 
> Probably https://bugreports.qt.io/browse/QTBUG-55915? 
>  The fix is in 5.6.2 and 5.8.0 
> but won't be in 5.7 until 5.7.2.
> 
>> 
>> 
>> Any ideas or suggestions will be much appreciated.
>> 
>> Regards,
>>Boris Ralchenko.
>> 
>> 
>> 
>> 
>> 
>> ___
>> Interest mailing list
>> Interest@qt-project.org 
>> http://lists.qt-project.org/mailman/listinfo/interest 
>> 
> 
> -- 
> Jake Petroules - jake.petrou...@qt.io 
> The Qt Company - Silicon Valley
> Qbs build tool evangelist - qbs.io 
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Building Qt from source for iOS - make install fails

2016-11-22 Thread Jake Petroules
Responses inline. Did 5.8 work for you? You didn't specify.

> On Nov 22, 2016, at 12:59 PM, bralche...@ics.com wrote:
> 
> Hi,
> 
> I was trying to build Qt from source specifically for iOS, I wanted to check 
> something. The build succeeds, but make install fails on number of version, I 
> tried 5.6.2, 5.7.1 and 5.8. Interesting thing is that errors are different 
> for each one. I tried to build and to install without any changes, just 
> source from qt.io first.
> 
> I am building in on MacOS 10.12.1, Xcode 8.1 (8B62). 
> 
> There are my config parameters:
> 
> ../qt-everywhere-opensource-src-5.7.1/configure -prefix /opt/Qt-5.7-src -sdk 
> iphoneos -xplatform macx-ios-clang -release -nomake examples -nomake tests
>  
> They are the same for all my attempt except of directories’ names.
> 
> make install error on 5.6.2:
> 
> /Users/boris/Projects/ICS/Qt_5-6.2/qt-everywhere-opensource-src-5.6.2/qtconnectivity/src/bluetooth/osx/osxbtledeviceinquiry.mm:207:33:
>  error: cannot initialize a variable of type 'const CBCentralManagerState' 
> with an rvalue of type 'CBManagerState'
> const CBCentralManagerState cbState(central.state);
> ^   ~
> 1 error generated.
> make[3]: *** [.obj/osxbtledeviceinquiry.o] Error 1
> make[2]: *** [sub-bluetooth-install_subtargets] Error 2
> make[1]: *** [sub-src-install_subtargets] Error 2
> make: *** [module-qtconnectivity-install_subtargets] Error 2

Fixed by https://codereview.qt-project.org/#/c/172072/. Will be in 5.6.3 + 
5.7.1 + 5.8.0.

> 
> make install error on 5.7.1:
> 
> 
> Check dependencies
> No profiles for 'com..qtplugininfo' were found: Xcode couldn't find a 
> provisioning profile matching 'com.7071973Canada.qtplugininfo'.
> Code signing is required for product type 'Application' in SDK 'iOS 10.1'
> 
> ** INSTALL FAILED **

Probably https://bugreports.qt.io/browse/QTBUG-55915? The fix is in 5.6.2 and 
5.8.0 but won't be in 5.7 until 5.7.2.

> 
> 
> Any ideas or suggestions will be much appreciated.
> 
> Regards,
> Boris Ralchenko.
> 
> 
> 
> 
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-- 
Jake Petroules - jake.petrou...@qt.io
The Qt Company - Silicon Valley
Qbs build tool evangelist - qbs.io

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


[Interest] Building Qt from source for iOS - make install fails

2016-11-22 Thread bralchenko
Hi,

I was trying to build Qt from source specifically for iOS, I wanted to check 
something. The build succeeds, but make install fails on number of version, I 
tried 5.6.2, 5.7.1 and 5.8. Interesting thing is that errors are different for 
each one. I tried to build and to install without any changes, just source from 
qt.io  first.

I am building in on MacOS 10.12.1, Xcode 8.1 (8B62). 

There are my config parameters:

../qt-everywhere-opensource-src-5.7.1/configure -prefix /opt/Qt-5.7-src -sdk 
iphoneos -xplatform macx-ios-clang -release -nomake examples -nomake tests
 
They are the same for all my attempt except of directories’ names.

make install error on 5.6.2:

/Users/boris/Projects/ICS/Qt_5-6.2/qt-everywhere-opensource-src-5.6.2/qtconnectivity/src/bluetooth/osx/osxbtledeviceinquiry.mm:207:33:
 error: cannot initialize a variable of type 'const CBCentralManagerState' with 
an rvalue of type 'CBManagerState'
const CBCentralManagerState cbState(central.state);
^   ~
1 error generated.
make[3]: *** [.obj/osxbtledeviceinquiry.o] Error 1
make[2]: *** [sub-bluetooth-install_subtargets] Error 2
make[1]: *** [sub-src-install_subtargets] Error 2
make: *** [module-qtconnectivity-install_subtargets] Error 2

make install error on 5.7.1:


Check dependencies
No profiles for 'com..qtplugininfo' were found: Xcode couldn't find a 
provisioning profile matching 'com.7071973Canada.qtplugininfo'.
Code signing is required for product type 'Application' in SDK 'iOS 10.1'

** INSTALL FAILED **


Any ideas or suggestions will be much appreciated.

Regards,
Boris Ralchenko.





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


Re: [Interest] camera APIs -- intended usage

2016-11-22 Thread Jason H

The viewfinder corresponds to the screen size, the full-capture corresponds to the CCD, or what you have the CCD configured to capture. The AVFoundation API on iOS has support for capturing frames and resizing them to requested sizes for various consumers. You're probably seeing something related to that. It's probably giving you the highest resolution requested.

 

When I capture the "preview" image in QML, it is sized accordingly. 

 

Sent: Monday, November 21, 2016 at 8:29 PM
From: "Tyler Daniel" 
To: interest@qt-project.org
Subject: [Interest] camera APIs -- intended usage


Hi all, I recently posted this in the forums, where it was suggested that I ask my questions here.  Sorry if this is a duplicate for someone.
 


I'm building an iOS camera app and need the viewfinder/preview frames in c++-land. I also need full-resolution still images when a capture button is pressed.

I can subclass QAbstractSurface and use QCamera::setViewfinder() to get frames. The problem is that the frames I get for the preview are the same resolution as the still images. I'm testing on an iPhone 5, so I either get 3264 or 1920, let's say 3k or 2k.

I'm using QCamera and QCameraImageCapture in c++ code.

If I use QCameraImageCapture::setEncodingSettings with 3k and QCamera::setViewfinderSettings with 2k, I get 3k preview frames and 3k still images.

I would have thought that the viewfinder api affects the viewfinder resolution and the camera image capture affects a separate still image capture resolution. But this is not the behavior I'm seeing.

Each of these classes are documented in the doxygen sense, but intended usage and how they work together is not.  The closest I can find is the detailed description of QCameraImageCapture, which provides a nice code snippet, but… resolution problems.

Pretty much all smartphones and digital cameras show a lower-resolution preview and capture stills at a higher resolution.

My question is how to achieve this with iOS? What should work? How do I get 2k preview frames in c++ and 3k still captures?

I’ve looked at the example apps.  They work on iOS in the sense that they don't crash, but they exhibit the same behavior with previews and stills at the same resolution. 

I’m currently working with 5.7 and 5.8 beta, but honestly I’ve had problems with the camera apis for years now.  On Android I hacked something that worked with QVideoProbe, but only for Android.  On iOS I gave up and went native.  Never found a solution that worked for more than one platform.

 

Any help would be most appreciated!

 

Tyler

 

___ 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] [5.8] how to use qml caching?

2016-11-22 Thread Shawn Rutledge

> On 11 Nov 2016, at 10:53, Tim Blechmann  wrote:
> 
> hi all,
> 
> i've read a lot about qml caching in qt-5.8. however i didn't find any
> documentation on how to use it.
> 
> is there any documentation on how we can use it from a cmake
> buildsystem? i suppose somehow the qrc files need to be pre-processed to
> generate the qmlc/jsc files?

They are created when you run the application.  It’s analogous to Python’s pyc 
files: just a cache of the compiled source file, which will make it load faster 
the second time.  On different OSes there are different storage locations. 

The Qt commercial compiler is different - in that case you do pre-compile.

(Disclaimer: I’m telling what I remember from this session:  
https://conf.qtcon.org/en/qtcon/public/events/430 and I don’t think there is 
video from that one)

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