Results 1 to 7 of 7

Thread: QML won't save camera settings

  1. #1
    Join Date
    Feb 2015
    Posts
    4
    Qt products
    Qt5

    Question QML won't save camera settings

    Hi all,

    I am using Qt5.2.1 (GCC 4.8, armeabi-v7a) at Windows8.1(x64) and a Samsung Galaxy S4 Mini with Android 4.2.2.

    I tried to compile the qml example "qdeclarative-camera" and it worked to start the app with the smartphone and save images.

    I tried also to modify the source to test some settings like changing exposuretime, iso, focus, contrast, etc.

    Whatever I tried to change - contrast, iso or saturation - nothing happened.

    What states or status do the camera should have to save the settings? Does it need to be stopped? Does it need a special captureMode? Are the settings reset by the function searchAndLock? Is it a bug at Qt5.2.1? Is Samsung blocking such functions? Do I need special variables in the pro-file like MOBILITY or TARGET.CAPABILITY?

    It's very annoying, that I can't find any hint to solve the problem on my own.

    Any hint is appreciated.

    Greetings,
    Pixtar

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QML won't save camera settings

    What do you mean by "save the settings"? save them where?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2015
    Posts
    4
    Qt products
    Qt5

    Default Re: QML won't save camera settings

    Quote Originally Posted by wysota View Post
    What do you mean by "save the settings"? save them where?
    I mean the simple fact, when I'm using i.e. this little snippet:
    Qt Code:
    1. camera.imageProcessing.saturation = 1
    2. console.debug( camera.imageProcessing.saturation )
    To copy to clipboard, switch view to plain text mode 
    The output is 0 instead of 1.

    I'm facing this problem with all settings:
    Qt Code:
    1. camera.imageProcessing.contrast = 1
    2. console.debug( camera.imageProcessing.contrast)
    To copy to clipboard, switch view to plain text mode 
    The output is 0 instead of 1.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QML won't save camera settings

    Have you tried setting the values by declaring them directly in the QML document?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Feb 2015
    Posts
    4
    Qt products
    Qt5

    Default Re: QML won't save camera settings

    Wysota I don't know exactly what you mean, but I've tried the following:

    Qt Code:
    1. Item{
    2. Camera {
    3. id: camera
    4. imageProcessing.saturation: 1.0
    5. imageProcessing.contrast: 1.0
    6. ....
    7.  
    8. imageCapture {
    9. onImageSaved: {
    10. console.debug( camera.imageProcessing.contrast )
    11. }
    12. }
    13. }
    14. }
    To copy to clipboard, switch view to plain text mode 

    I also tried it with a gui element:
    Qt Code:
    1. Rectangle{
    2. property Camera camera
    3. id: mainRectangle
    4. Slider{
    5. id: contrastSpin
    6. minimumValue: -10.0
    7. maximumValue: 10.0
    8. value: 1
    9. stepSize: 1
    10. onValueChanged: {
    11. camera.imageProcessing.contrast = value/10.0
    12. }
    13. }
    14. }
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QML won't save camera settings

    Maybe your camera simply does not allow modifying those values. At least the first approach should have worked otherwise.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Feb 2015
    Posts
    4
    Qt products
    Qt5

    Default Re: QML won't save camera settings

    For integrity here the main.cpp:
    Qt Code:
    1. #include <QGuiApplication>
    2. #include <QQmlComponent>
    3. #include <QQmlContext>
    4. #include <QObject>
    5. #include <QQuickItem>
    6. #include <QQuickView>
    7. #include <QQuickImageProvider>
    8. #include <QVariant>
    9. #include <QCamera>
    10.  
    11. int main( int argc, char *argv[] ){
    12. QGuiApplication app( argc, argv );
    13.  
    14. QQuickView view;
    15.  
    16. view.setResizeMode( QQuickView::SizeRootObjectToView );
    17. view.setSource( QUrl("qrc:///QML/main.qml") );
    18.  
    19. QObject *item = view.rootObject( );
    20.  
    21. view.show( );
    22. return app.exec( );
    23. }
    To copy to clipboard, switch view to plain text mode 

    An here the code for main.qml:
    Qt Code:
    1. import QtQuick 2.2
    2. import QtMultimedia 5.2
    3. import QtQuick.Layouts 1.1
    4. import QtQuick.Controls 1.1
    5. import QtQuick.Dialogs 1.1
    6. import "qrc:///QML"
    7.  
    8. Item {
    9. focus: true
    10. visible: true
    11. id: item
    12. Camera {
    13. id: camera
    14. captureMode: Camera.CaptureStillImage
    15. imageProcessing.saturation: -1.0
    16. imageProcessing.contrast: -1.0
    17. }
    18.  
    19. Rectangle{
    20. id: rectangleImage
    21. visible: true
    22. ColumnLayout{
    23. spacing: 10
    24.  
    25. Button{
    26. id: menuButton
    27. text: "Check Camera"
    28. onClicked: {
    29. camera.imageProcessing.contrast = -1.0
    30. console.debug( camera.imageProcessing.contrast )
    31. }
    32. }
    33.  
    34. VideoOutput {
    35. id: output
    36. source: camera
    37. focus : visible
    38. visible: true
    39. autoOrientation: true
    40.  
    41. anchors.fill: parent
    42.  
    43. x: parent.height > parent.width ? 0 : parent.width/2*2
    44. y: parent.height > parent.width ? parent.height/2*2+5 : 0
    45.  
    46. height: parent.height > parent.width ? parent.height/2 : parent.height/2
    47. width: parent.height > parent.width ? parent.width/2 : parent.width/2
    48. }
    49. }
    50. }
    51. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Save Printer Page Settings to show on next print
    By arunkumaraymuo1 in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2012, 23:16
  2. Save Font settings using QSettings
    By arunkumaraymuo1 in forum Qt Programming
    Replies: 2
    Last Post: 31st July 2012, 13:58
  3. Save application settings
    By sajis997 in forum Qt Programming
    Replies: 4
    Last Post: 9th May 2012, 04:54
  4. Replies: 2
    Last Post: 16th July 2011, 07:53
  5. Can we save & load the settings in GUI !
    By Krish in forum Newbie
    Replies: 6
    Last Post: 26th March 2008, 15:33

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.