Plugin on the Qt5 -
Locky - 13.08.2014
Warning! I am Russian and my English very bad, therefore i use translate.******.com.
Warning 2! You should read the topic: Plugin development guide
Why Qt?
+ crossplatform development
+ convenient tools
But!
- this requires adjustment SDK
- i don't testing this on Linux
- i testing this only with mingw32 compiler
Step 0. Install Qt 5 (i use 5.2.1)
Qt Project Home
Download Qt library and Qt Creator (I use mingw32)
Step 1. Create new project
File -> New File or Project -> Libraries -> C++ Library

Step 2. Add SDK to project
- Copy SDK folder to Project folder
- Right click to project and choose Add Existing Files

- Add all SDK files


- Right click to project and choose Add New... -> General -> Text File
Add DEF file (sampplugin.def)
Step 3. Edit SDK and include in project
- Open SDK/amx/amx.h
After 66 line write this:
Code:
#include <windows.h>
Result:
Code:
#if defined __WIN32__ || defined _WIN32 || defined WIN32
#include <windows.h>
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
- Open pro file (sampplugin.pro)
Add anywhere
Code:
DEF_FILE = sampplugin.def
- Open def file (sampplugin.def)
Put this:
Code:
EXPORTS
Supports
Load
Unload
AmxLoad
AmxUnload
- Open header file (sampplugin.h)
Delete class Sampplugin
- Open cpp file (sampplugin.cpp)
Delete constructor (Sampplugin::Sampplugin())
Step 4. Write a plugin using Plugin development guide
Step 5. Plugin file will require additional dll: libgcc_s_dw2-1.dll, libstdc++-6.dll, libwinpthread-1.dll and all library modules that you used (eg Qt5Core.dll).
Put them in the server root folder
They are in bin folder compiler (eg E:\Qt\5.2.1\mingw48_32\bin)
Warning 3! All this needs to be tested!
P.S. Sorry for the use ****** Translate. Correct me if you see errors.
AW: Plugin on the Qt5 -
123marvin123 - 13.08.2014
Nice tutorial
Re: Plugin on the Qt5 -
iFarbod - 13.08.2014
Good Tut.
Re: Plugin on the Qt5 -
Locky - 15.08.2014
Example of use:
P.S. This is useless example
Re: Plugin on the Qt5 -
ikkentim - 15.08.2014
Quote from Qt homepage:
"Qt is a cross-platform application and UI framework for developers using C++"
Why would you need an UI framework when building plugins for SA-MP? Quite pointless if you ask me...
AW: Plugin on the Qt5 -
123marvin123 - 15.08.2014
@ikkentim: It is not only a UI framework. You can do many more with it.
Re: Plugin on the Qt5 -
Logofero - 30.11.2014
It's using it to create a graphical interface in the game in the MTA?
PS: If I'm not mistaken topic
Re: Plugin on the Qt5 -
KingHual - 30.11.2014
95% of sa-mp server owners host their servers on headless Linux systems. What in the world would be the use of this?
Re : Plugin on the Qt5 -
S4t3K - 30.11.2014
KingHual : Qt is cross-compatible. And it handles some useful modules such as threading or networking. But the main advantage of Qt is all its modules to design an UI, which is, as you stated, pointless on a LINUX system. What can be done using Qt5 for SA-MP can also be done using RakNet and Visual Studio (2011 and newer).
Re: Re : Plugin on the Qt5 -
KingHual - 30.11.2014
Quote:
Originally Posted by S4t3K
KingHual : Qt is cross-compatible. And it handles some useful modules such as threading or networking. But the main advantage of Qt is all its modules to design an UI, which is, as you stated, pointless on a LINUX system. What can be done using Qt5 for SA-MP can also be done using RakNet and Visual Studio (2011 and newer).
|
Literally nobody would use Qt for anything other than GUI. That would simply make the plugin bloated.
Re: Plugin on the Qt5 -
Khanz - 01.12.2014
Qt is disgusting bloat.