All Projects → lqt5 → Lqt

lqt5 / Lqt

Licence: mit
Lua Binding for Qt5

Programming Languages

lua
6591 projects
cpp
1120 projects

Projects that are alternatives of or similar to Lqt

Qt.go
Qt binding for Go (Golang) aims get Go's compile speed again.
Stars: ✭ 487 (+1523.33%)
Mutual labels:  gui, qt, qt5
Examples
Learn to create a desktop app with Python and Qt
Stars: ✭ 1,196 (+3886.67%)
Mutual labels:  gui, qt, qt5
Guitar
Git GUI Client
Stars: ✭ 1,136 (+3686.67%)
Mutual labels:  gui, qt, qt5
Qt5.cr
Qt5 bindings for Crystal, based on Bindgen
Stars: ✭ 182 (+506.67%)
Mutual labels:  gui, qt, qt5
Nitroshare Desktop
Network file transfer application for Windows, OS X, & Linux
Stars: ✭ 1,150 (+3733.33%)
Mutual labels:  gui, qt, qt5
Qml Creative Controls
QML controls for creative applications and creative coding
Stars: ✭ 199 (+563.33%)
Mutual labels:  gui, qt, qt5
Hidviz
A tool for in-depth analysis of USB HID devices communication
Stars: ✭ 505 (+1583.33%)
Mutual labels:  qt, qt5
Qtsharp
Mono/.NET bindings for Qt
Stars: ✭ 532 (+1673.33%)
Mutual labels:  gui, qt
Qdirstat
QDirStat - Qt-based directory statistics (KDirStat without any KDE - from the original KDirStat author)
Stars: ✭ 912 (+2940%)
Mutual labels:  gui, qt
Notes
Note-taking application, write down your thoughts.
Stars: ✭ 612 (+1940%)
Mutual labels:  qt, qt5
Singleapplication
Replacement of QtSingleApplication for Qt5 with support for instance communication.
Stars: ✭ 443 (+1376.67%)
Mutual labels:  qt, qt5
Persepolis
Persepolis Download Manager is a GUI for aria2.
Stars: ✭ 5,218 (+17293.33%)
Mutual labels:  gui, qt5
Qt Frameless Window Darkstyle
simple MainWindow class implementation with frameless window and custom dark style. It adds also support for titlebar and buttons (minimize, maximize, close)
Stars: ✭ 628 (+1993.33%)
Mutual labels:  qt, qt5
Taoquick
a cool QtQuick/qml component library and demo(一套酷炫的QtQuick/Qml基础库和示例)
Stars: ✭ 481 (+1503.33%)
Mutual labels:  qt, qt5
Screencloud
Screenshot sharing application for Windows, Mac and Linux.
Stars: ✭ 537 (+1690%)
Mutual labels:  qt, qt5
Qview
Practical and minimal image viewer
Stars: ✭ 460 (+1433.33%)
Mutual labels:  qt, qt5
Vue Nodegui
Build performant, native and cross-platform desktop applications with native Vue + powerful CSS like styling.🚀
Stars: ✭ 575 (+1816.67%)
Mutual labels:  gui, qt
Slate
Pixel Art Editor
Stars: ✭ 723 (+2310%)
Mutual labels:  qt, qt5
Scihubeva
A Cross Platform Sci-Hub GUI Application
Stars: ✭ 683 (+2176.67%)
Mutual labels:  qt, qt5
Qbt Theme
collection of themes for qbittorrent
Stars: ✭ 776 (+2486.67%)
Mutual labels:  gui, qt5

Overview

lqt is a Lua/luajit binding to the Qt5 framework. It is an automated binding generated from the modified version of Qt headers, and covers almost all classes and methods from supported Qt modules.

For more info, check the documentation, mailing list or contact the authors:

