Results 1 to 20 of 32

Thread: Processor generated QObject?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2010
    Posts
    97
    Thanks
    6
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Processor generated QObject?

    Quote Originally Posted by tbscope View Post
    You get better information if you stay polite.

    You can of course create something yourself by doing whatever MOC does by yourself.
    For someone like you, who needs this, this would not be a big problem.
    I'm sorry. I'm afraid I don't understand the point of your answer. Could you please explain it more clearly? Exactly what is the solution/workaround you're recommending?

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Processor generated QObject?

    Well, if MOC doesn't want to handle preprocessor code, then you can do it manually.

  3. #3
    Join Date
    Nov 2010
    Posts
    97
    Thanks
    6
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Processor generated QObject?

    Quote Originally Posted by tbscope View Post
    Well, if MOC doesn't want to handle preprocessor code, then you can do it manually.
    So, your expert advice to auto-generate classes capable of being connected to Qt signals is to write them manually?

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Processor generated QObject?

    Are you aware that a preprocessor and MOC are written manually?
    You can write your own preprocessor or script to handle the files before they are compiled.

  5. #5
    Join Date
    Nov 2010
    Posts
    97
    Thanks
    6
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Processor generated QObject?

    Quote Originally Posted by tbscope View Post
    Are you aware that a preprocessor and MOC are written manually?
    You can write your own preprocessor or script to handle the files before they are compiled.
    Oh, IC. Your expert answer to a question in the newbie section asking how to auto-generate Qt classes is to rewrite the MOC.

    Sounds reasonable.

  6. #6
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Processor generated QObject?

    Please don't be so hostile. I just want to help you.

    And yes, if you want something as specific as you want, and it doesn't exist, the only thing you can do is create it yourself.

    Basically, that's what you already got above.

    Your question does not belong in the newbie or even advanced section. You question belongs in a "super geeky nerd" section.

    Look at it from the other side.
    What I think you have done is made some poor choices along the line.

    Can you explain exactly what you want to do in clear and plain text. Don't use the following words: preprocessor, templates, moc
    And be verbose.

  7. #7
    Join Date
    Nov 2010
    Posts
    97
    Thanks
    6
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Processor generated QObject?

    Quote Originally Posted by tbscope View Post
    Please don't be so hostile. I just want to help you.
    This is obviously false.

    And yes, if you want something as specific as you want, and it doesn't exist, the only thing you can do is create it yourself.
    I think you might have just beat the other poster in this thread for most ridiculous response ever, though it is pretty hard to compete with using ifdef to autogenerate classes. Not only is it completely redundant to say, "If it doesn't exist then make it," it is also quite possibly the very wrong thing to do, especially if the cost to make it is higher than worth. Several other options come to mind: live without it, don't use Qt, etc... All of which are quite redundant and beside the point of the real question though and amount to no more than simple efforts to be obnoxious.

    Your question does not belong in the newbie or even advanced section. You question belongs in a "super geeky nerd" section.
    BULL. The question is simple: how do you use the preprocessor or templates to generate Qt objects.

    The answer is also quite simple and still I'm the only one in this entire thread that even mentioned it: you can't. The rest of your guys' nonsense is just that.

    What I think you have done is made some poor choices along the line.
    Which is simply an amazing presentation of mind-reading abilities.

    Can you explain exactly what you want to do in clear and plain text. Don't use the following words: preprocessor, templates, moc
    And be verbose.
    The question is, and has always been, quite clear in my first post and I answered it myself (in spite of attempts to send me down blind alleys) quite a long time ago; even to the point of including exactly the problem I'm trying to solve.

  8. #8
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Processor generated QObject?

    What I mean with helping you is to get to the point to have something that you want.
    You're fixed on the preprocessor. Maybe there's another way to do what you want.
    But to know this, I need to know exactly what you want, and that's still not clear for me.

    By the way, there's a Qt mailing list where you can ask the Qt developers directly for support.
    http://lists.qt.nokia.com/mailman/listinfo/qt-interest

  9. #9
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Processor generated QObject?

    I can't decipher what it is you're trying to accomplish, but the C/C++ preprocessor is almost trivially simple; you can learn all there is to know about it in a couple of hours. If you can't figure out how to accomplish something using it, you either have to A) devote a small amount of time to learning how it works, or B) recognize that the preprocessor is almost certainly the wrong tool, and look for another solution.

    For starters, perhaps you should also devote some time to A) being polite, and B) providing a reasonably detailed explanation of what the problem is you're trying to solve. Without more information, it's really impossible to suggest any reasonable solution other than to mention that there are many potential tools available for generating code - lex, yacc, perl, python and dozens of others, not to mention C++ and maybe - just maybe - the preprocessor.

  10. #10
    Join Date
    Nov 2010
    Posts
    97
    Thanks
    6
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Processor generated QObject?

    Quote Originally Posted by SixDegrees View Post
    I can't decipher what it is you're trying to accomplish, but the C/C++ preprocessor is almost trivially simple; you can learn all there is to know about it in a couple of hours. If you can't figure out how to accomplish something using it, you either have to A) devote a small amount of time to learning how it works, or B) recognize that the preprocessor is almost certainly the wrong tool, and look for another solution.
    The preprocessor is absolutely the right tool for the job and is fully capable of doing exactly what I want. The problem stems from having to use the MOC and its inability to play well with the preprocessor and with templates.

    I think the real problem here is that "Newbie" on this forum isn't a place for new Qt users to get help from expert users, but where those answering are also newbies. Even the moderator seems particularly so. Nothing wrong with being a newbie but it is particularly frustrating to ask for help expecting knowledgeable people and running into a bunch of yahoo's claiming to be experts but spout nonsense. In other words, I come here as a complete newb to Qt and have found that the "experts" know less than I do at apparently every level. My bad for coming to the wrong place I suppose, but in my defense it is one of the support links on the Qt site proper.

    That said, I'm pretty tired of people "answering" my question just to claim I'm being a) impolite or b) not specific enough. The question is quite clear and has actually been answered already. Anyone else doing so is just going to end up on my ignore list, and if you're here to actually get help....I am an expert; I just happen to be new to Qt. I also don't waste your time with my own ignorance. If you actually have something pertinent to my question that hasn't been brought up then I'm all for hearing it, but I'm tired of people just posting to flame.

  11. #11
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Processor generated QObject?

    When I learned to be an engineer, I was taught that impossible problems do not exist. One tool to solve an impossible problem is to rethink what you want to do. There are always multiple paths to achieve what you want.

    So, if you explain in plain english, without refering to a specific technique, what you want to do, someone might give you an better solution. Even if you are a pro, please keep your feet on the ground and accept that even the village idiot might give you inspiration.

  12. #12
    Join Date
    Nov 2010
    Posts
    97
    Thanks
    6
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Processor generated QObject?

    After saying you doubt that would work with moc you then suggested

    Qt Code:
    1. #ifdef MAKE_OBJECT
    2. ...
    3. #endif
    To copy to clipboard, switch view to plain text mode 

    This is a purposefully unhelpful response from anyone who knows anything about C++. My actual assumption was that you were an idiot that didn't know anything about C++ or Qt rather than the apparently actual case...you knew exactly what I was trying to do and even had information that might help me that you withheld.

    Only now, after weeks of bullshit, you post something mildly interesting in an apparent quest to prove your knowledge rather than being helpful, which you could have done a LONG time ago if you had really wanted. I'd ask for expansion on the idea you finally decided to mention but to tell the truth I'm so sick of your crap that I would rather just investigate the possibility myself. On the other hand, at this point I do have to take into account the very distinct possibility that you've just found a different way to send me off on a wild goose chase to waste even more of my time.

    Of course, I'm not trying to avoid anything but a bunch of extra, pointless coding of small utility classes that should be easy to generate automatically. This is the first time you've even said anything that wasn't completely absurd AND redundant.


    Added after 4 minutes:


    Quote Originally Posted by tbscope View Post
    So, if you explain in plain english, without refering to a specific technique, what you want to do, someone might give you an better solution.
    Copied from my original post:

    Namely I want to make a QObject that has a slot with some arbitrary signature that translates a Qt signal into a boost signal (which I can use bind with).
    Last edited by nroberts; 27th December 2010 at 22:07.

Similar Threads

  1. Port Qt to ARC Processor
    By jim_king_2000 in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 19th January 2010, 21:22
  2. Replies: 5
    Last Post: 21st August 2009, 15:10
  3. high processor waste...
    By kernel_panic in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2008, 23:12
  4. QProcess processor affinity
    By ibergmark in forum Qt Programming
    Replies: 1
    Last Post: 28th March 2008, 16:09
  5. Locking all threads to one processor
    By chuckshaw in forum Qt Programming
    Replies: 0
    Last Post: 3rd July 2007, 19:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.