This should have been fixed, so right now if a pointer returned is
NULL, then 'nil' is returned in Lua. Therefore you can check it simply
like this:
local item = treeWidget:itemAt(point)
if item then
-- do processing
end
Do not do that (yet) - some things may break. If you use QtWebkit
module, then you will get various errors coming out of nowhere - it
seems that the QtWebkit module uses signals/slots from multiple
threads, which break Lqt. However, QtCore and QtGui seem to work fine.
If you want precompiled binaries, try the 4.7.4 version, which is the
latest working -
https://github.com/downloads/mkottman/lqt/lqt_0.9_win_qt4.7.4.zip
When you are adventurous enough, compiling Lqt isn't a big deal. You
need a working installation of Qt, CMake, and then do the following in
command line:
> git://github.com/mkottman/lqt.git or download the ZIP - https://github.com/mkottman/lqt/zipball/master
> cd lqt
> mkdir build
> cd build
> cmake ..
> mingw32-make
If you use Visual Studio, instead of the last line, open the generated
Lqt solution and build it.
That is strange, could you check to see if the file exists? Also,
could you try running:
> make VERBOSE=1 qtcore
and send me a log of the process...
> I'm right, if I say that cpptoxml hasn't create a xml file? CMake found the
> right Qt4.8 path. Is there a manual path configuration?
There should be no other configuration necessary. Let me fire up a
virtual machine and see what is going wrong...
On Mar 6, 2012 12:46 PM, "yasrick" <doorsi...@googlemail.com> wrote:
>
> Problem solved!
> The cpptoxml.exe need the qtcore4.dll for executing, cmake found the path, but the exe doesn't use it. So I copied all Qt dlls to the lqt\build\bin\<Debug|Release|....>\.
> After killing the WebKit parts and new cmake, the sln runs without errors.
>
> But the QUiLoader doesn't work now:
> require 'qtcore'
> require 'qtgui'
> require 'qtuitools'
> module('uiLoader', package.seeall)
> local mLoader = QUiLoader.new_local() ---> Lua: uiloader.lua:5: attempt to call field 'new_local' (a nil value) :(
> ...
>
> So I can't test the thread topic.
The memory management has changed a bit. Now you can call the class directly to get 'local' behaviour. So just call QUiLoader(), no need for new_local().
package.path = package.path .. ";./HapakELOInt/?.lua"
package.cpath = package.cpath .. ";./HapakELOInt/?.dll"
package.cpath = package.cpath .. ";./HapakELOInt/?"
package.cpath = package.cpath .. ";./HapakELOInt/qt/?.dll"
package.cpath = package.cpath .. ";./HapakELOInt/qt/?"
require 'qtcore'
require 'qtgui'
require 'uiloader'
...
require 'qtcore'
require 'qtgui'
require 'qtuitools'
module('uiLoader', package.seeall)
local mLoader = QUiLoader() -- CRASH
local mObjectsByName = {}
...
package.path = package.path .. ";./HapakELOInt/?.lua"
package.cpath = package.cpath .. ";./HapakELOInt/?.dll"
package.cpath = package.cpath .. ";./HapakELOInt/?"
package.cpath = package.cpath .. ";./HapakELOInt/qt/?.dll"
package.cpath = package.cpath .. ";./HapakELOInt/qt/?"
function SLOT(s) return '1'..s end
function SIGNAL(s) return '2'..s end
function MSG(s) haelo.ShowMessage(s) end
require 'qtcore'
require 'qtgui'
local new_MyWidget = function(...)
local this = uiLoader.load("D:\\Programme\\HapakPro\\HapakELOInt\\tree.ui")
local tree = uiLoader.findObjectByName("projecttree")
tree:connect(SIGNAL('itemSelectionChanged()'), function(self)
MSG("TEST")
end)
tree:connect(SIGNAL('customContextMenuRequested(QPoint)'), function(self, point)
MSG("FOO")
--local citem = self:itemAt(point)
--if (citem) then
-- MSG("yes")
--else
-- haelo.ShowMessage("no")
--end
end)
return this
end
qapp = QApplication(1 + select('#', ...), {...})
qapp.setAttribute(Qt.ApplicationAttribute.AA_NativeWindows, true) -- da das Fenster sonst in Hapak keine Events empfängt
qapp.__gc = qapp.delete -- take ownership of object
require 'uiloader'
widget = new_MyWidget()
widget:showFullScreen()
--widget:show()
Computers sometimes (fail to) work in mysterious ways. Did you have to
change anything in Lqt to make it work, or did it work fine straight
out of the repo?