Giter Club home page Giter Club logo

Comments (11)

ambethia avatar ambethia commented on July 4, 2024

Namespaces.

from spine-runtimes.

martell avatar martell commented on July 4, 2024

It's not SlotData that is the problem it is the variable name slots in the class definition?

Maybe I misunderstand what your saying. Sorry

from spine-runtimes.

ambethia avatar ambethia commented on July 4, 2024

Oh right, so it's not a scope thing?

from spine-runtimes.

martell avatar martell commented on July 4, 2024

No its not.
It's used like this.

class bla{

public:
int hi;

private:
int bye;

public slots:
void setValue(int value);

signals:
void valueChanged(int newValue);
}

so the words slots and signals are reserved and we cant use them as a variable name in a class.

from spine-runtimes.

NathanSweet avatar NathanSweet commented on July 4, 2024

Note this only affects headers, as C files should not be fed to QT moc. Still, it's bloody annoying.

from spine-runtimes.

NathanSweet avatar NathanSweet commented on July 4, 2024

What version of QT are you using? QT 4+ has QT_NO_KEYWORDS, then you use Q_SIGNALS and Q_SLOTS instead of signals and slots in your programs. Is this acceptable? Slots are called slots in Spine, I'm not keen on changing the names in Spine code.

For a QT 3 and below workaround, we could undef slots, described here:
http://lists.trolltech.com/qt-interest/2008-01/thread00347-0.html
I'd rather keep QT specific stuff out of Spine code. You could surround all Spine header #includes in your code with the undef.

from spine-runtimes.

martell avatar martell commented on July 4, 2024

I'm using QT 5.0.2.
I'm building libspine separate and then when its a static library trying to link it into my cocos/qt project.
So yes its only when we include the headers in qt and is quite annoying.

I didn't even know qt3 was still supported.
Don't think anyone uses that anymore and I'd agree completely on keeping qt specific code out of spine.

I have no problem using QT_NO_KEYWORDS.
I'll test it there now and see if it works.

Thanks for the reply :)
I'll be back asap

from spine-runtimes.

martell avatar martell commented on July 4, 2024

It works but I must use Q_FOREACH instead of foreach also.
Do you want to make a wiki page on this for others?

from spine-runtimes.

NathanSweet avatar NathanSweet commented on July 4, 2024

Glad that works! I will document use with QT when I write docs for the C runtime.

from spine-runtimes.

martell avatar martell commented on July 4, 2024

👍 Thanks dude

from spine-runtimes.

ruffianeo avatar ruffianeo commented on July 4, 2024

I tried to use ECL (a common lisp) and the reserved keyword slots spoils the whole idea I had:

In ecls object.h

struct ecl_instance {           /*  instance header  */
        _ECL_HDR1(isgf);
        cl_index length;        /*  instance length  */
        cl_object clas;         /*  instance class  */
        cl_objectfn entry;      /*  entry address  */
        cl_object sig;          /*  generation signature  */
        cl_object *slots;       /*  instance slots  */
};

So what again is an easy way to work around this?

from spine-runtimes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.