Re: [Interest] Installation Sizes for Applications using Qt

2021-08-30 Thread Henry Skoglund

On 2021-08-30 21:43, Thiago Macieira wrote:

On Monday, 30 August 2021 12:23:54 PDT Henry Skoglund wrote:

Thanks Thiago for the clarification re. those "-skip xxx" options. I
guess I can skip them :-)
Ok, one benefit remains: saving some time when compiling/building the
static Qt version.

Indeed. But you could save time by just downloading qtbase too. Then you save
time in the download, time in the build as well as disk space.


Riddle me this though:
for 5.15.2 I built 2 MSVC versions: one with built-in SSL 1.1.1K support
and one without.
When I build a hello world widget app, the .exe file without SSL lands
at 10541 kB but the one *with* SSL 1.1.1K support is 10531 kB. Why is
the .exe file with more functionality smaller??

I assume you're not using QSslSocket or any of the classes that would
indirectly use it (QNetworkAccessManager), otherwise that makes no sense. As
in, it doesn't make sense to support HTTP only, not HTTPS.

I can't account for the difference. If I needed to know this, I'd inspect the
linker map to find out what got linked in.

Which means "don't use MSVC's link.exe"



Re: downloads, you're right, but you forgot the noob factor, I use no 
fancy git get, I download the humongous zip: 
http://download.qt.io/official_releases/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.zip


Re: QsslSocket usage: no it's not pulled in in either of the 2 versions. 
(If I try them with the SecureSocketClient example, one runs ok and the 
other fails to compile with "required feature ssl ... not available). I 
was just curious how the static lib with SSL support yields sliighly 
smaller .exe files.  But a linker map and some coffee is a good idea...


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Installation Sizes for Applications using Qt

2021-08-30 Thread Thiago Macieira
On Monday, 30 August 2021 12:23:54 PDT Henry Skoglund wrote:
> Thanks Thiago for the clarification re. those "-skip xxx" options. I
> guess I can skip them :-)
> Ok, one benefit remains: saving some time when compiling/building the
> static Qt version.

Indeed. But you could save time by just downloading qtbase too. Then you save 
time in the download, time in the build as well as disk space.

> Riddle me this though:
> for 5.15.2 I built 2 MSVC versions: one with built-in SSL 1.1.1K support
> and one without.
> When I build a hello world widget app, the .exe file without SSL lands
> at 10541 kB but the one *with* SSL 1.1.1K support is 10531 kB. Why is
> the .exe file with more functionality smaller??

I assume you're not using QSslSocket or any of the classes that would 
indirectly use it (QNetworkAccessManager), otherwise that makes no sense. As 
in, it doesn't make sense to support HTTP only, not HTTPS.

I can't account for the difference. If I needed to know this, I'd inspect the 
linker map to find out what got linked in.

Which means "don't use MSVC's link.exe"

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Installation Sizes for Applications using Qt

2021-08-30 Thread Henry Skoglund

On 2021-08-30 20:48, Thiago Macieira wrote:

On Monday, 30 August 2021 10:32:03 PDT Henry Skoglund wrote:

configure that has a "-skip " for all
modules expect qtbase.

That makes zero difference in your final binary.

If you need a library that wasn't compiled, your application will fail to
link. If you have a library that your application doesn't link to, it won't be
linked to.

The convenience "-skip" option to the top-level configure is not at all the
same as the feature system that we're discussing.


When using MinGW 8.1.0 the .exe size is 19151 kB and when using MSVC2019
it becomes 11616 kB, i.e. 40% smaller.

Do note that both QtCore and QtGui are compiled with -O3, which expands code
size, when using GCC or Clang. There's no equivalent option to MSVC. You may
want to disable this feature too and stick to -O2.

You may also want to optimise for size, at the expense of runtime performance.
That's usually not worth it.

Thanks Thiago for the clarification re. those "-skip xxx" options. I 
guess I can skip them :-)
Ok, one benefit remains: saving some time when compiling/building the 
static Qt version.


Re. compiler options, I'm too lazy and just go with the default settings 
that Qt gives me, and since they provided a 40% decrease of the final 
.exe size when switching to MSVC I'm happy.


