[Kde-bindings] Re: Notes on building on Mac OS X

Adam Higuera ahig321 at gmail.com
Sat Feb 19 00:35:28 UTC 2011


If there's still interest, in order to get Smoke to work right with the
frameworks, I put the following into the file "generatorpreprocessor.cpp".
 It's an ugly kludge, but it might save you some irritation.

    // skip limits.h - rpp::pp gets stuck in a endless loop, probably
because of
    // #include_next <limits.h> in the file and no proper header guard.
    if ((fileName == "limits.h" || fileName == "stdarg.h") && type ==
rpp::Preprocessor::IncludeGlobal)
        return 0;

QRegExp rx("(Qt\\w+)/([\\w\\.]+)");
if(rx.indexIn(fileName) != -1) {
  fileName = "/Library/Frameworks/" + rx.cap(1)
+ ".framework/Headers/" + rx.cap(2);
}

-Adam

On Fri, Feb 18, 2011 at 5:59 PM, Arno Rehn <arno at arnorehn.de> wrote:

> On Friday 18 February 2011 17:33:33 Ben Skelton wrote:
> > My QAccessibleBridgePlugin problem seems taken care of with a change to
> qtcore/tests/test.cpp:
> > > #ifdef TEST_QT_NO_ACCESSIBILITY
> > > #include "QtGui/qaccessible.h"
> > > #include "QtGui/qaccessiblebridge.h"
> > >
> > > int main(int argc, char ** argv)
> > > {
> > >
> > >   QAccessibleEvent event(QEvent::AccessibilityHelp, 0);
> > >   QAccessibleBridgePlugin plugin(0);
> > >
> > > }
> > >
> > > #endif
> Hm, this will get rid of all accessibility stuff in OS X builds. But I
> guess
> it's an okay solution for now.
>
> > > Kauri:~ benskelton$ otool -tV
> > > /Users/benskelton/Desktop/build/lib/libQtGui.dylib | c++filt | grep
> > > macMenu
> > >
> > > 000000000001568a    callq   QMenu::macMenu(NSMenu*)
> > > 0000000000017977    callq   0x006e849c      ; symbol stub for:
> > > QCoreApplicationPrivate::macMenuBarName()
> > > QMenuPrivate::macMenu(NSMenu*):
> > > QMenu::macMenu(NSMenu*):
> > > 0000000000066359    jmp     QMenuPrivate::macMenu(NSMenu*)
> > > 0000000000066c38    callq   QMenu::macMenu(NSMenu*)
> > > 0000000000067796    callq   QMenu::macMenu(NSMenu*)
> > > 0000000000067961    callq   QMenu::macMenu(NSMenu*)
> > > QMenuBarPrivate::macMenu():
> > > QMenuBar::macMenu():
> > > 0000000000068159    jmp     QMenuBarPrivate::macMenu()
> > > 000000000006842f    callq   QMenuBar::macMenu()
> > > 00000000000686d2    callq   QMenuBar::macMenu()
> > > 0000000000068a8b    callq   QMenuPrivate::macMenu(NSMenu*)
> >
> > Looking at the comments in the Qt source for macMenu:
> > >     If Qt is built against Carbon, the OSMenuRef is a MenuRef that can
> be
> > >     used with Carbon's Menu Manager API.
> > >
> > >     If Qt is built against Cocoa, the OSMenuRef is a NSMenu pointer.
> >
> > otool shows an NSMenu* argument because my Qt is built for Cocoa. It
> > appears that Qt sets QT_MAC_USE_COCOA for Cocoa builds and does not set
> > this for Carbon builds. Qt documentation says that Cocoa builds are
> > default for Qt/Mac.
> That #define is somewhere defined in qfeatures.h and is picked up correctly
> by
> smokegen (otherwise it wouldn't make it a void*). However, __OBJC__ has to
> be
> defined as well for the NSMenu* typedef. I don't really know where the
> __OBJC__ define is coming from (we're compiling C++ after all), so I'll
> simply
> blacklist QMenu::macMenu() as well.
>
> > > Kauri:~ benskelton$ otool -tV
> > > /Users/benskelton/Desktop/build/lib/libQtGui.dylib | c++filt | grep
> > > qt_mac_set_cursor
> >
> > > qt_mac_set_cursor(QCursor const*, QPoint const&):
> > which seems ok, right? Not sure if this is relevant in some way, but in
> the
> Qt source this function does nothing for the default case on the mac:
> > > void qt_mac_set_cursor(const QCursor *c, const QPoint &)
> > > {
> > > #ifdef QT_MAC_USE_COCOA
> > >
> > >     Q_UNUSED(c);
> > >     return;
> > >
> > > #else
> This function is internal anyway, I guess. So we can safely blacklist it.
>
> > Sorry for all the naive questions. I hope somebody with some knowledge
> can
> > see something here.
> No problem. The questions aren't naive at all. The smoke internals are a
> little complex :)
>
> --
> Arno Rehn
> arno at arnorehn.de
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindings at kde.org
> https://mail.kde.org/mailman/listinfo/kde-bindings
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20110218/22ce54cd/attachment.html>


More information about the Kde-bindings mailing list