Qt: Difference between revisions

From 太極
Jump to navigation Jump to search
Line 54: Line 54:
* [https://www.youtube.com/watch?v=d0CDMtfefB4 Qt mouse even on QLabel by Saeed Ghoassy] OR http://www.codeprogress.com/cpp/libraries/qt/qtClasses.php?item=QMouseEvent
* [https://www.youtube.com/watch?v=d0CDMtfefB4 Qt mouse even on QLabel by Saeed Ghoassy] OR http://www.codeprogress.com/cpp/libraries/qt/qtClasses.php?item=QMouseEvent
* [https://www.youtube.com/watch?v=T-_6-8NN35c Qt C++ drawing mouse event by redbear8174]
* [https://www.youtube.com/watch?v=T-_6-8NN35c Qt C++ drawing mouse event by redbear8174]
* Qt + histogram, scatterplot, contour plot,... by -http://qwt.sourceforge.net/ Qwt]


= Qt Basic =
= Qt Basic =

Revision as of 15:00, 13 May 2013

Uses

Download of 4.x and 5.x version

http://download.qt-project.org/official_releases/

For example, the source code for 5.0.1 can be downloaded from http://download.qt-project.org/official_releases/qt/5.0/5.0.1/single/

How to distribute Qt application

In my first example of GUI with button & label, I need to put 7 dll files in the same exe directory.

  • icudt49.dll (17MB)
  • icuin49.dll (1.3MB)
  • icuuc49.dll (1MB)
  • Qt5Cored.dll (7MB)
  • Qt5Guid.dll (5.5MB)
  • Qt5Widgets.dll (4MB)
  • Qt5Widgetsd.dll (7.5MB)

Google: how to reploy application on windows, how to build qt contains all dll static on windows

How to Build static Qt on Windows

My experience based on Qt 5.0.2

  • read ReadME file to download perl, python and ruby. Make sure the executable path in in PATH env variable.
  • OpenGL requirement: DirectX SDK The 6/7/2010 version is about 572MB. This will be installed to C:\Program Files (x86)\Microsoft DirectX SDK(June 2010) directory.
  • modify mkspecs by searching qmake.conf. It was found in C:\Qt\qt-everwhere-opensource-src-5.0.2\qtbase\mkspecs\win32-msvc2010
  • configure -static -release -platform win32-msvc2010 -opengl desktop

Qt Creator

Qt Tutorial

Qt Basic

QLabel *label = new QLabel("ABCDE");
label->show();
// (*label).show();
  • Use :: to call a function from some class. For example,
QObject::connect();

means to use connect() function from QObject class.