Riddle me this though:
for 5.15.2 I built 2 MSVC versions: one with built-in SSL 1.1.1K support 
and one without.
When I build a hello world widget app, the .exe file without SSL lands 
at 10541 kB but the one *with* SSL 1.1.1K support is 10531 kB. Why is 
the .exe file with more functionality smaller??


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Installation Sizes for Applications using Qt

2021-08-30 Thread Thiago Macieira
On Monday, 30 August 2021 10:32:03 PDT Henry Skoglund wrote:
> configure that has a "-skip " for all
> modules expect qtbase.

That makes zero difference in your final binary.

If you need a library that wasn't compiled, your application will fail to 
link. If you have a library that your application doesn't link to, it won't be 
linked to.

The convenience "-skip" option to the top-level configure is not at all the 
same as the feature system that we're discussing.

> When using MinGW 8.1.0 the .exe size is 19151 kB and when using MSVC2019
> it becomes 11616 kB, i.e. 40% smaller.

Do note that both QtCore and QtGui are compiled with -O3, which expands code 
size, when using GCC or Clang. There's no equivalent option to MSVC. You may 
want to disable this feature too and stick to -O2.

You may also want to optimise for size, at the expense of runtime performance. 
That's usually not worth it.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Installation Sizes for Applications using Qt

2021-08-30 Thread Henry Skoglund

On 2021-08-30 18:15, Thiago Macieira wrote:

On Monday, 30 August 2021 04:04:42 PDT Joerg Bornemann wrote:

Use configure -list-features and pick something you definitely don't
need, for example
lcdnumber  Widgets: Provides LCD-like digits.
and configure and build Qt with -no-feature-lcdnumber

That's probably not a good example, since the LCD number widget (the oldest
widget in Qt, aside from QWidget itself, because Qt had no font support yet
when this class was created) is fairly self-contained.

Anyway, there are a couple of suggestions in this thread to make the
application even smaller.

But it won't be tiny. That's just not in the cards.


Hi, also the choice of compiler can influence the size of the executable.
For example, on Windows I have a LOB Qt 5.15.2 Widgets-only app that I 
build statically, with a configure that has a "-skip " for all 
modules expect qtbase.
When using MinGW 8.1.0 the .exe size is 19151 kB and when using MSVC2019 
it becomes 11616 kB, i.e. 40% smaller.


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] "Activate your 10-day Qt 6 evaluation now"

2021-08-30 Thread David M. Cotter
I have an app heavily dependent on Multimedia.

it took me about a week and a half total

i created a header "Qt6Bridge.h" that defines a bunch of stuff one way or 
another depending on qt5 or qt6 (have to keep qt5 build alive until Qt6 has all 
the functionality in need).

eg:

#ifndef _H_Qt6Bridge
#define _H_Qt6Bridge

#if _QT_
#include "CFUtils.h"
#include 

#if _QT6_
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

typedef QVideoFrameFormat   QtVideoFrameFormat;
typedef QVideoFrameFormat::PixelFormat  QtVideoFramePixFormat;

typedef QVideoSink  QtAbstractVideoSurface;

#define getVideoSurface()   videoSink()
#define getAvailableVideoDevices()  QMediaDevices::videoInputs()
#define setMediaSoure   setSource
#define QMediaPlayer_PlaybackState  QMediaPlayer::PlaybackState
#define getPlaybackState()  playbackState()

// 
typedef QAudioDeviceQtAudioDevice;

typedef QAudioDevice::Mode  QtAudioDeviceMode;
#define QtAudioDeviceMode_Input QAudioDevice::Input
#define QtAudioDeviceMode_OutputQAudioDevice::Output

QList 
getAvailableAudioDevices(QtAudioDeviceMode ioMode);
#define getDefaultAudioDevice() 
QMediaDevices::defaultAudioOutput()

#define QAudioFormat_SampleType QAudioFormat::SampleFormat
#define getSampleType() sampleFormat()
#define getSupportedSampleTypes()   supportedSampleFormats()
#define bitsPerSample() bytesPerSample() * 8

typedef QAudioSink  QtAudioSink;

namespace QSound {
voidplay(const QString& path);
};

// 
typedef QCameraDevice   QtCameraDevice;

