Skip to content

Instantly share code, notes, and snippets.

@vmlemon
Created June 28, 2011 16:53
Show Gist options
  • Select an option

  • Save vmlemon/1051578 to your computer and use it in GitHub Desktop.

Select an option

Save vmlemon/1051578 to your computer and use it in GitHub Desktop.
#include "mainwindow.h"
#include "ui_mainwindow.h"
#import <Cocoa/Cocoa.h>
#include <QString>
NSString *iLogText = @"Testing NSLog from Qt!";
QString iDemoQString = "This is a QString";
NSString *iDemoNSString;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
iDemoNSString = [NSString stringWithUTF8String:iDemoQString.toUtf8().data()];
NSBeep();
NSLog(iLogText);
NSLog(iDemoNSString);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment