Dňa 24.6.2012 16:50, "luafox" <in...@luafox.com> napísal(-a):
>
> Hello,
>
> I have a very simple question which bugs me a lot. I would like to add
> a
> number of icons to QToolBar but I have problems getting them to
> display.
>
> I tried the following code:
>
> require'qtcore'
> require'qtgui'
>
> [...]
>
> local testicon = QPixmap("C:\Program
> Files\Lua\lqt\test\Theme\default\test.bmp")
> --testicon = QIcon(testicon)
> local test2 = QIcon("C:\Program Files\Lua\lqt\test\Theme\default
> \test.png")
The problem may be in the paths in the string literals. Lua treats backslash in strings as an escape character (as in C). Therefore "\test" is treated as a tab character followed by "est". Either double all backslashes "\\" or switch to forward slash "/" (it works also in Windows).
The problem may be in the paths in the string literals. Lua treats backslash in strings as an escape character (as in C). Therefore "\test" is treated as a tab character followed by "est". Either double all backslashes "\\" or switch to forward slash "/" (it works also in Windows).