// 
#define getDeviceName() description()

#else   //  _QT6_
#include 
#include 
#include 
#include 
#include 

typedef QVideoSurfaceFormat QtVideoFrameFormat;
typedef QVideoFrame::PixelFormatQtVideoFramePixFormat;

typedef QAbstractVideoSurface   QtAbstractVideoSurface;

#define getVideoSurface()   videoSurface()
#define getAvailableVideoDevices()  QCameraInfo::availableCameras()
#define setMediaSoure   setMedia
#define QMediaPlayer_PlaybackState  QMediaPlayer::State
#define getPlaybackState()  state()

// 
typedef QAudioDeviceInfoQtAudioDevice;

typedef QAudio::ModeQtAudioDeviceMode;
#define QtAudioDeviceMode_Input QAudio::AudioInput
#define QtAudioDeviceMode_OutputQAudio::AudioOutput

#define getAvailableAudioDevices(_type) 
QAudioDeviceInfo::availableDevices(_type)
#define getDefaultAudioDevice() 
QAudioDeviceInfo::defaultOutputDevice()

#define QAudioFormat_SampleType QAudioFormat::SampleType
#define getSampleType() sampleType()
#define getSupportedSampleTypes()   supportedSampleTypes()
#define bitsPerSample() sampleSize()

typedef QAudioOutputQtAudioSink;
// 
typedef QCameraInfo QtCameraDevice;

// 
#define getDeviceName() deviceName()
#endif  //  !_QT6_

#endif  //  _QT_
#endif  // _H_Qt6Bridge

I also had to write my own "QVideoFrame_fromImage()" cuz that func no longer 
exists

the rest was working around the fact that you can't multiplex video frames any 
more:
https://bugreports.qt.io/browse/QTBUG-95127
https://bugreports.qt.io/browse/QTBUG-95542

and i'm waiting still on the ability to get predictable audio samples from the 
decoder:
https://bugreports.qt.io/browse/QTBUG-95766



> On Aug 30, 2021, at 9:30 AM, Nuno Santos  wrote:
> 
> Thiago,
> 
> Thanks for the clarification.
> 
> I was convinced that qmake was not available anymore. My bad! :/
> 
> Still, I think 10 days of evaluation is a really short period of time.
> 
> I would love to hear feedback from people who have started porting their 
> software to Qt 6 and how the effort of such migration.
> 
> Regards,
> 
> Nuno
> 
>> On 30 Aug 2021, at 17:16, Thiago Macieira  wrote:
>> 
>> On Monday, 30 August 2021 04:22:52 PDT Nuno Santos wrote:
>>> I would say that taking into account the fact that Qt has a new building
>>> system and qmake is not available anymore, porting an existing project
>>> takes 

Re: [Interest] "Activate your 10-day Qt 6 evaluation now"

2021-08-30 Thread Nuno Santos
Thiago,

Thanks for the clarification.

I was convinced that qmake was not available anymore. My bad! :/

Still, I think 10 days of evaluation is a really short period of time.

I would love to hear feedback from people who have started porting their 
software to Qt 6 and how the effort of such migration.

Regards,

Nuno

> On 30 Aug 2021, at 17:16, Thiago Macieira  wrote:
> 
> On Monday, 30 August 2021 04:22:52 PDT Nuno Santos wrote:
>> I would say that taking into account the fact that Qt has a new building
>> system and qmake is not available anymore, porting an existing project
>> takes much more than 10 days.
> 
> That's incorrect. qmake is still available.
> 
> -- 
> Thiago Macieira - thiago.macieira (AT) intel.com
>  Software Architect - Intel DPG Cloud Engineering
> 
> 
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] "Activate your 10-day Qt 6 evaluation now"

2021-08-30 Thread Thiago Macieira
On Monday, 30 August 2021 04:22:52 PDT Nuno Santos wrote:
> I would say that taking into account the fact that Qt has a new building
> system and qmake is not available anymore, porting an existing project
> takes much more than 10 days.

That's incorrect. qmake is still available.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Installation Sizes for Applications using Qt

