Recent

Author Topic: Mac + QT + lazarus  (Read 12555 times)

cpalx

  • Hero Member
  • *****
  • Posts: 619
Mac + QT + lazarus
« on: May 30, 2011, 10:34:26 pm »
How can i use QT with lazarus in Mac, Snow Leopard?

What should i install?

i download QT sdk, but does not compile in QT

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Mac + QT + lazarus
« Reply #1 on: May 31, 2011, 10:21:16 am »
There is information on the topic here:

http://wiki.lazarus.freepascal.org/Qt_Interface_Mac

For actually getting the Qt framework, the best is just "stealing" it from an open source software. You can get it from Gimp or from the Virtual Magnifying Glass (I don't remember if the latest version uses Qt or not, but if it doesn't just get an older one). This is much easier and faster then compiling Qt.

You will need to compile the Pascal-Qt bindings, however. Virtual Magnifying Glass cames with a framework of those bindings, but that's an older version, you will probably need a newer one.

Shebuka

  • Sr. Member
  • ****
  • Posts: 422
Re: Mac + QT + lazarus
« Reply #2 on: September 07, 2011, 10:33:40 am »
I can't manage to make this work... I'v followed the tutorial (that btw is a bit outdated) downloading the binary from linked site, unzip it and install the package (it has added Qt4Pas.framework inside Library/Framework) and skipped steps 2,3 and 4. I'v also skipped steps 5 and 6 because i can't find .sh scripts even iside Mac library source.
Now i'v tried to rebuild lazarus with qt following 7.1 and using this string
make clean all LCL_PLATFORM=qt OPT="-dUSE_QT_45 -k'-framework' -k'Qt4Intf' -k'-lobjc' -k'-framework' -k'Foundation'" and it fails with this error:
Code: [Select]
make --assume-new=lazarus.pp lazarus OPT='-Fl/usr/X11R6/lib -Fl/sw/lib -dUSE_QT_45 -k'-framework' -k'Qt4Intf' -k'-lobjc' -k'-framework' -k'Foundation''
/usr/local/bin/ppc386 -gl -dlclqt -Fu../lcl/units/i386-darwin -Fu../lcl/units/i386-darwin/qt -Fu../components/codetools/units/i386-darwin -Fu../components/synedit/units/i386-darwin -Fu../components/lazcontrols/lib/i386-darwin -Fu../components/custom -Fu../components/mpaslex -Fu../ideintf/units/i386-darwin -Fu../designer -Fu../debugger -Fu../debugger/frames -Fu../converter -Fu../packager -Fu../packager/frames -Fu../packager/units/i386-darwin -Fu../units/i386-darwin -Fuframes -Fu. -Fu/usr/local/lib/fpc/2.4.4/units/i386-darwin/rtl -Fu/usr/local/lib/fpc/2.4.4/units/i386-darwin/regexpr -Fiinclude -Fiinclude/darwin -Fi../images -FE.. -FU../units/i386-darwin -Fl/usr/X11R6/lib -Fl/sw/lib -dUSE_QT_45 -k-framework -kQt4Intf -k-lobjc -k-framework -kFoundation -di386 lazarus.pp
Free Pascal Compiler version 2.4.4 [2011/05/01] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Darwin for i386
Compiling lazarus.pp
Compiling lazconf.pp
Assembling (pipe) ../units/i386-darwin/lazconf.s
Compiling ideguicmdline.pas
Compiling lazarusidestrconsts.pas
Writing Resource String Table file: lazarusidestrconsts.rst
Assembling (pipe) ../units/i386-darwin/lazarusidestrconsts.s
Compiling idecmdline.pas
Assembling (pipe) ../units/i386-darwin/idecmdline.s
Fatal: Can't find unit CarbonProc used by IDEGuiCmdLine
Fatal: Compilation aborted
make[2]: *** [lazarus] Error 1
make[1]: *** [ide] Error 2
make: *** [ide] Error 2
Rebuilding lazarus from inside lazarus choosing the qt as widgetset ends in same error...