Features

  • automatically generated from modified version of Qt headers

  • supported modules:

    • QtCore
    • QtNetwork
    • QtSql
    • QtPositioning
    • QtScript
    • QtQml
    • QtWebChannel
    • QtGui
    • QtWidgets
    • QtOpenGL
    • QtPrintSupport
    • QtUiTools
    • QtQuick
    • QtQuickWidgets
    • QtWebEngineCore
    • QtWebEngineWidgets
    • QtTest
  • high API coverage - only a minimum of methods are not available

  • C++/Qt features available:

    • method overloads
    • virtual methods (including abstract methods)
    • multiple inheritance
    • you can store additional Lua values in userdata - they act like Lua tables
    • several overloaded operators are supported
    • chosen templated classes are available, like QList<QString>
    • signal/slot mechanism - you can define custom slots in Lua
    • QObject derived objects are automatically cast to correct type thanks to Qt metaobject system
    • implicit conversion - i.e. write Lua strings where QString is expected, or numbers instead of QVariant
    • Qt signal/slot feature works well test
    • Also Qt properties are supported test
  • optional memory management - you can let the Lua GC destroy objects, or let Qt parent/child management do the work

  • embed lua qt class system

    • Class inherit from Qt C++ class test
    • isInstanceOf check instance of a class test
  • lots of Qt offical examples lua version: examples

History

lqt 0.9

  • Public beta, most issues and API stabilized

Building lqt

To compile lqt, you need:

  • CMake
  • Qt 5.12.0 or above, download from Qt offical site
    • (WARN: Currently only Qt 5.12.0 and 5.13.0 supported!!!)
  • Compilers
    • On Windows: use Microsoft Visual Studio 2017 or later version
    • On MacOS: use XCode 11.0 or later version

You can get the latest source of lqt from https://github.com/lqt5/lqt . When you have the sources.

On Windows platform

Checkout sub module repos:

git submodule update --init --recursive --remote

Compile LuaJIT(required msvc x64 command line environ):

cd modules\src\LuaJIT\src
call msvcbuild.bat

Edit CMakeList.txt, change this line to your Qt install folder:

    set(CMAKE_PREFIX_PATH D:/Qt/Qt5.13.0/5.13.0/msvc2017_64/lib/cmake)

Create an out-of-source build directory (where the binaries will be built, I often use build):

md build

Then, use CMake to generate the msvc solution and run cmake build:

cmake -G "Visual Studio 15 2017 Win64" -H. -Bbuild
cmake --build build --target ALL_BUILD --config RelWithDebinfo -j4

On MacOS platform

Checkout sub module repos:

git submodule update --init --recursive --remote

Compile LuaJIT:

cd modules/src/LuaJIT
make -j8

Edit CMakeList.txt, change this line to your Qt install folder:

    set(CMAKE_PREFIX_PATH ~/Qt/5.13.0/clang_64/lib/cmake/)

Then, use CMake to generate the Makefile and run make as usual:

    mkdir build; cd build
    cmake ..
    make -j4 # use parallel build with your number of cores/processors

Finish

The generated Lua binding libraries are created in the lib directory, you can copy them to your LUA_CPATH.

Usage

A quick example of "Hello World!" button with signal/slot handling:

    local QtCore = require 'qtcore'
    local QtGui = require 'qtgui'
    local QtWidgets = require 'qtwidgets'

    local app = QtWidgets.QApplication.new(select('#',...) + 1, {'lua', ...})

    local btn = QtWidgets.QPushButton.new("Hello World!")
    btn:connect('2pressed()', function(self)
        print("I'm about to close...")
        self:close()
    end)
    btn:setWindowTitle("A great example!")
    btn:resize(300,50)
    btn:show()

    app.exec()

For more examples, check out the test or examples folder and the doc folder for documentation on detailed usage - memory management, signal/slot handling, virtual method overloading, etc. Also, have a look at the examples and feel free to add your own!

License

  • Copyright (c) 2007-2009 Mauro Iazzi
  • Copyright (c) 2008-2009 Peter Kümmel
  • Copyright (c) 2010-2011 Michal Kottman
  • Copyright (c) 2019-2019 Saniko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].