2021-08-30 Thread Thiago Macieira
On Monday, 30 August 2021 04:04:42 PDT Joerg Bornemann wrote:
> Use configure -list-features and pick something you definitely don't
> need, for example
> lcdnumber  Widgets: Provides LCD-like digits.
> and configure and build Qt with -no-feature-lcdnumber

That's probably not a good example, since the LCD number widget (the oldest 
widget in Qt, aside from QWidget itself, because Qt had no font support yet 
when this class was created) is fairly self-contained.

Anyway, there are a couple of suggestions in this thread to make the 
application even smaller.

But it won't be tiny. That's just not in the cards.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] "Activate your 10-day Qt 6 evaluation now"

2021-08-30 Thread ich
Am 30. August 2021 11:22:52 UTC schrieb Nuno Santos :
>Hi,
>
>What do you do with a 10 days evaluation of Qt 6?
>
>I would say that taking into account the fact that Qt has a new building 
>system and qmake is not available anymore, porting an existing project takes 
>much more than 10 days.
>
>Any feedback from users that have already tried Qt 6 and are porting their 
>apps to it?
>
>Best regards,
>
>Nuno
>
>
>___
>Interest mailing list
>Interest@qt-project.org
>https://lists.qt-project.org/listinfo/interest

I'd like to rephrase:
Why not, in which cases, use lgpl license?

Alex
-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] "Activate your 10-day Qt 6 evaluation now"

2021-08-30 Thread Nuno Santos
Hi,

What do you do with a 10 days evaluation of Qt 6?

I would say that taking into account the fact that Qt has a new building system 
and qmake is not available anymore, porting an existing project takes much more 
than 10 days.

Any feedback from users that have already tried Qt 6 and are porting their apps 
to it?

Best regards,

Nuno


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Installation Sizes for Applications using Qt

2021-08-30 Thread Joerg Bornemann

On 8/28/21 3:02 AM, Ben Cottrell wrote:

Yes, I've tried configure with these command line arguments:
./configure -opensource -confirm-license -platform linux-g++ -prefix
/opt/6.1.2-linux-g++-static -static


However, you did not disable any of Qt's features, like Thiago suggested.

Use configure -list-features and pick something you definitely don't 
need, for example

lcdnumber  Widgets: Provides LCD-like digits.
and configure and build Qt with -no-feature-lcdnumber


Joerg
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Installation Sizes for Applications using Qt

2021-08-30 Thread Cristian Adam

On 8/28/2021 3:02 AM, Ben Cottrell wrote:

Yes, I've tried configure with these command line arguments:
./configure -opensource -confirm-license -platform linux-g++ -prefix
/opt/6.1.2-linux-g++-static -static

I got lots of errors after running configure, about missing XCB
libraries, so following the Ubuntu CI script, I installed them with:
apt install "^libxcb.*"

I installed this on Debian 11.

I managed to build a test project with cmake containing this code:
cmake_minimum_required(VERSION 3.20)
project(untitled)

set(CMAKE_CXX_STANDARD 17)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_LINKER ld.gold)

set(CMAKE_PREFIX_PATH "/opt/6.1.2-linux-g++-static/lib/cmake")

find_package(Qt6 COMPONENTS

Core
Gui
Widgets
REQUIRED)

add_executable(untitled main.cpp)

target_link_libraries(untitled
Qt::Core
Qt::Gui
Qt::Widgets
)

Here's the source to main.cpp:
#include 
#include 

int main(int argc, char *argv[]) {

QApplication a(argc, argv);
QPushButton button("Hello world!", nullptr);
button.resize(200, 100);
button.show();
return QApplication::exec();
}

Afterwards, I used strip on untitled, reducing the size to 16MB. If I
give it to people, I'll provide the object file if they want to relink
it.



If you want to reduce the size of your binary you might consider using
-ltcg (Link time code generation) when building Qt.

See https://www.qt.io/blog/2019/01/02/qt-applications-lto for more 
information.


And, for your application have set(CMAKE_INTERPROCEDURAL_OPTIMIZATION 
ON) in your CMakeLists.txt file.


You might want to test first with your application, and afterwards with 
application and Qt.


The gain should be something like ~15% size decrease, which should get 
your application down to 13.6MB


Cheers,
Cristian.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest