1 Codebase. 5 Platforms. From scratch.

@NagleCode
Qt.io

Free

Free-ish

Qt Licensing

  LGPL
Free  
  GPL
Free  
  Paid
$350/mo  
Win/Mac/Linux
iOS
Android

• Develop before you buy

• iTunes not compatible with GPL

Why Qt for Desktop?

WindowsMacUbuntu
  • Free
  • 20 years
  • Target all with one code base
  • With LGPL, your source stays closed

BSidesHuntsville.org

Feb 6, 2016

Dynetics - 1004 Explorer Blvd, Huntsville, AL


CFP Opens after Barcamp!

Podcast Launches Oct 5th!

Live Demo

A Calculator App for:

  • Mac
  • Ubuntu
  • Android
  • iOS
  • Windows

Signals and Slots

  • Event-driven development
    • Emit signal
    • Listen with slots

connect(sender, SIGNAL(valueChanged(QString,QString)),
	receiver, SLOT(updateValue(QString)) );

QObject::connect(&a, &MyObject::valueChanged,
	&b, &MyObject::setValue);
					
  • You can create your own
  • Windows Distribution

    Gather Frameworks

    
    						windeployqt.exe  MyProject.exe
    						

    Inno Setup

    
    	; Script generated by the Inno Setup Script Wizard.
    ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
    
    #define MyAppName "Packet Sender"
    #define MyAppVerName "Packet Sender for Windows"
    #define MyAppPublisher "Dan Nagle"
    #define MyAppURL "http://PacketSender.com/"
    #define MyAppExeName "PacketSender.exe"
    #define InstallDir "Packet Sender"
    #define GroupName "Packet Sender"
    #define MyDateTimeString GetDateTimeString('yyyy-mm-dd', '', ''); 
    ;#define VcPPredist "vcredist_x86.exe"
    
    
    [Setup]
    ; NOTE: The value of AppId uniquely identifies this application.
    AppId={{0CB04980-86BE-4CB4-8D74-F2EC5211B18C}}
    AppName={#MyAppName}
    AppVerName={#MyAppVerName}
    AppPublisher={#MyAppPublisher}
    AppPublisherURL={#MyAppURL}
    AppSupportURL={#MyAppURL}
    AppUpdatesURL={#MyAppURL}
    DefaultDirName={pf}\PacketSender
    DefaultGroupName={#GroupName}
    OutputDir=installer
    OutputBaseFilename=PacketSender_{#MyDateTimeString}
    SetupIconFile=q5mingw\pslogo.ico
    ;LicenseFile=q5mingw\gpl-2.0.txt    
    VersionInfoVersion =2015.04.19
    ;only xp
    ;OnlyBelowVersion= 6.0
    
    Compression=lzma2/ultra64
    ;needed if no compression
    ;DiskSpanning = "yes"
    ;Compression=none
    AlwaysRestart = "no"
    
    
    ;is the 2010 VC redist installed?
    [Code]
    function FrameworkIsNotInstalled: Boolean;
    begin
      Result := not RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\DevDiv\VC\Servicing\11.0');
    end;
    
    [Languages]
    Name: English; MessagesFile: compiler:Default.isl
    
    
    [Tasks]
    Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons};
    
    [Files]
    Source: q5mingw\*; DestDir: {app}; Flags: ignoreversion
    Source: q5mingw\platforms\*; DestDir: {app}\platforms; Flags: ignoreversion
    Source: q5mingw\iconengines\*; DestDir: {app}\iconengines; Flags: ignoreversion
    Source: q5mingw\imageformats\*; DestDir: {app}\imageformats; Flags: ignoreversion
    
    
    [Icons]
    Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}
    Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon
    
    [Icons]
    Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName};
    Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName};  IconFilename: {app}\pslogo.ico; Tasks: desktopicon
    
    [Run]      
    ;Filename: {app}\{#VcPPredist}; Parameters : "/qb";Check:FrameworkIsNotInstalled; 
    Filename: {app}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall skipifsilent
    
    
    
    
    	
    • Open Source MIT-like license
    • Around for 17 years
    • Compiles to single EXE

    Mac Distribution

    Gather frameworks

    
    							./macdeployqt MyProject.app
    							
    
    								hdiutil convert InstallTemplate.dmg -format UDZO -imagekey \
    								 zlib-level=9 -o MyApp.dmg
    							

    Background image hidden inside .background/ directory

    Zero effort
    MyProject.app → MyProject.dmg

    
    					hdiutil create MyProject.dmg -volname "My Project" -format UDZO \
    					 -imagekey zlib-level=9 -srcfolder MyProject.app
    							

    Questions?

    DanNagle.com
    @NagleCode