SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 13/08/2014, 03:15 AM   #1
Locky
Little Clucker
 
Join Date: Aug 2014
Location: Vladivostok
Posts: 2
Reputation: 0
Post Plugin on the Qt5

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.
Locky is offline   Reply With Quote
Old 13/08/2014, 09:45 AM   #2
123marvin123
Big Clucker
 
123marvin123's Avatar
 
Join Date: Sep 2009
Location: Germany
Posts: 102
Reputation: 19
Default AW: Plugin on the Qt5

Nice tutorial
123marvin123 is offline   Reply With Quote
Old 13/08/2014, 09:53 AM   #3
iFarbod
Gangsta
 
Join Date: Jan 2014
Location: Los Santos (HD Universe)
Posts: 610
Reputation: 61
Default Re: Plugin on the Qt5

Good Tut.
iFarbod is offline   Reply With Quote
Old 15/08/2014, 03:17 PM   #4
Locky
Little Clucker
 
Join Date: Aug 2014
Location: Vladivostok
Posts: 2
Reputation: 0
Default Re: Plugin on the Qt5

Example of use:



P.S. This is useless example
Locky is offline   Reply With Quote
Old 15/08/2014, 05:42 PM   #5
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,052
Reputation: 205
Default Re: Plugin on the Qt5

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...
__________________
Greetings,
Tim Potze

Projects
GAMEDEV | Part-time developer working on Parkitect. | Steampage
LSRES | A SA:MP server from the past, and hopefully, back in the future.
SampSharp | Plugin for writing SA:MP gamemodes in C#. | Topic Website Github
SanMap | San Andreas in G00GLE MAPS! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 15/08/2014, 06:05 PM   #6
123marvin123
Big Clucker
 
123marvin123's Avatar
 
Join Date: Sep 2009
Location: Germany
Posts: 102
Reputation: 19
Default AW: Plugin on the Qt5

@ikkentim: It is not only a UI framework. You can do many more with it.
123marvin123 is offline   Reply With Quote
Old 30/11/2014, 01:46 AM   #7
Logofero
Huge Clucker
 
Join Date: Sep 2014
Posts: 366
Reputation: 39
Default Re: Plugin on the Qt5

It's using it to create a graphical interface in the game in the MTA?

PS: If I'm not mistaken topic
__________________
My channel
Logofero is offline   Reply With Quote
Old 30/11/2014, 05:24 AM   #8
KingHual
Banned
 
Join Date: Jun 2010
Location: Bulgaria
Posts: 2,286
Reputation: 1389
Default Re: Plugin on the Qt5

95% of sa-mp server owners host their servers on headless Linux systems. What in the world would be the use of this?
KingHual is offline   Reply With Quote
Old 30/11/2014, 08:56 AM   #9
S4t3K
Gangsta
 
S4t3K's Avatar
 
Join Date: Jan 2013
Posts: 864
Reputation: 165
Default Re : Plugin on the Qt5

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).
__________________
S4t3K is offline   Reply With Quote
Old 30/11/2014, 01:53 PM   #10
KingHual
Banned
 
Join Date: Jun 2010
Location: Bulgaria
Posts: 2,286
Reputation: 1389
Default Re: Re : Plugin on the Qt5

Quote:
Originally Posted by S4t3K View Post
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.
KingHual is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[MySQL] From StickenKid's plugin to BlueG's plugin jessejanssen Scripting Help 2 15/06/2014 01:20 AM
mysql plugin. loading plugin failed ikkentim Help Archive 2 10/02/2011 02:32 PM


All times are GMT. The time now is 01:32 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.