Qt 5.0 For Mac

2020. 2. 11. 23:59카테고리 없음

  1. Qt 5.0 For Mac Download

This file outlines known issues and possible workarounds when using Qt for Mac OS X. Contact Qt's technical support team if you find additional issues which are not covered here. (See also the document.) GUI Applications Mac OS X handles most applications as 'bundles'. A bundle is a directory structure that groups related files together (e.g., widgets.app/).

GUI applications in particular must be run from a bundle or by using the open(1), because Mac OS X needs the bundle to dispatch events correctly, as well as for accessing the menu bar. If you are using older versions of GDB you must run with the full path to the executable. Later versions allow you to pass the bundle name on the command line.

Painting Mac OS X always double buffers the screen so the Qt::WAPaintOnScreen attribute has no effect. Also it is impossible to paint outside of a paint event so Qt::WAPaintOutsidePaintEvent has no effect either. Library Support Qt libraries as frameworks By default, Qt is built as a set of frameworks. Frameworks is the Mac OS X 'preferred' way of distributing libraries. There are definite advantages to using them. See for more information. In general, this shouldn't be an issue because qmake takes care of the specifics for you.

The discusses issues to keep in mind when choosing frameworks over the more typical, dynamic libraries. However, one point to remember is: Frameworks always link with 'release' versions of libraries. If you actually want to use a debug version of a Qt framework, you must ensure that your application actually loads that debug version.

Though we will use Qt Creator for our programs in CS 106B, Mac OS X requires you to install their Xcode system to get a C++ compiler on your machine.

This is often done by using the DYLDIMAGESUFFIX environment variables, but that way often doesn't work so well. Instead, you can temporarily swap your debug and release versions, which is documented in. If you don't want to use frameworks, simply configure Qt with -no-framework. Bundle-Based Libraries If you want to use some dynamic libraries in your Mac OS X application bundle (the application directory), create a subdirectory named 'Frameworks' in the application bundle directory and place your dynamic libraries there. The application will find a dynamic library if it has the install name @executablepath/./Frameworks/libname.dylib.

If you use qmake and Makefiles, use the QMAKELFLAGSSONAME setting: QMAKELFLAGSSONAME = -Wl,-installname,@executablepath/./Frameworks/ Alternatively, you can modify the install name using the installnametool(1) on the command line. See its manpage for more information.

Note that the DYLDLIBRARYPATH environment variable will override these settings, and any other default paths, such as a lookup of dynamic libraries inside /usr/lib and similar default locations. Combining Libraries If you want to build a new dynamic library combining the Qt 4 dynamic libraries, you need to introduce the ld -r flag. Then relocation information is stored in the output file, so that this file could be the subject of another ld run. This is done by setting the -r flag in the.pro file, and the LFLAGS settings.

Initialization Order dyld(1) calls global static initializers in the order they are linked into your application. If a library links against Qt and references globals in Qt (from global initializers in your own library), be sure to link your application against Qt before linking it against the library. Otherwise the result will be undefined because Qt's global initializers have not been called yet.

Qt 5.0 For Mac Download

Compile-Time Flags The follewing flags are helpful when you want to define Mac OS X specific code:. is defined when Qt detects you are on a Darwin-based system (including the Open Source version). QWSMAC is defined when the Mac OS X GUI is present. QTMACUSECOCOA is defined when Qt is built to use the Cocoa framework. If it is not present, then Qt is using Carbon.

A additional flag, is defined as a convenience whenever is defined. If you want to define code for specific versions of Mac OS X, use the availability macros defined in /usr/include/AvailabilityMacros.h. See for information on runtime version checking. Mac OS X Native API Access Accessing the Bundle Path The Mac OS X application is actually a directory (ending with.app). This directory contains sub-directories and files.

It may be useful to place items (e.g. Plugins, online-documentation, etc.) inside this bundle. You might then want to find out where the bundle resides on the disk. The following code returns the path of the application bundle: #ifdef QWSMAC CFURLRef appUrlRef = CFBundleCopyBundleURL(CFBundleGetMainBundle); CFStringRef macPath = CFURLCopyFileSystemPath(appUrlRef, kCFURLPOSIXPathStyle); const char.pathPtr = CFStringGetCStringPtr(macPath, CFStringGetSystemEncoding); ( 'Path =%s', pathPtr); CFRelease(appUrlRef); CFRelease(macPath); #endif Note: When OS X is set to use Japanese, a bug causes this sequence to fail and return an empty string. Therefore, always test the returned string.

For more information about using the CFBundle API, see. Note: can be used to determine the path of the binary within the bundle. Translating the Application Menu and Native Dialogs The items in the Application Menu will be merged correctly for your localized application, but they will not show up translated until you to the application bundle. The main thing you need to do is create a file called locversion.plist. Here is an example for Norwegian: LprojCompatibleVersion 123 LprojLocale no LprojRevisionLevel 1 LprojVersion 123 Now when you run the application with your preferred language set to Norwegian, you should see menu items like 'Avslutt' instead of 'Quit'. User Interface Right-Mouse Clicks If you want to provide right-mouse click support for Mac OS X, use the class.

This will map to a context menu event, i.e., a menu that will display a pop-up selection. This is the most common use of right-mouse clicks, and maps to a control-click with the Mac OS X one-button mouse support. Menu Bar Qt will automatically detect your menu bars for you and turn them into Mac native menu bars. Fitting this into your existing Qt application will normally be automatic. However, if you have special needs, the Qt implementation currently selects a menu bar by starting at the active window (i.e. ) and applying the following tests:.

Qt 5.0 for mac free

If the window has a, then it is used. If the window is modal, then its menu bar is used. If no menu bar is specified, then a default menu bar is used (as documented below). If the window has no parent, then the default menu bar is used (as documented below).

These tests are followed all the way up the parent window chain until one of the above rules is satisifed. If all else fails, a default menu bar will be created.

Note the default menu bar on Qt is an empty menu bar. However, you can create a different default menu bar by creating a parentless. The first one created will be designated the default menu bar and will be used whenever a default menu bar is needed. Note that using native menu bars introduces certain limitations on Qt classes. See the below for more information about these. Special Keys To provide the expected behavior for Qt applications on Mac OS X, the Qt::Meta, Qt::MetaModifier, and Qt::META enum values correspond to the Control keys on the standard Macintosh keyboard, and the Qt::Control, Qt::ControlModifier, and Qt::CTRL enum values correspond to the Command keys.

Limitations Menu Actions. Actions in a with accelerators that have more than one keystroke will not display correctly, when the is translated into a Mac native menu bar. The first key will be displayed. However, the shortcut will still be activated as on all other platforms. objects used in the native menu bar are not able to handle Qt events via the normal event handlers.

For Carbon, you will have to install a Carbon event handler on the menu bar in order to receive Carbon events that are similar to,. For Cocoa, you will have to install a delegate on the menu itself to be notified of these changes. Alternatively, consider using the and signals to keep track of menu visibility; these provide a solution that should work on all platforms supported by Qt. Native Widgets Qt has support for sheets and drawers, represented in the window flags by Qt::Sheet and Qt::Drawer respectiviely. Brushed metal windows can also be created by using the Qt::WAMacMetalStyle window attribute.