Then i'v tried to leave carbon lazarus as it is and build only a test project with qt, setting LCLWidgetType to qt and enabling linking options -framework Qt4Intf -lobjc -framework Foundation and i got a linking error...
Code: [Select]
TMainIDE.CheckIfProjectNeedsCompilation  Compiler params changed for Project
  Old=" -MObjFPC -Scghi -CirotR -O1 -g -gl  -k-framework -kCarbon -k-framework -kOpenGL -k-dylib_file -k/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -vewnhi -l -Fi/users/fbk/Projects/Tests/TabTest/lib/i386-darwin -Fu/Developer/lazarus/components/virtualtreeview/lib/i386-darwin-carbon -Fu/Developer/lazarus/components/lclextensions-0.4/lib/i386-darwin-carbon -Fu/Developer/lazarus/lcl/units/i386-darwin/carbon -Fu/Developer/lazarus/lcl/units/i386-darwin -Fu/Developer/lazarus/packager/units/i386-darwin -Fu/users/fbk/Projects/Tests/TabTest/ -FU/users/fbk/Projects/Tests/TabTest/lib/i386-darwin/ -dLCL -dLCLcarbon TabTest.lpr"
  Now=" -MObjFPC -Scghi -CirotR -O1 -g -gl  -k-framework -kQt4Intf -k-lobjc -k-framework -kFoundation -vewnhi -l -Fi/users/fbk/Projects/Tests/TabTest/lib/i386-darwin -Fu/Developer/lazarus/components/virtualtreeview/lib/i386-darwin-qt -Fu/Developer/lazarus/components/lclextensions-0.4/lib/i386-darwin-qt -Fu/Developer/lazarus/lcl/units/i386-darwin/qt -Fu/Developer/lazarus/lcl/units/i386-darwin -Fu/Developer/lazarus/packager/units/i386-darwin -Fu/users/fbk/Projects/Tests/TabTest/ -FU/users/fbk/Projects/Tests/TabTest/lib/i386-darwin/ -dLCL -dLCLqt TabTest.lpr"
TCompiler.Compile WorkingDir="/users/fbk/Projects/Tests/TabTest/" CompilerFilename="/usr/local/bin/ppc386" CompilerParams=" -MObjFPC -Scghi -CirotR -O1 -g -gl  -k-framework -kQt4Intf -k-lobjc -k-framework -kFoundation -vewnhi -l -Fi/users/fbk/Projects/Tests/TabTest/lib/i386-darwin -Fu/Developer/lazarus/components/virtualtreeview/lib/i386-darwin-qt -Fu/Developer/lazarus/components/lclextensions-0.4/lib/i386-darwin-qt -Fu/Developer/lazarus/lcl/units/i386-darwin/qt -Fu/Developer/lazarus/lcl/units/i386-darwin -Fu/Developer/lazarus/packager/units/i386-darwin -Fu/users/fbk/Projects/Tests/TabTest/ -FU/users/fbk/Projects/Tests/TabTest/lib/i386-darwin/ -dLCL -dLCLqt TabTest.lpr"
[TCompiler.Compile] CmdLine="/usr/local/bin/ppc386 -B  -MObjFPC -Scghi -CirotR -O1 -g -gl  -k-framework -kQt4Intf -k-lobjc -k-framework -kFoundation -vewnhi -l -Fi/users/fbk/Projects/Tests/TabTest/lib/i386-darwin -Fu/Developer/lazarus/components/virtualtreeview/lib/i386-darwin-qt -Fu/Developer/lazarus/components/lclextensions-0.4/lib/i386-darwin-qt -Fu/Developer/lazarus/lcl/units/i386-darwin/qt -Fu/Developer/lazarus/lcl/units/i386-darwin -Fu/Developer/lazarus/packager/units/i386-darwin -Fu/users/fbk/Projects/Tests/TabTest/ -FU/users/fbk/Projects/Tests/TabTest/lib/i386-darwin/ -dLCL -dLCLqt TabTest.lpr"
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.4.4 [2011/05/01] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Darwin for i386
Compiling TabTest.lpr
Compiling unit1.pas
Assembling (pipe) /users/fbk/Projects/Tests/TabTest/lib/i386-darwin/unit1.s
Assembling (pipe) /users/fbk/Projects/Tests/TabTest/lib/i386-darwin/TabTest.s
Compiling resource /users/fbk/Projects/Tests/TabTest/lib/i386-darwin/TabTest.or
Linking TabTest
ld: framework not found Qt4Intf
An error occurred while linking
Error: Error while linking

What else i need to do?

Lazarus: last SVN, Mac OS X 10.6.4
« Last Edit: September 07, 2011, 10:43:11 am by Shebuka »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Mac + QT + lazarus
« Reply #3 on: September 07, 2011, 10:55:18 am »
Dont build the entire IDE, that just complicates things.

And don't add -framework Qt4Intf -lobjc -framework Foundation. The IDE knows how to add it automatically as far as I remember. That framework does not exist, it was renamed to Qt4Pas which you already installed.

And try again.

It would be great if you can update the wiki tutorial.
« Last Edit: September 07, 2011, 10:57:08 am by felipemdc »

Shebuka

  • Sr. Member
  • ****
  • Posts: 422
Re: Mac + QT + lazarus
« Reply #4 on: September 07, 2011, 12:03:04 pm »
Dont build the entire IDE, that just complicates things.

And don't add -framework Qt4Intf -lobjc -framework Foundation. The IDE knows how to add it automatically as far as I remember. That framework does not exist, it was renamed to Qt4Pas which you already installed.

And try again.
Done, now i have a SygTrap followed by a Exc_Bad_Access errors...

Quote
TMainIDE.CheckIfProjectNeedsCompilation  Src has changed Project /Users/fbk/Projects/Tests/QtTest/main_unit.pas
TCompiler.Compile WorkingDir="/users/fbk/Projects/Tests/QtTest/" CompilerFilename="/usr/local/bin/ppc386" CompilerParams=" -MObjFPC -Scghi -O1 -gl -vewnhi -l -Fi/users/fbk/Projects/Tests/QtTest/lib/i386-darwin -Fu/Developer/lazarus/lcl/units/i386-darwin/qt -Fu/Developer/lazarus/lcl/units/i386-darwin -Fu/Developer/lazarus/packager/units/i386-darwin -Fu/users/fbk/Projects/Tests/QtTest/ -FU/users/fbk/Projects/Tests/QtTest/lib/i386-darwin/ -dLCL -dLCLqt QtTest.lpr"
[TCompiler.Compile] CmdLine="/usr/local/bin/ppc386  -MObjFPC -Scghi -O1 -gl -vewnhi -l -Fi/users/fbk/Projects/Tests/QtTest/lib/i386-darwin -Fu/Developer/lazarus/lcl/units/i386-darwin/qt -Fu/Developer/lazarus/lcl/units/i386-darwin -Fu/Developer/lazarus/packager/units/i386-darwin -Fu/users/fbk/Projects/Tests/QtTest/ -FU/users/fbk/Projects/Tests/QtTest/lib/i386-darwin/ -dLCL -dLCLqt QtTest.lpr"
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.4.4 [2011/05/01] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Darwin for i386
Compiling QtTest.lpr
Compiling main_unit.pas
Assembling (pipe) /users/fbk/Projects/Tests/QtTest/lib/i386-darwin/main_unit.s
Assembling (pipe) /users/fbk/Projects/Tests/QtTest/lib/i386-darwin/QtTest.s
Compiling resource /users/fbk/Projects/Tests/QtTest/lib/i386-darwin/QtTest.or
Linking QtTest
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/forms.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/forms.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/interfacebase.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/interfacebase.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/lclproc.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/lclproc.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/graphtype.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/graphtype.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/fileutil.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/fileutil.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/graphics.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/graphics.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/qt/qtint.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/qt/qtint.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/qt/qt4.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/qt/qt4.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/controls.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/controls.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/controls.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/controls.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/controls.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/controls.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/dialogs.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/dialogs.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/dialogs.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/dialogs.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/comctrls.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/comctrls.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/graphutil.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/graphutil.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/qt/qtwidgets.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/qt/qtwidgets.o
ld: warning: unknown stabs type 0xC0 in /Developer/lazarus/lcl/units/i386-darwin/qt/qtwscontrols.o
ld: warning: unknown stabs type 0xE0 in /Developer/lazarus/lcl/units/i386-darwin/qt/qtwscontrols.o
53 lines compiled, 2.8 sec
2 hint(s) issued
[TCompiler.Compile] end
TMainIDE.DoInitProjectRun ProgramFilename=/users/fbk/Projects/Tests/QtTest/QtTest
[TCmdLineDebugger] Debug PID: 19372
TGDBMIDebugger.ProcessResult Error: ,msg="No symbol table is loaded.  Use the \"file\" command."
[Debugger] Running GDB version: 6.3.50-20050815 (Apple version gdb-1515)
[TDebugger.SetFileName] "/users/fbk/Projects/Tests/QtTest/QtTest.app"
[Debugger] Log output: &"warning: Unable to read symbols for Qt4Pas.framework/Versions/5/Qt4Pas (file not found).\n"
[Debugger] Log output: &"warning: Unable to read symbols from \"Qt4Pas\" (not yet mapped into memory).\n"

[TMainIDE.DoRunProject] B TGDBMIDebugger
TCarbonTabsControl.SetFocus Error: SetKeyboardFocus  failed with result -30585
TCarbonTabsControl.SetFocus Error: SetKeyboardFocus  failed with result -30585
[TMainIDE.DoRunProject] END
TGDBMIDebugger.StartDebugging WorkingDir="/users/fbk/Projects/Tests/QtTest/"
TGDBMIDebugger.ProcessResult Error: ,msg="No symbol \"FPC_THREADVAR_RELOCATE_PROC\" in current context."
[Debugger] Log output: &"info functions FPC_CPUINIT\n"
[Debugger] Log output: &"set width 50000\n"
[Debugger] Log output: &"set inferior-tty /dev/null\n"
[Debugger] Log output: &"info address main\n"
[Debugger] Log output: &"ptype TObject\n"
[Debugger] Log output: &"ptype Exception\n"
[Debugger] Log output: &"ptype Shortstring\n"
[Debugger] Log output: &"ptype pointer\n"
[Debugger] Log output: &"ptype byte\n"
[Debugger] Log output: &"info address FPC_RAISEEXCEPTION\n"
[Debugger] Log output: &"info address FPC_BREAK_ERROR\n"
[Debugger] Log output: &"info address FPC_RUNERROR\n"
[Debugger] Log output: &"info file\n"
[Debugger] File type: mach-o-le
[Debugger] Entry point: 0x00011640
TCarbonTabsControl.SetFocus Error: SetKeyboardFocus  failed with result -30585
TCarbonTabsControl.SetFocus Error: SetKeyboardFocus  failed with result -30585
TCarbonWidgetSet.GetSystemMetrics TODO 76
TCarbonWidgetSet.GetSystemMetrics TODO 77
TCarbonWidgetSet.GetSystemMetrics TODO 76
TCarbonWidgetSet.GetSystemMetrics TODO 77
TCarbonScrollBar.SetFocus Error: SetKeyboardFocus  failed with result -30585
TCarbonScrollBar.SetFocus Error: SetKeyboardFocus  failed with result -30585
TCarbonScrollBar.SetFocus Error: SetKeyboardFocus  failed with result -30585
TCarbonScrollBar.SetFocus Error: SetKeyboardFocus  failed with result -30585
[Debugger] Target PID: 19377
TGDBMIDebugger.ProcessResult Error: ,msg="Undefined mi command: thread-info (missing implementation)"
[WARNING] Debugger: Unknown result class (IGNORING): error"
TCarbonScrollBar.SetFocus Error: SetKeyboardFocus  failed with result -30585
TCarbonScrollBar.SetFocus Error: SetKeyboardFocus  failed with result -30585
TCarbonScrollBar.SetFocus Error: SetKeyboardFocus  failed with result -30585
TGDBMIDebugger.ProcessResult Error: ,msg="Undefined mi command: thread-info (missing implementation)"
[WARNING] Debugger: Unknown result class (IGNORING): error"
TCarbonTabsControl.SetFocus Error: SetKeyboardFocus  failed with result -30585
TCarbonTabsControl.SetFocus Error: SetKeyboardFocus  failed with result -30585
Debugger says that file Qt4Pas is missong inside framework, but it's there, 2.5 MB created 07.07.11.

