[Interest] Sharing enums between ActiveQt classes

2014-04-21 Thread S R
Hi.  I am having trouble using the same enum in multiple classes with
ActiveQt.


1. If I define the enum (TestEnum) in class QClass1, properties and slots
in class QClass1 that use TestEnum work well.

a) I define the enum TestEnum publicly in class QA.

b ) Then, I include Q_ENUMS(TestEnum) to register the enum to the
meta-object system.

c)  I include the QAXCLASS(QClass1) macro to make class QClass1 available
in the created DLL.

d) If I look at the generated idl, I see the enumeration.  Properties and
public slots are available as COM properties and methods.  Everything seems
good.


2. However, I am unable to use the enum defined in class QClass1 in another
class QClass2.

a) I reference TestEnum  in properties and public slots like
QClass1::TestEnum.

b) Everything compiles without error.  MOC seems happy with the syntax.

c) However, properties and methods in QClass2 that use the QClass1 enum are
excluded from the COM object.  If I examine the generated IDL file, I see
that the generated slots and properties are commented out.  For example, I
see /** Property is of unsupported datatype before properties that
use the enum.


3. I have tried as many variations as I can think of.  For example...

a) If I move the enum from QClass2 to QClass1, then I see the problem in
reverse.  The properties and methods of QClass2 seem fine but QClass1 now
shows unsupported datatype.  This seems to confirm that I have not made
some trivial error in QClass2.

b) I have sprinkled lots of variations of Q_DECLARE_METATYPE and
qRegisterMetaType around but nothing seems to help.  Maybe I am doing this
incorrectly or in the wrong place.

c) I rearranged the order of declarations, QAXCLASS macros, etc.  Nothing
seemed to help.

d) I spent some time looking at the qaxserver.cpp source code but without
learning anything.  From that, I don't see how one class could know about
another enums from another class.

I have simplified my example, but my ideal would be to have the enums
globally available to every class in my DLL.  I am artificially associating
their definition with a single class; conceptually, they would be global.

Is what I am trying to do possible?  What am I missing?  This does not seem
like an unusual situation.

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


Re: [Interest] Long running application with database connection

2013-10-09 Thread S R
In a similar situation, if I recall correctly, we elected to open the
database connection each time we needed it.  Through testing we found that
connection pooling in the the underlying infrastructure (windows, using
oracle and ms sqlserver) worked well.  The reconnection cost was usually
trivial compared with the actual query especially if the connection was
recently used; the resulting code was simpler/cleaner; and the approach
seemed robust to lots of other reasons (not just idle time) that the
connection might drop.  I do recall that it was hard to test well.

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