Showing posts with label mac. Show all posts
Showing posts with label mac. Show all posts

2011/03/10

Making QT behave properly on Mac.

Couple of things I found out that helped porting a QT application to Mac:

The QMainWindow you create does not look like a native Cocoa window. The status bar is there, no matter what you request, the menu doesn't port and the icon is yucky.
Here's what you can do:

Remove status bar/resize grip:


Don't show unneeded icon in the title bar and move a QAction to Mac's main menu:

2011/01/26

SIMBL For Poking Inside Mac Application Internals

SIMBL is, according to it's Home Page:

Problem:
Some applications do about 90% of what I want.
Solution:
Develop my own applications.
Better Solution:
Patch the application myself...
SIMBL (SIMple Bundle Loader) - pronounced like "symbol" or "cymbal" - enables hacks and plugins. For instance, SIMBL enables PithHelmet to enhance Safari.

So, let's say we have a naughty program that has a behaviour we don't like. How would we treat that problem?


  1. class-dump TargetProgram
  2. Look at the list of classes and note the one that seems to be the issue. Let's call that class Victim.
  3. Inside, find your naughty method, let's call it '- (BOOL) victimMethod;'
  4. Open Info.plist of the victim, and note the bundle name and version
  5. Create new Cocoa bundle in XCode according to the steps on SIMBL site
  6. Fill in the bundle name as stated
  7. Use the following code: 
  8. Restart the target app
  9. ???
  10. Profit!