Re: [Interest] QML animation flickering on Ubuntu
On Tuesday 13 January 2015 17:02:40 Dmitry Volosnykh wrote: I've tried to capture the issue: see http://youtu.be/KUNyk2YWBaY The flickering is more obvious in this video since capturing software affecting performance. When running application with no video recording there's no visual artifacts for about 15 seconds. Then the top of the green bar visually looks like be shifted leftwards by a small offset which holds on form the moment of its appearance. The height of this 'cap' may slightly increase over time. This issue reproduces constantly. Sounds like a lack of v-sync is causing tearing and over time the offset between the swapbuffers and screen refresh is changing. Is your monitor running at a standard refresh rate? Try forcing vsync in the control panel for your graphics card driver. At least nVidia provide an option for this. I'm not sure about AMD and Intel. Cheers, Sean -- Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK Klarälvdalens Datakonsult AB, a KDAB Group company Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322) KDAB - Qt Experts - Platform-independent software solutions ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] QML animation flickering on Ubuntu
Can something further be done to avoid flickering? If you are just translating the item by changing the X value, try using the XAnimator (http://doc.qt.io/qt-5/qml-qtquick-xanimator.html). It performs the movement on the render thread instead of the gui thread. I have experienced big performance gains when using the animators over the animations. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] QML animation flickering on Ubuntu
Keith, thank you for your suggestion. At least I've missed this feature in several places: The value of the QML property will be updated after the animation has finished. The property is not updated while the animation is running. Alas, it did not solve my issue. Honestly speaking, I did not believe it may help, because with animations I had the following rendering table (obtained after parsing qmlscene's output with QSG_RENDER_TIMING=1 set): $ grep 'rendered' ubuntu12.02_5.4.log | egrep -o '[0-9]+ms' | sort -n | uniq -c 7 0ms 2 1ms 1 4ms 1 5ms 2 7ms 1 8ms 1 9ms 3 10ms 2 11ms 3 12ms 7 13ms 15 14ms 131 15ms 791 16ms 218 17ms 43 18ms 12 19ms 4 20ms 4 21ms 1 23ms 1 24ms 1 27ms 1 29ms 4 33ms 2 38ms 1 45ms So, most of the frames are rendered within 16 ms time frame provided. I am getting more inclined to the idea that it is not Qt-related issue. Something with my system, drivers, etc. On Tue, Jan 13, 2015 at 8:21 PM, Keith Gardner kreios4...@gmail.com wrote: Can something further be done to avoid flickering? If you are just translating the item by changing the X value, try using the XAnimator (http://doc.qt.io/qt-5/qml-qtquick-xanimator.html). It performs the movement on the render thread instead of the gui thread. I have experienced big performance gains when using the animators over the animations. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Best practices for making a Qt facade for a C library
Hi Dmitriy, Wanted to ask if your stuff is open source and is available on github? 2015-01-14 0:26 GMT+01:00 Ian Monroe i...@monroe.nu: On Tue, Jan 13, 2015 at 10:57 AM, Dmitriy Purgin dpur...@gmail.com wrote: Hello all, I'm developing a small Qt project for SailfishOS (a Linux distribution, Meego descendant, Qt 5 based) and had to use some of PulseAudio (a sound server for POSIX OSes) API functions which are pure C. I've wrapped them in a couple of classes but it's evolving to something bigger now and I'm trying to detach these into a shared library which seems to become a basic PulseAudio binding. It's my first facading of a C library and I'm kind of stuck on the architecture now and hope that someone can share ideas on that. Have you looked at the code generation done by QtGstreamer for glib stuff? Not sure if it's any good, just want to make sure you know of it: http://cgit.freedesktop.org/gstreamer/qt-gstreamer/tree/ So with the problem stated, my question is: does anyone know any good practices in designing this kind of relationships between classes or can share similar designs to look at? There's no technical problem for me to expose the inner parts of some classes to some other classes, I just wondered if there's a subtle way of doing this. I wrap a C library and had a similar situation. My solution in this case would be to give QtPulseAudioSource a new base class named something like PulseAudioInterface. That class defines pa_context, it could possibly just be a void pointer. It has a member variable for it and a setPulseAudioContext method. Then QtPulseAudioContext would have a class called something likeblessPulseAudioInterface. QtPulseAudioSource could call it in its constructor. In this way it is pretty hidden from users of the library, and QtPulseAudioContext has zero deps on AudioSource. Ian ___ 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] QML animation flickering on Ubuntu
Well, I've searched for this variable, and for tearing issues on Ubuntu with NVidia adapters. There are multiple reports and many solutions provided. At least I know the direction for further investigations. Thank you, Sean. On Tue, Jan 13, 2015 at 10:21 PM, Sean Harmer sean.har...@kdab.com wrote: On Tuesday 13 January 2015 23:06:40 Dmitry Volosnykh wrote: Sean, thanks for your input. I have NVidia GeForce 9800M GTX, and VSync is enabled. Double-checked that. Another enabled options: Allow Flipping and Use Conformant Texture Clamping. Do not know what are they for... Regarding your question about monitor's refresh rate. Here is xrandr's output: $ xrandr Screen 0: minimum 8 x 8, current 1680 x 1050, maximum 8192 x 8192 DVI-D-0 disconnected (normal left inverted right x axis y axis) LVDS-0 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 331mm x 207mm 1680x1050 59.9*+ DVI-D-1 disconnected (normal left inverted right x axis y axis) HDMI-0 disconnected (normal left inverted right x axis y axis) I guess, it means runs on 60Hz refresh rate. Hmm OK if that didn't work, can you try this trick. Try setting export __GL_YIELD=USLEEP for your X environment. I have this set in /etc/profile.d/tearing.sh on Gentoo. Not sure where the correct place is on Ubuntu. If this is set when X starts this solves the tearing for me on nVidia when using a compositing window manager. Cheers, Sean On Tue, Jan 13, 2015 at 9:35 PM, Sean Harmer sean.har...@kdab.com wrote: On Tuesday 13 January 2015 17:02:40 Dmitry Volosnykh wrote: I've tried to capture the issue: see http://youtu.be/KUNyk2YWBaY The flickering is more obvious in this video since capturing software affecting performance. When running application with no video recording there's no visual artifacts for about 15 seconds. Then the top of the green bar visually looks like be shifted leftwards by a small offset which holds on form the moment of its appearance. The height of this 'cap' may slightly increase over time. This issue reproduces constantly. Sounds like a lack of v-sync is causing tearing and over time the offset between the swapbuffers and screen refresh is changing. Is your monitor running at a standard refresh rate? Try forcing vsync in the control panel for your graphics card driver. At least nVidia provide an option for this. I'm not sure about AMD and Intel. Cheers, Sean -- Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK Klarälvdalens Datakonsult AB, a KDAB Group company Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322) KDAB - Qt Experts - Platform-independent software solutions ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest -- Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK Klarälvdalens Datakonsult AB, a KDAB Group company Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322) KDAB - Qt Experts - Platform-independent software solutions ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] Best practices for making a Qt facade for a C library
Hello all, I'm developing a small Qt project for SailfishOS (a Linux distribution, Meego descendant, Qt 5 based) and had to use some of PulseAudio (a sound server for POSIX OSes) API functions which are pure C. I've wrapped them in a couple of classes but it's evolving to something bigger now and I'm trying to detach these into a shared library which seems to become a basic PulseAudio binding. It's my first facading of a C library and I'm kind of stuck on the architecture now and hope that someone can share ideas on that. Obviously, I'm looking forward to encapsulate all the C code in my library and provide library users with Qt-style classes, signals and slots, thus eliminating libpulse dependency for them. My basic architecture is quite simple: for the Qt classes I use d-pointers containing relevant PulseAudio data and static methods to use for PulseAudio callbacks which are called for any kind of events. To emit Qt signals upon PulseAudio events I use q-pointers in these static methods. So this goes like this: // in pseudocode suspiciously resembling C++ class QtPulseAudioContext : public QObject { ... signals: void connected(); private: QtPulseAudioContextPrivate* d; }; class QPulseAudioContextPrivate { pa_context* paContext; // PulseAudio C data QtPulseAudioContext* q; // callback for PulseAudio event static void onContextCallback(..., void* userData) { QtPulseAudioContextPrivate* d = reinterpret_cast QtPulseAudioContextPrivate* (userData); // processed an event from PulseAudio, redo it Qt style emit d-q-connected(); } }; As for now I'm dealing with three PulseAudio objects: context representing connection to PulseAudio server, sinks representing audio outputs and sources representing audio inputs. Naturally, I've wrapped them as three separate classes. Both sinks and sources operate within single context and any PulseAudio API call involving sinks and sources must provide the corresponding context. When these classes were bundled in my application, I've passed PulseAudio's pa_context* to a ctor of my class, used it internally and was pretty happy with that: // in pseudocode suspiciously resembling C++ class QtPulseAudioContext { QtPulseAudioSource* getSource(...); }; QtPulseAudioSource* QtPulseAudioContext::getSource(...) { ... new QtPulseAudioSource(d-paContext); ... } class QtPulseAudioSource { QtPulseAudioSource(pa_context* context); // pa_context is PulseAudio stuff // the implementation of the following would need to call // PulseAudio API and use pa_context void setDefaultPort(const QString name); }; Now passing pa_context is a no-go since it exposes PulseAudio dependency to a library user. So my first call is to somehow provide QtPulseAudioContext's private data to a source or sink constructors or even construct their private data in QtPulseAudioContext. I don't think any of both is a good way. The former violates the incapsulation of QtPulseAudioContext, the latter moves initialization of a private data outside the class that owns this data. So with the problem stated, my question is: does anyone know any good practices in designing this kind of relationships between classes or can share similar designs to look at? There's no technical problem for me to expose the inner parts of some classes to some other classes, I just wondered if there's a subtle way of doing this. Thanks in advance. Best regards, Dmitriy ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] QML animation flickering on Ubuntu
Sean, thanks for your input. I have NVidia GeForce 9800M GTX, and VSync is enabled. Double-checked that. Another enabled options: Allow Flipping and Use Conformant Texture Clamping. Do not know what are they for... Regarding your question about monitor's refresh rate. Here is xrandr's output: $ xrandr Screen 0: minimum 8 x 8, current 1680 x 1050, maximum 8192 x 8192 DVI-D-0 disconnected (normal left inverted right x axis y axis) LVDS-0 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 331mm x 207mm 1680x1050 59.9*+ DVI-D-1 disconnected (normal left inverted right x axis y axis) HDMI-0 disconnected (normal left inverted right x axis y axis) I guess, it means runs on 60Hz refresh rate. On Tue, Jan 13, 2015 at 9:35 PM, Sean Harmer sean.har...@kdab.com wrote: On Tuesday 13 January 2015 17:02:40 Dmitry Volosnykh wrote: I've tried to capture the issue: see http://youtu.be/KUNyk2YWBaY The flickering is more obvious in this video since capturing software affecting performance. When running application with no video recording there's no visual artifacts for about 15 seconds. Then the top of the green bar visually looks like be shifted leftwards by a small offset which holds on form the moment of its appearance. The height of this 'cap' may slightly increase over time. This issue reproduces constantly. Sounds like a lack of v-sync is causing tearing and over time the offset between the swapbuffers and screen refresh is changing. Is your monitor running at a standard refresh rate? Try forcing vsync in the control panel for your graphics card driver. At least nVidia provide an option for this. I'm not sure about AMD and Intel. Cheers, Sean -- Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK Klarälvdalens Datakonsult AB, a KDAB Group company Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322) KDAB - Qt Experts - Platform-independent software solutions ___ 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] Revert the selection in a QTreeView
Glenn wrote: Sent: Wednesday, 14 January 2015 8:45 AM Hi, In a QTreeView how can I revert the selection? The behaviour I want is that when the user selects an item, then based on some other state, it will either accept the selection or message the user and revert to the previous selection. The currentChanged method gives me the QModelIndex of the previous selection so I can use treeview.setCurrentIndex to set it to the previous index, but this causes recursion. I guess I could use a flag to prevent the recursion, but I'm wondering if there is a better way to get the same behaviour. Hi Glenn, Don't worry - you'll probably end up with several of these 'prevent recursion' flags for your slots! Note: in Qt 4 there is a bug where calling setCurrentItem in the currentIitemChanged slot after a mouse click may cause all of the items in between to be selected - at least in does in QListView! The solution was to save the previous item, and use QTimer.singleShot( 0, ... ) to a slot that does setCurrentItem on the saved value. Unfortunately, the Qt API doesn't have an interface that allows you to trap the change in selection regardless of the cause. I have recently tried overriding keyboardSearch, moveCursor and mousePressEvent to force the validation before the selection is changed. A similar problem occurs when you need to validate a page in a tab widget before the tab changes. Good Luck! ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Bluetooth Low Energy on Windows: Options and feasabilty of implementing own backend
I can choose to „Add Bluetooth devices“ in the menu of that icon but the scan does neither show my peripheral nor my TVBluetooth This means that your demo FW has errors in its implementation. Windows support BLE stack according to specification, so, maybe your FW uses wrong states or handshake sequence and so on. BR, Denis 2015-01-13 1:28 GMT+03:00 Axel Jäger axeljae...@googlemail.com: Hello Denis, Hello Alex, thank you for your help, here is a description of my setup: Bluetooth peripheral: I use a BLE112-Bluetooth-Module from bluegiga. It is programmed with a demo firmware that implements a Heart Rate service. I added one line to the initalisation of the firmware: sm_set_bondable_mode which enables bonding. Windows Phone I use a Nokia Lumia 930. After a software update yesterday evening, I can see and pair to my bluegiga heart rate demo now. Also, I see a second device called TVBluetooth. I cannot pair to that device. Windows 8.1 Desktop I use a desktop PC with a bluetooth 4.0 dongle that looks like this one: http://i01.i.aliimg.com/wsphoto/v0/1680100575_1/Mini-font-b-Bluetooth-b-font-V4-0-USB-font-b-Bluetooth-b-font-font-b.jpg Windows is successfully installing a driver and shows the bluetooth icon in the system tray. I can choose to „Add Bluetooth devices“ in the menu of that icon but the scan does neither show my peripheral nor my TVBluetooth I also tried an example project from Microsoft that also cannot find any peripheral. This is no surprise because the application tells me to first pair my device. For me it looks like my Windows/Desktop does not care for bluetooth LE at all. Best regards, Axel *Von:* Denis Shienkov [mailto:denis.shien...@gmail.com] *Gesendet:* Montag, 12. Januar 2015 10:14 *An:* Blasche Alexander *Cc:* Axel Jäger; interest@qt-project.org *Betreff:* Re: [Interest] Bluetooth Low Energy on Windows: Options and feasabilty of implementing own backend Hi all, So far, I was not able to communicate with a custom BLE peripheral using either Windows Phone 8.1 or Windows 8.1 on a desktop. Hmm, it is strange. Can you please describe your steps and your env? Maybe your custom BLE peripheral chip has wrong firmware. I'm too faced earlier with a similar situation when a BLE peripheral works on Max/Linux, but does not works on Windows 8.1 Desktop (the reason was in a wrong FW). BR, Denis 2015-01-12 12:01 GMT+03:00 Blasche Alexander alexander.blas...@theqtcompany.com: How do you define a custom BLE peripheral (aka what BLE devices work and which don't) on Win 8.1? Is it one that is not defined by some well known service or characteristic UUID? -- Alex -- *From:* Axel Jäger axeljae...@googlemail.com *Sent:* Sunday, January 11, 2015 22:35 *To:* Blasche Alexander; interest@qt-project.org *Subject:* AW: [Interest] Bluetooth Low Energy on Windows: Options and feasabilty of implementing own backend Hello Alex, thank you for your answer. So if there is someone working on a port of windows, time might be my friend and I might start on my mac using 5.5. However, in the meantime I found out that the implementation of Bluetooth LE on Windows behaves differently regarding the need to bond and pair devices. So far, I was not able to communicate with a custom BLE peripheral using either Windows Phone 8.1 or Windows 8.1 on a desktop. I guess an implementation of the Qt Bluetooth LE API will inherit this behaviour. If this is case and currently I guess it is the case, I better go with the bluegiga SDK directly. Best regards, Axel *Von:* interest-bounces+axeljaeger=googlemail@qt-project.org [mailto: interest-bounces+axeljaeger=googlemail@qt-project.org] *Im Auftrag von *Blasche Alexander *Gesendet:* Mittwoch, 7. Januar 2015 09:28 *An:* interest@qt-project.org *Betreff:* Re: [Interest] Bluetooth Low Energy on Windows: Options and feasabilty of implementing own backend Hi Axel, Your assumption about 5.5 is correct. Android gets LE support and ios/OSX get classic and LE support. Windows is currently work in progress. There is a wip/win branch on codereview. The windows port is mostly community driven at this stage which makes prediction somewhat hard. Ccurrently, you can find devices and I believe the initial connect to a BTLE device is somewhat done. This is done for classic desktop windows (which would cover win 8.1). There is no WinRT code at this stage. to your questions: 1.) I am confident Windows should have no unfixable problems. In many cases it is better than ios/OSX/Android when it comes to LE. I cannot say much about WinRT. 2.) I am not the WinRT expert but I was told in some cases it works in other's it doesn't. QtPositioning apparantly couldn't use RT on desktop. Qt doesn't mix desktop and RT and I got the feeling that the responsiple devs would like to keep it that way. 3.) The
Re: [Interest] How can I use QPointer as an argument?
Den 13-01-2015 kl. 04:13 skrev Guenther Boelter: I have a 'small' problem and my timeline is running so fast ... How can I use QPointer as an argument? A simple void myFunction( QPointer *myPointer ) { // do something } myFunction( myPointer ); returns 'error: ‘QPointer’ is not a type'. You don't need to copy the QPointer. A QPointer is a weak pointer class. It is told by the object it holds, if it's deleted, and then switch to a null pointer. So in your case, you simply give the object it holds to your function instead. If you want to, you can create a QPointer in your function. void myFunction(QObject* o) { QPointer p(o); // do something } QPointer p(theRealObject); myFunction(p.data()); I hope this helps. Bo. -- Viking Software Qt and C++ developers for hire http://www.vikingsoft.eu ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Bluetooth Low Energy on Windows: Options and feasabilty of implementing own backend
Windows is successfully installing a driver and shows the bluetooth icon in the system tray. For me it looks like my Windows/Desktop does not care for bluetooth LE at all. Make sure that your DeviceManager has Bluetooth *LE* enumerator device. 2015-01-13 14:25 GMT+03:00 Denis Shienkov denis.shien...@gmail.com: I can choose to „Add Bluetooth devices“ in the menu of that icon but the scan does neither show my peripheral nor my TVBluetooth This means that your demo FW has errors in its implementation. Windows support BLE stack according to specification, so, maybe your FW uses wrong states or handshake sequence and so on. BR, Denis 2015-01-13 1:28 GMT+03:00 Axel Jäger axeljae...@googlemail.com: Hello Denis, Hello Alex, thank you for your help, here is a description of my setup: Bluetooth peripheral: I use a BLE112-Bluetooth-Module from bluegiga. It is programmed with a demo firmware that implements a Heart Rate service. I added one line to the initalisation of the firmware: sm_set_bondable_mode which enables bonding. Windows Phone I use a Nokia Lumia 930. After a software update yesterday evening, I can see and pair to my bluegiga heart rate demo now. Also, I see a second device called TVBluetooth. I cannot pair to that device. Windows 8.1 Desktop I use a desktop PC with a bluetooth 4.0 dongle that looks like this one: http://i01.i.aliimg.com/wsphoto/v0/1680100575_1/Mini-font-b-Bluetooth-b-font-V4-0-USB-font-b-Bluetooth-b-font-font-b.jpg Windows is successfully installing a driver and shows the bluetooth icon in the system tray. I can choose to „Add Bluetooth devices“ in the menu of that icon but the scan does neither show my peripheral nor my TVBluetooth I also tried an example project from Microsoft that also cannot find any peripheral. This is no surprise because the application tells me to first pair my device. For me it looks like my Windows/Desktop does not care for bluetooth LE at all. Best regards, Axel *Von:* Denis Shienkov [mailto:denis.shien...@gmail.com] *Gesendet:* Montag, 12. Januar 2015 10:14 *An:* Blasche Alexander *Cc:* Axel Jäger; interest@qt-project.org *Betreff:* Re: [Interest] Bluetooth Low Energy on Windows: Options and feasabilty of implementing own backend Hi all, So far, I was not able to communicate with a custom BLE peripheral using either Windows Phone 8.1 or Windows 8.1 on a desktop. Hmm, it is strange. Can you please describe your steps and your env? Maybe your custom BLE peripheral chip has wrong firmware. I'm too faced earlier with a similar situation when a BLE peripheral works on Max/Linux, but does not works on Windows 8.1 Desktop (the reason was in a wrong FW). BR, Denis 2015-01-12 12:01 GMT+03:00 Blasche Alexander alexander.blas...@theqtcompany.com: How do you define a custom BLE peripheral (aka what BLE devices work and which don't) on Win 8.1? Is it one that is not defined by some well known service or characteristic UUID? -- Alex -- *From:* Axel Jäger axeljae...@googlemail.com *Sent:* Sunday, January 11, 2015 22:35 *To:* Blasche Alexander; interest@qt-project.org *Subject:* AW: [Interest] Bluetooth Low Energy on Windows: Options and feasabilty of implementing own backend Hello Alex, thank you for your answer. So if there is someone working on a port of windows, time might be my friend and I might start on my mac using 5.5. However, in the meantime I found out that the implementation of Bluetooth LE on Windows behaves differently regarding the need to bond and pair devices. So far, I was not able to communicate with a custom BLE peripheral using either Windows Phone 8.1 or Windows 8.1 on a desktop. I guess an implementation of the Qt Bluetooth LE API will inherit this behaviour. If this is case and currently I guess it is the case, I better go with the bluegiga SDK directly. Best regards, Axel *Von:* interest-bounces+axeljaeger=googlemail@qt-project.org [mailto: interest-bounces+axeljaeger=googlemail@qt-project.org] *Im Auftrag von *Blasche Alexander *Gesendet:* Mittwoch, 7. Januar 2015 09:28 *An:* interest@qt-project.org *Betreff:* Re: [Interest] Bluetooth Low Energy on Windows: Options and feasabilty of implementing own backend Hi Axel, Your assumption about 5.5 is correct. Android gets LE support and ios/OSX get classic and LE support. Windows is currently work in progress. There is a wip/win branch on codereview. The windows port is mostly community driven at this stage which makes prediction somewhat hard. Ccurrently, you can find devices and I believe the initial connect to a BTLE device is somewhat done. This is done for classic desktop windows (which would cover win 8.1). There is no WinRT code at this stage. to your questions: 1.) I am confident Windows should have no unfixable problems. In many cases it is better than ios/OSX/Android when it
[Interest] QML animation flickering on Ubuntu
I've tried to capture the issue: see http://youtu.be/KUNyk2YWBaY The flickering is more obvious in this video since capturing software affecting performance. When running application with no video recording there's no visual artifacts for about 15 seconds. Then the top of the green bar visually looks like be shifted leftwards by a small offset which holds on form the moment of its appearance. The height of this 'cap' may slightly increase over time. This issue reproduces constantly. Previously, I was facing an issue with totally jerky animations which was solved by updating video drivers to the most recent version. I do not experience such problems on Mac OS X 10.10. However, there is some flickering on Windows 7, but less noticeable. Can something further be done to avoid flickering? PS. Here is the example application I run. You have to press spacebar to launch animation. import QtQuick 2.0 Rectangle { id: root width: 800 height: 600 color: black focus: true Rectangle { id: rect width: 150 height: parent.height color: seagreen visible: animation.running NumberAnimation on x { id: animation from: -rect.width to: root.width loops: Animation.Infinite duration: 4000 running: false } } Keys.onSpacePressed: animation.running = true } Regards, Dmitry. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] How can I use QPointer as an argument?
Guenther Boelter schreef op 13-1-2015 om 04:13: Sorrry, I have a 'small' problem and my timeline is running so fast ... How can I use QPointer as an argument? A simple void myFunction( QPointer *myPointer ) { // do something } myFunction( myPointer ); returns 'error: ‘QPointer’ is not a type'. Thanks in advance and best regards As Constatin already stated: QPointer on its own does not exist. What I am wondering though, is why you feel the need to pass a _pointer_to_ a QPointer as an argument to myFunction? QPointer is a smart-pointer: it acts as a normal pointer, and then provides some other cleverness. In this case, the cleverness provided is that it automatically resets to 0 if the QObject you point to is deleted, so it can't become a dangling pointer. Passing a QPointer* is possible of course, but probably not what you wanted to do. Smart pointers are small enough to just copy as values. A valid use case for passing a QPointerMyClass* is if you are really passing an array of QPointers, though I'd probably go for another solution like a QVectorQPointerMyClass then. André ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Revert the selection in a QTreeView
On 13 Jan 2015, at 22:45, Glenn Ramsey g...@componic.co.nz wrote: Hi, In a QTreeView how can I revert the selection? The behaviour I want is that when the user selects an item, then based on some other state, it will either accept the selection or message the user and revert to the previous selection. Have you considered simply disabling such items? Then there's no need to revert anything or show annoying error messages. :) -- J-P Nurmi ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] Revert the selection in a QTreeView
Hi, In a QTreeView how can I revert the selection? The behaviour I want is that when the user selects an item, then based on some other state, it will either accept the selection or message the user and revert to the previous selection. The currentChanged method gives me the QModelIndex of the previous selection so I can use treeview.setCurrentIndex to set it to the previous index, but this causes recursion. I guess I could use a flag to prevent the recursion, but I'm wondering if there is a better way to get the same behaviour. Glenn ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Revert the selection in a QTreeView
On 14/01/15 11:50, Nurmi J-P wrote: On 13 Jan 2015, at 22:45, Glenn Ramsey g...@componic.co.nz wrote: Hi, In a QTreeView how can I revert the selection? The behaviour I want is that when the user selects an item, then based on some other state, it will either accept the selection or message the user and revert to the previous selection. Have you considered simply disabling such items? Then there's no need to revert anything or show annoying error messages. :) Yes, that might be the right solution. On the other hand, I'm not the interface designer. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Best practices for making a Qt facade for a C library
On Tue, Jan 13, 2015 at 10:57 AM, Dmitriy Purgin dpur...@gmail.com wrote: Hello all, I'm developing a small Qt project for SailfishOS (a Linux distribution, Meego descendant, Qt 5 based) and had to use some of PulseAudio (a sound server for POSIX OSes) API functions which are pure C. I've wrapped them in a couple of classes but it's evolving to something bigger now and I'm trying to detach these into a shared library which seems to become a basic PulseAudio binding. It's my first facading of a C library and I'm kind of stuck on the architecture now and hope that someone can share ideas on that. Have you looked at the code generation done by QtGstreamer for glib stuff? Not sure if it's any good, just want to make sure you know of it: http://cgit.freedesktop.org/gstreamer/qt-gstreamer/tree/ So with the problem stated, my question is: does anyone know any good practices in designing this kind of relationships between classes or can share similar designs to look at? There's no technical problem for me to expose the inner parts of some classes to some other classes, I just wondered if there's a subtle way of doing this. I wrap a C library and had a similar situation. My solution in this case would be to give QtPulseAudioSource a new base class named something like PulseAudioInterface. That class defines pa_context, it could possibly just be a void pointer. It has a member variable for it and a setPulseAudioContext method. Then QtPulseAudioContext would have a class called something likeblessPulseAudioInterface. QtPulseAudioSource could call it in its constructor. In this way it is pretty hidden from users of the library, and QtPulseAudioContext has zero deps on AudioSource. Ian ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest