Re: [Interest] Windows VST plugin based on Qt

2015-05-19 Thread Tony Rietwyk
Hi Nuno, 

I strongly suggest to download Dependency Walker utility, and use that to 
test loading your DLL on Windows.  

Also, there are dozens of VST examples available, maybe you start with one that 
works, then extend it with Qt or whatever. 

Regards, 

Tony

 Sent: Tuesday, 19 May 2015 4:27 PM
 
 Hi,
 
 I�m trying to build a VST plugin based on Qt.
 
 A VST plugin is a framework for creating audio processing and instrument
 plugins. It provides an api that one should follows. The result is a dynamic
 library that will be loaded by the host (dll on windows case, bundle on mac
 case). I have done it successfully on Mac (with still a lot of tests to 
 perform
 and the need for correct deploy) and now i�m trying on Windows.
 
 On Windows i�m being faced with some dll loading problems.
 
 If I build the plugin without link Qt at all (CONFIG -= qt), the plugin is
 recognized by the host. Otherwise it isn�t. I want to use Qt, specially QML 
 for
 UI. There are simpler ways of doing this, but I love Qt and I want my code to
 be the most transversal as possible.
 
 I have been suggested that this problems is due to the loading path of the
 libraries. I suggested solution relies in using /DELAYLOAD
 
 I have tried to perform /DELAYLOAD:Qt5Core.dll and the other three libs
 started by icu, and then using the SetDllDirectory to the path I have the
 deployed plugin.
 
 Still, the host is unable to load the plugin correctly.
 
 Can someone give me an insight on how to do this on windows?
 
 Thanks,
 
 Regards,
 
 Nuno


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


[Interest] Windows VST plugin based on Qt

2015-05-19 Thread Nuno Santos
Hi,

I’m trying to build a VST plugin based on Qt.

A VST plugin is a framework for creating audio processing and instrument 
plugins. It provides an api that one should follows. The result is a dynamic 
library that will be loaded by the host (dll on windows case, bundle on mac 
case). I have done it successfully on Mac (with still a lot of tests to perform 
and the need for correct deploy) and now i’m trying on Windows.

On Windows i’m being faced with some dll loading problems. 

If I build the plugin without link Qt at all (CONFIG -= qt), the plugin is 
recognized by the host. Otherwise it isn’t. I want to use Qt, specially QML for 
UI. There are simpler ways of doing this, but I love Qt and I want my code to 
be the most transversal as possible.

I have been suggested that this problems is due to the loading path of the 
libraries. I suggested solution relies in using /DELAYLOAD

I have tried to perform /DELAYLOAD:Qt5Core.dll and the other three libs started 
by icu, and then using the SetDllDirectory to the path I have the deployed 
plugin.

Still, the host is unable to load the plugin correctly.

Can someone give me an insight on how to do this on windows?

Thanks,

Regards,

Nuno


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


Re: [Interest] Windows VST plugin based on Qt

2015-05-19 Thread Kalinowski Maurice
Creating a VST is certainly possible, though you will need to do some extra 
steps.

a) you need an application object created inside your plugin. The easiest to do 
so is to create a new thread (when the first instance is created or even on 
show(), not during plugins loading), which will initialize everything, 
otherwise you will get into troubles due to two different event loops 
interfering each other.
b) Be careful  about multiple instances, you will need to handle this properly 
(Q(Core)Application is singleton, so check for existence
c) Try to not interfere with other VST plugins which might use Qt as well, 
potentially a different version even. Then the order of plugins loaded might 
make things fall apart. One step to take care of this is to namespace your Qt 
build
d) as a start you can put Qt libraries and plugins also into your VST folder, 
the host will load a bit slower but for testing that is ok. Later you might 
want to use manifests or static linking. Another option would be to create a 
thin layer, which then loads your plugin from another location where you have 
arranged all dlls properly.
d) things I probably forgot...

Unfortunately I have my VST test code at home and cannot give more guidance 
right now. If there is a need for it, feel free to remind me to send some 
snippets to you. VST2 or VST3?

BR,
Maurice


 -Original Message-
 From: interest-bounces+maurice.kalinowski=theqtcompany.com@qt-
 project.org [mailto:interest-
 bounces+maurice.kalinowski=theqtcompany@qt-project.org] On
 Behalf Of Nuno Santos
 Sent: Dienstag, 19. Mai 2015 08:27
 To: Interests Qt
 Subject: [Interest] Windows VST plugin based on Qt
 
 Hi,
 
 I’m trying to build a VST plugin based on Qt.
 
 A VST plugin is a framework for creating audio processing and instrument
 plugins. It provides an api that one should follows. The result is a dynamic
 library that will be loaded by the host (dll on windows case, bundle on mac
 case). I have done it successfully on Mac (with still a lot of tests to 
 perform
 and the need for correct deploy) and now i’m trying on Windows.
 
 On Windows i’m being faced with some dll loading problems.
 
 If I build the plugin without link Qt at all (CONFIG -= qt), the plugin is
 recognized by the host. Otherwise it isn’t. I want to use Qt, specially QML 
 for
 UI. There are simpler ways of doing this, but I love Qt and I want my code to
 be the most transversal as possible.
 
 I have been suggested that this problems is due to the loading path of the
 libraries. I suggested solution relies in using /DELAYLOAD
 
 I have tried to perform /DELAYLOAD:Qt5Core.dll and the other three libs
 started by icu, and then using the SetDllDirectory to the path I have the
 deployed plugin.
 
 Still, the host is unable to load the plugin correctly.
 
 Can someone give me an insight on how to do this on windows?
 
 Thanks,
 
 Regards,
 
 Nuno
 
 
 ___
 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] Windows VST plugin based on Qt

2015-05-19 Thread Nuno Santos
Maurice,

Thanks for your reply.

There is certainly a lot to absorve from your answer. But I want to focus on 
small steps for now. The problem so far in Windows is that when I put the dlls 
on the VST plugins dir the host is not able to detect it (by host I mean 
Ableton Live and/or Bitwig for example). There are other test hosts such as VST 
Host and VST Analyser which are able to load the plugin but I think the dll 
directory problem fits like a glove here, since I need to specify manually 
where is the plugin I want to load and, therefore he knows that the remaining 
dlls are in the same dir. 

If I don’t link with Qt at all, Ableton Live recognizes the plugin.

What should I do? I feel my hands tied…

I would definitely remind you! Thanks so much.

Regards,

Nuno

 On 19/05/2015, at 08:05, Kalinowski Maurice 
 maurice.kalinow...@theqtcompany.com wrote:
 
 Creating a VST is certainly possible, though you will need to do some extra 
 steps.
 
 a) you need an application object created inside your plugin. The easiest to 
 do so is to create a new thread (when the first instance is created or even 
 on show(), not during plugins loading), which will initialize everything, 
 otherwise you will get into troubles due to two different event loops 
 interfering each other.
 b) Be careful  about multiple instances, you will need to handle this 
 properly (Q(Core)Application is singleton, so check for existence
 c) Try to not interfere with other VST plugins which might use Qt as well, 
 potentially a different version even. Then the order of plugins loaded might 
 make things fall apart. One step to take care of this is to namespace your Qt 
 build
 d) as a start you can put Qt libraries and plugins also into your VST folder, 
 the host will load a bit slower but for testing that is ok. Later you might 
 want to use manifests or static linking. Another option would be to create a 
 thin layer, which then loads your plugin from another location where you have 
 arranged all dlls properly.
 d) things I probably forgot...
 
 Unfortunately I have my VST test code at home and cannot give more guidance 
 right now. If there is a need for it, feel free to remind me to send some 
 snippets to you. VST2 or VST3?
 
 BR,
 Maurice
 
 
 -Original Message-
 From: interest-bounces+maurice.kalinowski=theqtcompany.com@qt-
 project.org [mailto:interest-
 bounces+maurice.kalinowski=theqtcompany@qt-project.org] On
 Behalf Of Nuno Santos
 Sent: Dienstag, 19. Mai 2015 08:27
 To: Interests Qt
 Subject: [Interest] Windows VST plugin based on Qt
 
 Hi,
 
 I’m trying to build a VST plugin based on Qt.
 
 A VST plugin is a framework for creating audio processing and instrument
 plugins. It provides an api that one should follows. The result is a dynamic
 library that will be loaded by the host (dll on windows case, bundle on mac
 case). I have done it successfully on Mac (with still a lot of tests to 
 perform
 and the need for correct deploy) and now i’m trying on Windows.
 
 On Windows i’m being faced with some dll loading problems.
 
 If I build the plugin without link Qt at all (CONFIG -= qt), the plugin is
 recognized by the host. Otherwise it isn’t. I want to use Qt, specially QML 
 for
 UI. There are simpler ways of doing this, but I love Qt and I want my code to
 be the most transversal as possible.
 
 I have been suggested that this problems is due to the loading path of the
 libraries. I suggested solution relies in using /DELAYLOAD
 
 I have tried to perform /DELAYLOAD:Qt5Core.dll and the other three libs
 started by icu, and then using the SetDllDirectory to the path I have the
 deployed plugin.
 
 Still, the host is unable to load the plugin correctly.
 
 Can someone give me an insight on how to do this on windows?
 
 Thanks,
 
 Regards,
 
 Nuno
 
 
 ___
 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


[Interest] Error when compiling Qt 5.5.0 beta for Max OS X 10.8

2015-05-19 Thread Calogero Mauceri
Hi all,

I'm trying to compile Qt 5.5.0 beta for Mac OS X 10.8, on Mac OS X 10.10.
This is the configuration line I'm using.

./configure -prefix /Developer/libs/qt-5.5.0_beta -qt-zlib -qt-libpng 
-qt-libjpeg -nomake tests -nomake examples -platform macx-clang-32 
-opensource -confirm-license -sdk macosx10.8

The compilation stops with the following error

[...]
cd testlib/  ( test -e Makefile || 
/Users/mauceri/work/dev/libs/qt-everywhere- 
opensource-src-5.5.0-beta/qtbase/bin/qmake 
/Users/mauceri/work/dev/libs/qt-every 
where-opensource-src-5.5.0-beta/qtbase/src/testlib/testlib.pro -o 
Makefile )  /Applications/Xcode.app/Contents/Developer/usr/bin/make -f 
Makefile
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f 
Makefile.Debug all
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
 
sr/bin/clang -c -pipe -arch i386 -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
 
-mmacosx-version-min=10.7 
-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D 
eveloper/Library/Frameworks -g -fvisibility=hidden 
-fvisibility-inlines-hidden - std=c++11 -stdlib=libc++ -Wall -W 
-DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_TSLIB 
-DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_ 
NO_DATASTREAM -DHAVE_XCTEST -DQT_BUILD_TESTLIB_LIB -DQT_BUILDING_QT 
-DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER 
-DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x05 
-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE  -DQT_CORE_LIB -I. 
-I../../include -I../../include/QtTest -I../../include/QtTest/5.5.0 
-I../../include/QtTest/5.5.0/QtTest -I../../lib/QtCore.framework/Headers 
-I../../lib/QtCore.framework/Headers/5.5.0 
-I../../lib/QtCore.framework/Headers/5.5.0/QtCore -I.moc/debug 
-I../../mkspecs/macx-clang-32 
-F/Users/mauceri/work/dev/libs/qt-everywhere-opensource-src-5.5.0-beta/qtbase/lib
 
qxctestlogger.mm -o .obj/debug/qxctestlogger.o
qxctestlogger.mm:129:27: error: property 'description' not found on 
object of
   type 'id'
 [NSDate date].description.UTF8String);
   ^

qxctestlogger.mm:250:17: warning: property 'testObjectName' requires method
   'testObjectName' to be defined - use @synthesize, @dynamic or 
provide a
   method implementation in this class implementation
   [-Wobjc-property-implementation]
@implementation QtTestLibTest
 ^
qxctestlogger.mm:75:41: note: property declared here
@property (nonatomic, retain) NSString* testObjectName;
 ^
qxctestlogger.mm:250:17: warning: property 'testObjectName' requires method
   'setTestObjectName:' to be defined - use @synthesize, @dynamic or 
provide
   a method implementation in this class implementation
   [-Wobjc-property-implementation]
@implementation QtTestLibTest
 ^
qxctestlogger.mm:75:41: note: property declared here
@property (nonatomic, retain) NSString* testObjectName;
 ^
qxctestlogger.mm:250:17: warning: property 'testFunctionName' requires 
method
   'testFunctionName' to be defined - use @synthesize, @dynamic or 
provide a
   method implementation in this class implementation
   [-Wobjc-property-implementation]
@implementation QtTestLibTest
 ^
qxctestlogger.mm:76:41: note: property declared here
@property (nonatomic, retain) NSString* testFunctionName;
 ^
qxctestlogger.mm:250:17: warning: property 'testFunctionName' requires 
method
   'setTestFunctionName:' to be defined - use @synthesize, @dynamic or
   provide a method implementation in this class implementation
   [-Wobjc-property-implementation]
@implementation QtTestLibTest
 ^
qxctestlogger.mm:76:41: note: property declared here
@property (nonatomic, retain) NSString* testFunctionName;
 ^
4 warnings and 1 error generated.
make[4]: *** [.obj/debug/qxctestlogger.o] Error 1
make[3]: *** [debug-all] Error 2
make[2]: *** [sub-testlib-make_first] Error 2
make[1]: *** [sub-src-make_first] Error 2
make: *** [module-qtbase-make_first] Error 2

Is this a bug or am I doing something wrong?

Thanks,
 Calogero

-- 
Calogero Mauceri
Software Engineer

Applied Coherent Technology Corporation (ACT)
www.actgate.com


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


Re: [Interest] Error when compiling Qt 5.5.0 beta for Max OS X 10.8

2015-05-19 Thread Tim Blechmann
 Is this a bug or am I doing something wrong?

qt-5.5 does not compile on 10.8 out of the box. it is probably going to
be fixed before the release (afaict, 10.8 is still supported)

tim

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


Re: [Interest] QProgressBar::reset... when it doesn't

2015-05-19 Thread Constantin Makshin
Doesn't look like a bug to me. The description of QProgressBar::reset()
says:
 The progress bar rewinds and shows no progress.

Indeterminate progress bars have no progress/value by definition so
there's nothing to reset. I admit that setting a non-zero range just to
disable a progress bar looks a bit ugly but QProgressBar::reset()
works as intended IMHO.

On 05/19/2015 08:38 PM, Matthew Woehlke wrote:
 I have a progress bar used to show that some task is executing. Some
 times I know how its actual progress, and sometimes I don't. When the
 task is done, I call QProgressBar::reset().
 
 This is fine if I know the actual progress (value range is non-empty).
 When I don't (value range = [0, 0]), reset() doesn't work.
 
 The problem is that QProgressBar having an empty range, to show the
 I'm busy but can't show you meaningful progress, trumps the progress
 bar being reset. Now, I can fix that by also setting a non-empty range,
 but this feels like a bug.
 
 This is with Qt 4.8.6. As I don't have an easy way to check, does anyone
 know if it has been fixed in Qt 5.x? Does this feel like a bug that
 should be reported? (I didn't find any existing reports for this issue,
 at least nothing that mentioned both QProgressBar and reset.)



signature.asc
Description: OpenPGP digital signature
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Error when compiling Qt 5.5.0 beta for Max OS X 10.8

2015-05-19 Thread Liang Qi
5.5 Beta does support 10.8, at least CI still covers it.

The issue must be related with -platform macx-clang-32, that's
unsupported for a while.

Regards,
Liang


On 19 May 2015 at 11:58, Tim Blechmann t...@klingt.org wrote:

  Is this a bug or am I doing something wrong?

 qt-5.5 does not compile on 10.8 out of the box. it is probably going to
 be fixed before the release (afaict, 10.8 is still supported)

 tim


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


Re: [Interest] The right way of using QProcess

2015-05-19 Thread Thiago Macieira
On Tuesday 19 May 2015 15:29:04 Nuno Santos wrote:
 Hi,
 
 I’m calling the function below with a one second interval while my app is
 open. The functions executes the command “adb devices
 
 Is there any kind of limitation by the system by the number of calls? I
 think my system gets to a point where no more processes can be created:
 Chrome starts to hang, QtCreator isn’t able to do make, etc

Sounds like an attack of the zombies (no, really, there must be zombie 
process left around)

 
 static QString executeAdbCommand(QStringList arguments)
 {
 QProcess p;
 
 //p.setReadChannel(QProcess::StandardError);
 
 #ifdef Q_OS_MAC
 p.start(QString(%1/adb).arg(QCoreApplication::applicationDirPath()),
 arguments); #endif
 
 #ifdef Q_OS_WIN
 p.start(adb.exe, arguments);
 #endif
 
 //qDebug()  Executing adb  arguments;
 
 if (!p.waitForStarted())
return ;
 
 if (!p.waitForFinished())
return ;
 
 QString output = p.readAll();
 
 return output;
 }

Don't return until waitForFinished() succeeds. That one guarantees wait() has 
happened on the process, so we know there is no zombie left.

Is this Qt 5.4? Or are you already trying the 5.5 beta? The way we do wait() 
has changed considerably in 5.5, so it might be worth testing the beta to see 
if the problem also happens.

-- 
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


Re: [Interest] The right way of using QProcess

2015-05-19 Thread Nuno Santos
Thiago,

Thanks for your reply. Yes, this is 5.4.

I will investigate this further by doing some output on the waitForFinished 
return result.

I want to avoid installing another toolkit right now (lack of time and lack of 
space in my laptop) but I will consider it if the problems persists.

Regards,

Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62

 On 19 May 2015, at 15:58, Thiago Macieira thiago.macie...@intel.com wrote:
 
 On Tuesday 19 May 2015 15:29:04 Nuno Santos wrote:
 Hi,
 
 I’m calling the function below with a one second interval while my app is
 open. The functions executes the command “adb devices
 
 Is there any kind of limitation by the system by the number of calls? I
 think my system gets to a point where no more processes can be created:
 Chrome starts to hang, QtCreator isn’t able to do make, etc
 
 Sounds like an attack of the zombies (no, really, there must be zombie 
 process left around)
 
 
 static QString executeAdbCommand(QStringList arguments)
 {
QProcess p;
 
//p.setReadChannel(QProcess::StandardError);
 
#ifdef Q_OS_MAC
p.start(QString(%1/adb).arg(QCoreApplication::applicationDirPath()),
 arguments); #endif
 
#ifdef Q_OS_WIN
p.start(adb.exe, arguments);
#endif
 
//qDebug()  Executing adb  arguments;
 
if (!p.waitForStarted())
   return ;
 
if (!p.waitForFinished())
   return ;
 
QString output = p.readAll();
 
return output;
 }
 
 Don't return until waitForFinished() succeeds. That one guarantees wait() has 
 happened on the process, so we know there is no zombie left.
 
 Is this Qt 5.4? Or are you already trying the 5.5 beta? The way we do wait() 
 has changed considerably in 5.5, so it might be worth testing the beta to see 
 if the problem also happens.
 
 -- 
 Thiago Macieira - thiago.macieira (AT) intel.com http://intel.com/
  Software Architect - Intel Open Source Technology Center
 
 ___
 Interest mailing list
 Interest@qt-project.org mailto:Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest 
 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] qmake command usage

2015-05-19 Thread Dale Marchand
On 5/19/2015 8:11 AM, Dale Marchand wrote:
 Can someone explain why the following line in a .pro file fails to
 create a softlink:
 
 system(ln -s /home/marchand/test.xml /home/marchand/test2.xml)
 
 but when the output is stored in a variable, the link is created as
 expected:
 
 THROW_AWAY_VAR=$$system(ln -s /home/marchand/test.xml
 /home/marchand/test2.xml)
 
 This is using qmake bundled with Qt 5.4.1.
 Perhaps it quotes the latter for you but expects the first to be 
 quoted? :

 system(ln -s /home/marchand/test.xml /home/marchand/test2.xml) 
Unfortunately no.  Tried that and still no luck without the variable 
assignment.

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


Re: [Interest] Error diring make install for iOS build

2015-05-19 Thread Edward Sutton
I have same issue installing Qt 5.5  Unfortunately I cannot verify if a couple 
of Qt 5.5 Beta patches fix Xcode malformed project crashes and qrc file not 
found errors.

https://bugreports.qt.io/browse/QTBUG-45966
https://bugreports.qt.io/browse/QTBUG-44654

Hopefully a Qt 5.5 RC candidate will be coming soon.

git clone https://git.gitorious.org/qt/qt5.git qt5
cd qt5
git checkout dev
perl init-repository

git checkout 5.5
git pull
git submodule foreach (git checkout 5.5; git pull)

./configure -commercial -confirm-license \
-debug-and-release \
-nomake tests \
-nomake examples \
-qt-zlib -qt-libjpeg -qt-libpng \
-xplatform macx-ios-clang \
-no-sql-mysql



-Ed


On May 18, 2015, at 3:10 PM, Jason H jh...@gmx.commailto:jh...@gmx.com 
wrote:

While doing a make install  for -xplatform macx-ios-clang -release, it 
installed the QtGUI stuff, but bombed with:
=== BUILD TARGET xmlpatterns OF PROJECT xmlpatterns WITH CONFIGURATION Release 
===

Check dependencies
Code Sign error: No provisioning profiles found: No non–expired provisioning 
profiles were found.
CodeSign error: code signing is required for product type 'Application' in SDK 
'iOS 8.3'

** INSTALL FAILED **


The following build commands failed:
Check dependencies
(1 failure)
make[4]: *** [iphoneos-release-install] Error 65
make[3]: *** [iphoneos-install] Error 2
make[2]: *** [sub-xmlpatterns-install_subtargets] Error 2
make[1]: *** [sub-tools-install_subtargets] Error 2
make: *** [module-qtxmlpatterns-install_subtargets] Error 2

How do I get past this?

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

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


[Interest] The right way of using QProcess

2015-05-19 Thread Nuno Santos
Hi,

I’m calling the function below with a one second interval while my app is open. 
The functions executes the command “adb devices

Is there any kind of limitation by the system by the number of calls? I think 
my system gets to a point where no more processes can be created: Chrome starts 
to hang, QtCreator isn’t able to do make, etc

static QString executeAdbCommand(QStringList arguments)
{
QProcess p;

//p.setReadChannel(QProcess::StandardError);

#ifdef Q_OS_MAC
p.start(QString(%1/adb).arg(QCoreApplication::applicationDirPath()), 
arguments);
#endif

#ifdef Q_OS_WIN
p.start(adb.exe, arguments);
#endif

//qDebug()  Executing adb  arguments;

if (!p.waitForStarted())
   return ;

if (!p.waitForFinished())
   return ;

QString output = p.readAll();

return output;
}

Nuno

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


Re: [Interest] Interest Digest, Vol 44, Issue 51

2015-05-19 Thread Dale Marchand
On 5/18/2015 11:46 PM, interest-requ...@qt-project.org wrote:
 Can someone explain why the following line in a .pro file fails to
 create a softlink:
 
 system(ln -s /home/marchand/test.xml /home/marchand/test2.xml)
 
 but when the output is stored in a variable, the link is created as
 expected:
 
 THROW_AWAY_VAR=$$system(ln -s /home/marchand/test.xml
 /home/marchand/test2.xml)
 
 This is using qmake bundled with Qt 5.4.1.
 Perhaps it quotes the latter for you but expects the first to be quoted? :

 system(ln -s /home/marchand/test.xml /home/marchand/test2.xml)
Unfortunately no.  Tried that and still no luck without the variable 
assignment.

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


[Interest] QProgressBar::reset... when it doesn't

2015-05-19 Thread Matthew Woehlke
I have a progress bar used to show that some task is executing. Some
times I know how its actual progress, and sometimes I don't. When the
task is done, I call QProgressBar::reset().

This is fine if I know the actual progress (value range is non-empty).
When I don't (value range = [0, 0]), reset() doesn't work.

The problem is that QProgressBar having an empty range, to show the
I'm busy but can't show you meaningful progress, trumps the progress
bar being reset. Now, I can fix that by also setting a non-empty range,
but this feels like a bug.

This is with Qt 4.8.6. As I don't have an easy way to check, does anyone
know if it has been fixed in Qt 5.x? Does this feel like a bug that
should be reported? (I didn't find any existing reports for this issue,
at least nothing that mentioned both QProgressBar and reset.)

-- 
Matthew

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


Re: [Interest] The right way of using QProcess

2015-05-19 Thread Nuno Santos
Thiago,

I have found the cause. The command binary was not present on the directory 
thus, every call was being invoked without the program. It never started, it 
never ended. 

You were right. It was a zombie attack.

Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62

 On 19 May 2015, at 16:12, Nuno Santos nunosan...@imaginando.pt wrote:
 
 Thiago,
 
 Thanks for your reply. Yes, this is 5.4.
 
 I will investigate this further by doing some output on the waitForFinished 
 return result.
 
 I want to avoid installing another toolkit right now (lack of time and lack 
 of space in my laptop) but I will consider it if the problems persists.
 
 Regards,
 
 Nuno Santos
 Founder / CEO / CTO
 www.imaginando.pt http://www.imaginando.pt/
 +351 91 621 69 62
 
 On 19 May 2015, at 15:58, Thiago Macieira thiago.macie...@intel.com 
 mailto:thiago.macie...@intel.com wrote:
 
 On Tuesday 19 May 2015 15:29:04 Nuno Santos wrote:
 Hi,
 
 I’m calling the function below with a one second interval while my app is
 open. The functions executes the command “adb devices
 
 Is there any kind of limitation by the system by the number of calls? I
 think my system gets to a point where no more processes can be created:
 Chrome starts to hang, QtCreator isn’t able to do make, etc
 
 Sounds like an attack of the zombies (no, really, there must be zombie 
 process left around)
 
 
 static QString executeAdbCommand(QStringList arguments)
 {
QProcess p;
 
//p.setReadChannel(QProcess::StandardError);
 
#ifdef Q_OS_MAC
p.start(QString(%1/adb).arg(QCoreApplication::applicationDirPath()),
 arguments); #endif
 
#ifdef Q_OS_WIN
p.start(adb.exe, arguments);
#endif
 
//qDebug()  Executing adb  arguments;
 
if (!p.waitForStarted())
   return ;
 
if (!p.waitForFinished())
   return ;
 
QString output = p.readAll();
 
return output;
 }
 
 Don't return until waitForFinished() succeeds. That one guarantees wait() 
 has 
 happened on the process, so we know there is no zombie left.
 
 Is this Qt 5.4? Or are you already trying the 5.5 beta? The way we do wait() 
 has changed considerably in 5.5, so it might be worth testing the beta to 
 see 
 if the problem also happens.
 
 -- 
 Thiago Macieira - thiago.macieira (AT) intel.com http://intel.com/
  Software Architect - Intel Open Source Technology Center
 
 ___
 Interest mailing list
 Interest@qt-project.org mailto:Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest 
 http://lists.qt-project.org/mailman/listinfo/interest
 ___
 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