Il 31/07/19 23:22, Nikos Chantziaras ha scritto:
static void constructor() __attribute__((constructor));
static void constructor(){
qmlRegisterType("ClassName", 1, 0, "ClassName");
}
Maybe it helps.
Thanks! I didn't know about that one.
You can do that in pure C++, by the way; just
(CC'ing the list as it might be of interest.)
I didn't think volatile would affect the linker. That might indeed work
if the llvm people think so. I'll try and run some tests when I get to it.
Thanks!
On 02/08/2019 09:54, Dmitriy Purgin wrote:
Oh, thanks, I didn't get it from the
On 29/07/2019 23:50, Tomas Konir wrote:
I'm using C constructor attribute with no problems.
Code like below at each class cpp file.
static void constructor() __attribute__((constructor));
static void constructor(){
qmlRegisterType("ClassName", 1, 0, "ClassName");
}
Maybe it helps.
On Monday, 29 July 2019 13:28:04 PDT Nikos Chantziaras wrote:
> > This is only required when referring to it by name, such as in old-style
> > signal-slot connection, QML, D-Bus, etc.
>
> They're new-style connections, but are sometimes of QueuedConnection
> type since some connections are used
On Monday, 29 July 2019 09:25:04 PDT Tomasz Olszak wrote:
> What's is the cons of putting something like that in anonymous namespace
> instead of constructor?
It's run on program load, before main(), even if the type is never used.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software
po 29. 7. 2019 v 21:00 odesílatel Nikos Chantziaras
napsal:
> The linker might remove it from the executable when linking statically,
> because 'registerHelper' is not referenced anywhere.
>
>
> On 29/07/2019 19:25, Tomasz Olszak wrote:
> > What's is the cons of putting something like that in
On 28/07/2019 07:15, Thiago Macieira wrote:
On Friday, 26 July 2019 17:35:03 PDT Nikos Chantziaras wrote:
I didn't (although I use Q_ENUM, but it does the same job.) But there's
no constructor to put qRegisterMetaType() in. It's an enum. There's no
constructor. Some enums are in a namespace,
The linker might remove it from the executable when linking statically,
because 'registerHelper' is not referenced anywhere.
On 29/07/2019 19:25, Tomasz Olszak wrote:
What's is the cons of putting something like that in anonymous namespace
instead of constructor?
namespace {
struct
What's is the cons of putting something like that in anonymous namespace
instead of constructor?
namespace {
struct RegisterHelper
{
RegisterHelper()
{
qRegisterMetaType();
qRegisterMetaType();
qRegisterMetaTypeStreamOperators();
}
};
static RegisterHelper
On Friday, 26 July 2019 17:35:03 PDT Nikos Chantziaras wrote:
> I didn't (although I use Q_ENUM, but it does the same job.) But there's
> no constructor to put qRegisterMetaType() in. It's an enum. There's no
> constructor. Some enums are in a namespace, some are in a class, but
> even with an
On 25/07/2019 06:20, Thiago Macieira wrote:
On Wednesday, 24 July 2019 09:05:02 PDT Nikos Chantziaras wrote:
On 24/07/2019 17:23, Thiago Macieira wrote:
On Tuesday, 23 July 2019 07:27:27 PDT Nikos Chantziaras wrote:
Ugh. Having the call happen on every object creation sounds even uglier.
It
11 matches
Mail list logo