This missing debugger error is shown only first time, if i try to rebuild it gives a different error:
Code: [Select]
[WARNING] Debugger: Unexpected async-record: =resolve-pending-breakpoint,new_bp="1",pended_bp="1",new_expr="*71620",bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x000117c4",at="<main>",shlib="/Users/fbk/Projects/Tests/QtTest/QtTest.app/Contents/MacOS/QtTest",times="0"}
This is what says the crash report if i launch the test app directly:
Code: [Select]
Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread:  0

Dyld Error Message:
  Library not loaded: QtWebKit.framework/Versions/4/QtWebKit
  Referenced from: /Library/Frameworks/Qt4Pas.framework/Versions/5/Qt4Pas
  Reason: image not found
QtWebKit.framework ??? Where to find it?

Quote
It would be great if you can update the wiki tutorial.
I can think about it as i manage to build a single qt app  :-\
« Last Edit: September 07, 2011, 12:35:33 pm by Shebuka »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7822
Re: Mac + QT + lazarus
« Reply #5 on: September 07, 2011, 01:37:31 pm »
Sounds like the installed QT and the qtpas headers don't version match. The webkit framework was added in newer QT versions

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Mac + QT + lazarus
« Reply #6 on: September 07, 2011, 02:24:42 pm »
Sounds like the installed QT and the qtpas headers don't version match. The webkit framework was added in newer QT versions

WebKit was added years ago, and Qt and Qt4Pas don't have to match exactly. Qt is backwards compatible.

Quote
QtWebKit.framework ??? Where to find it?

Did you install the Qt framework? There is a huge package in the Qt Nokia website which you can use. It install everything, including QtWebKit:

http://qt.nokia.com/downloads/

"Qt libraries 4.7.4 for Mac"

Shebuka

  • Sr. Member
  • ****
  • Posts: 422
Re: Mac + QT + lazarus
« Reply #7 on: September 07, 2011, 03:18:20 pm »
Quote
Quote
QtWebKit.framework ??? Where to find it?

Did you install the Qt framework? There is a huge package in the Qt Nokia website which you can use. It install everything, including QtWebKit:

http://qt.nokia.com/downloads/

"Qt libraries 4.7.4 for Mac"
No, i'v not installed it because in the tutorial it was the second step, that i skipped because used binaries...
Now all works, thank you :)

But it hasn't much of OS X look (by default)... like buttons that must have rounded borders are square, in forms title bar there is application icon and buttons/radio/check_boxes can gain focus... Turning on Autosize helps (btn3 and toggle1 are autosized) but I can't turn off the Focus gain (tried to make False the TabStop property).

