Tag Archives: MSVC

Ten years!

It’s been 10 years since I joined Kexi and thus the KDE community. I think writing down some history and summary makes sense.

2003-03-28: first touch on Kexi sources for porting

It all started at a technology fair in Warsaw, 2003. I wasn’t too keen to go but got free tickets and free time. I met a founder of OpenOffice Polska LLC (later renamed to OpenOffice Software) from Warsaw presenting its adaptation of deeply localized, nicely prebuilt office suite based on OpenOffice.org. The office suite has been open sourced StartOffice over two years before by SUN and then localizations or user handbooks basically did not exist. During the meeting among other topics we also discussed apparent missing bit in the OpenOffice.org suite: a rival of MS Access. I proposed to perform some research on how the app can be added. I got hired and engaged full-time from March 2003.

Join the big guys

The business model was largely similar to what is known from server Linux tools or support subscriptions: offer the tools for free, with the source code, and build products and services (such as support) on top. I was already confident that my adventures with open source would start soon, I just wasn’t sure what project to join.

My initial attempt should have been obvious: say hello to OpenOffice.org to start a MS Access clone project within it. That was nice theory but has never worked since OpenOffice.org project wasn’t even semi-openly governed. Talking to OO.org meant talking to SUN Microsystems. A small company is rarely a part in such relations.

So another solution was to start from scratch or join existing open source project that shares our goals.

By that time a great smart guy Lucijan Busch from Austria already started his work on Kexi which he launched as a summer project in 2002. (a hint for all of you who think you’re too young to start doing some KDE Junior Job, you are wrong, Lucijan was only 16 years old when he started Kexi!)

Lucijan in 2004 or so

MS Windows, positive side effects

Based on the business model of OpenOffice Polska, Kexi had to run natively on Windows to integrate well with to OS. So a side effect of my project was the KDE on Windows initiative that resulted in another general-purpose target for KDE software which is now a subproject on its own. Initial selection of features (such as larger parts of KDElibs) was closely related to needs of Kexi Windows port. I owe a big credit to my employer that it allowed me to contribute in a sane way instead of just accepting code forks.

Naturally, for some time I was the only hacker using MSVC for actual KDE code. Having the Linux KDE Desktop around all the time but about first three …read more

Source: FULL ARTICLE at Planet KDE

Building Static PoDoFo 0.9.1 with MSVC 2012

Just found this nice article about building PoDoFo using Visual Studio: http://johnbugbee.com/2012/12/30/building-static-podofo-0-9-1-with-msvc-2012/.

As this is a frequently asked question, I though I post it here. It might be of use to some of you. Please note, so, PoDoFo as of 0.9.2 has a dependency on OpenSSL which is not mentioned in the article as it focuses on 0.9.1. We are currently discussing about replacing OpenSSL in favour of LibCrypto++.

…read more
Source: FULL ARTICLE at Planet KDE

qt-signal-tools – Pre-packaged slot calls and connecting signals to arbitrary functions in Qt 4

A useful new feature in Qt 5 is the ability to connect signals to arbitrary functions instead of just Qt signals/slots/properties, including C++11 lambdas. As this page on the Qt Project wiki explains, this is especially useful when writing code to perform async operations where you often want to pass additional context to the slot.

I’ve written a small library for Qt 4 which provides similar functionality. The library includes:

  • QtCallback – A pre-canned QObject method call. QtCallback stores an object, a slot to call and optionally a list of pre-bound arguments to pass to the slot. This is useful if you need to pass additional context to the slot, other than the values provided by the signal.
  • QtSignalForwarder::connect() – Connects signals from QObjects to arbitrary functions or methods or QtCallbacks. You can use this together with bind() and function to pass additional arguments to the method other than those provided by the signal or re-arrange arguments. You can think of this as a more flexible alternative to the QSignalMapper class that Qt 4 provides. There are also a couple of utility features:
    • QtSignalForwarder::delayedCall() – A more flexible alternative to QTimer::singleShot() which can be used to invoke an arbitrary function after a set delay.
    • Event connections – Invoke an arbitrary function or QtCallback when an object receives a particular type of event. This is useful when the object does not have a built-in signal that is emitted in response to that event and requires less boilerplate than using QObject::installEventFilter()
  • safe_bind() – A downside of connecting a signal to a function object is that the signal does not automatically disconnect if the receiver is destroyed. safe_bind() creates a wrapper around a (QObject*, function) pair which when called, invokes the function if the object still exists or does nothing and returns a default value if the object has been destroyed. You can use this together with QtSignalForwarder to connect a signal to an arbitrary method on a QObject which effectively ‘disconnects’ when the receiver is destroyed.

For example usage, please see the README, the examples and the tests. The code is available from github.com/robertknight/qt-signal-tools. The requirements are:

  • Qt 4.8
  • A compiler with the TR1 standard library extensions (most C++ compilers from the past few years – including MSVC >= 2008 and GCC 4.x. I have tested with MSVC 2010 and recent GCC/Clang versions) or one which supports equivalent features from the C++11 standard library.

Compared to the implementation in Qt 5, there are a few disadvantages:

  • Argument type checking happens at runtime when QtSignalForwarder::connect() is called, similar to standard QObject signal-slot connections. QObject::connect() in Qt 5 can do type checking at compile time.
  • In order to do the runtime type checking, the types of arguments passed from the signal to the function or method must be registered using Q_DECLARE_METATYPE() or qRegisterMetaType()
  • Using QtSignalForwarder does have additional overhead since a hidden proxy object is created to route the …read more
    Source: FULL ARTICLE at Planet KDE