Still, if Carbon goes down in some time (it's like 10 years that it's deprecated and not supported by Apple, and knowing how easy Apple cut with past it's not an impossible cut), we have a valid alternative.
« Last Edit: September 07, 2011, 03:21:13 pm by Shebuka »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Mac + QT + lazarus
« Reply #8 on: September 07, 2011, 03:30:05 pm »
The square buttons are a native look from Aqua (the look of both Carbon and Cocoa). Amazing how many people think they are not native.

The Focus gain is more friendly for accessibility.

> Still, if Carbon goes down in some time (it's like 10 years that it's deprecated and not supported by Apple

Not really, Carbon had large additions in Mac OS X 10.4, that's why Lazarus with Carbon requires 10.4+, because it uses the new GUI objects introduced in 10.4. Apple deprecated Carbon in Mac OS X 10.5, which is maybe 2 years ago.

There is a Cocoa interface in Lazarus, but it still lacks many basic features.
« Last Edit: September 07, 2011, 03:37:58 pm by felipemdc »

Shebuka

  • Sr. Member
  • ****
  • Posts: 422
Re: Mac + QT + lazarus
« Reply #9 on: September 07, 2011, 04:10:16 pm »
The square buttons are a native look from Aqua (the look of both Carbon and Cocoa). Amazing how many people think they are not native.
I have seen square buttons with slightly rounded angles, but the button1 has 'acute' angles, like toggle box and speedbutton of carbon.

Quote
The Focus gain is more friendly for accessibility.
If you look in system preference all buttons are round and doesn't gain focus. Neither radio buttons nor check box. Is there a way to make qt has same apple's behavior?

Quote
Quote
Still, if Carbon goes down in some time (it's like 10 years that it's deprecated and not supported by Apple
Not really, Carbon had large additions in Mac OS X 10.4, that's why Lazarus with Carbon requires 10.4+, because it uses the new GUI objects introduced in 10.4. Apple deprecated Carbon in Mac OS X 10.5, which is maybe 2 years ago.

There is a Cocoa interface in Lazarus, but it still lacks many basic features.
But Qt is 32/64bit, so there is a way to use it for make a 64bit Lazarus that creare 64bit applications?

And is there a way to use 'appkit' under Qt?
« Last Edit: September 07, 2011, 04:52:23 pm by Shebuka »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Mac + QT + lazarus
« Reply #10 on: September 07, 2011, 06:43:07 pm »
Qt is a custom-drawn widgetset, it is not supposed to be native. It just kind of immitates native, but not perfectly.

But all square buttons in LCL-Carbon are 100% native, that's just how Aqua draws buttons. If they are small they are round, if they are bigger then X pixels then they are square.

Quote
But Qt is 32/64bit, so there is a way to use it for make a 64bit Lazarus that creare 64bit applications?

You don't need a 64-bits Lazarus to create 64-bits applications. But in general yes, you should be able to obtain a 64-bits Lazarus with Carbon, but as you tried you have found a compilation error. It seams that part of the IDE supposes that Carbon is used under Mac OS X, looks like a bug.

Quote
And is there a way to use 'appkit' under Qt?

This is a confusing question. How do you want to use it? Appkit is part of the Cocoa framework, which is used by Qt.

Shebuka

  • Sr. Member
  • ****
  • Posts: 422
Re: Mac + QT + lazarus
« Reply #11 on: September 08, 2011, 12:29:40 pm »
Qt is a custom-drawn widgetset, it is not supposed to be native. It just kind of immitates native, but not perfectly.

But all square buttons in LCL-Carbon are 100% native, that's just how Aqua draws buttons. If they are small they are round, if they are bigger then X pixels then they are square.
I have tried to build my main app with Qt disabling appkit related code with ifdef lclcarbon and it look pretty bad... Look at attached screens. Can I consider this inconsistence's in look and feel compared to native carbon as lcl bug to be corrected (i think it's more like different default values... or default autoresize options for like bitbutton and speedbutton)

Quote
Quote
But Qt is 32/64bit, so there is a way to use it for make a 64bit Lazarus that creare 64bit applications?

You don't need a 64-bits Lazarus to create 64-bits applications. But in general yes, you should be able to obtain a 64-bits Lazarus with Carbon, but as you tried you have found a compilation error. It seams that part of the IDE supposes that Carbon is used under Mac OS X, looks like a bug.
So I can build 64bit Qt App with 32bit Carbon Lazarus, good to know :)

Quote
Quote
And is there a way to use 'appkit' under Qt?

This is a confusing question. How do you want to use it? Appkit is part of the Cocoa framework, which is used by Qt.
I'm using NSApp var initialized to NSSharedApplication for two things, deactivate self (to make the app i launch on button press become active) and cause the application icon to bounce in the dock.
For icon to bounce in the dock i'v searching in Qt docs and found this function QApplication_alert(widget: QWidgetH; duration: Integer = 0) but don't know where to get the widget.
Found nothing for deactivating...

Shebuka

  • Sr. Member
  • ****
  • Posts: 422
Re: Mac + QT + lazarus
« Reply #12 on: September 08, 2011, 05:09:32 pm »
It would be great if you can update the wiki tutorial.
Done ;)
C&C are welcome, this is my first wiki :D
http://wiki.lazarus.freepascal.org/Qt_Interface_Mac

p.s. for peoples that doesn't know, C&C is critiques and comments