/srv/irclogs.ubuntu.com/2014/07/27/#ubuntu-app-devel.txt

=== wgrant_ is now known as wgrant
=== chihchun is now known as chihchun_afk
nik90mzanetti: ping11:32
mzanettinik90: pong12:00
nik90mzanetti: hey I am hitting a weird issue with our base timezone model12:08
nik90mzanetti: I created a C++ plugin just to send back the local date and time using QDateTime since it keeps track of the timezone change unlike the javascript date object.12:08
nik90mzanetti: Everything seems to work except for one thing which is the localCityTime.offsetFromUtc() - worldCityTime.offsetFromUtc() value. We return this value in the timezone base model class. On changing the system timezone and then returning to the clock app, I notice that this value changes in the c++ side of things, however it doesn't update the value in12:09
nik90the qml listview.12:09
nik90 mzanetti: any thoughts as to why that might happen?12:09
nik90mzanetti: I am working on this at https://code.launchpad.net/~nik90/ubuntu-clock-app/implement-change-time-settings12:09
mzanettinik90: isn't that the same issue again?12:09
mzanettithat returning QDateTime to qml doesn't keep timezone informations12:10
nik90mzanetti: no because the localCityTime.offsetFromUtc() - worldCityTime.offsetFromUtc() value is a int64 value. On c++ when qDebug() it returns the correct value, however on qml that value is different12:10
nik90mzanetti: so I am not interacting with qDateTime but rather just an int12:10
mzanettihmm, ok... need to check the code12:11
nik90mzanetti: in the timer update() function, we only do this roles << RoleTimeString;12:12
nik90mzanetti: may be we need to add other stuff that also change like the RoleTimeTo, RoleDayTo12:12
mzanettinik90: ah, yeah, true, you need to add each role you change12:12
nik90mzanetti: do I do it like roles << RoleTimeString << RoleTimeTo; ?12:13
mzanettiyep12:13
nik90thnx12:13
mzanettinik90: if you're changing all of the roles, or most of them, you could remove the whole last argument in dataChanged, then it would always update all roles12:14
mzanettiits up to you to decide if you can affort refreshing also unchanged fields or not12:14
nik90I am changing 3 out of 6, so I will do roles << RoleTimeString << RoleTimeTo to save on performance12:15
nik90mzanetti: yay that worked12:16
mzanetti:)12:16
Diogohi guys14:54
Diogodoes some one know how to make MYSQL database conection with QML??14:59
Diogodoes some one know how to make MYSQL database conection with QML??15:19
nik90Diogo: Check out http://qt-project.org/doc/qt-5/qtquick-localstorage-qmlmodule.html15:33
Diogonike90: i have c++ code, but i just dont understand it16:08
qtrosHi all16:25
qtrosWhich component should I use instead of standard WebView in UP?16:26
nik90Diogo: I always wonder you change nik90 to nike90 :D...I don't get a notification if you type nike9016:35
Diogonik90: ok16:36
nik90Diogo: I am not sure about accessing sql in c++, i haven't done it before16:37
Diogonik90: i have a project with some code16:37
nik90Diogo: but I am sure QT should have that in some form or the other16:37
qtrosnik90 Hello) Can you please help me with using of "Ubuntu.Web" on desktop?16:38
Diogonik90: the question is, that i dont understand the code16:38
Diogonik90: look http://paste.ubuntu.com/7876122/16:38
nik90qtros: Hi16:38
Diogonik90: http://paste.ubuntu.com/7876128/16:39
Diogonik90: i just needed some one to explain me what the code means, so i could move on and modify the way i need him16:40
nik90qtros: I am guessing you have looked at http://developer.ubuntu.com/api/qml/sdk-14.10/Ubuntu.Web/16:40
nik90qtros: I haven't used it yet, so sry I don't know much about it16:40
qtrosnik90 yep16:40
nik90Diogo: ah ok,16:40
* nik90 takes a look16:40
qtrosnik90 hmm... standard WebView is deprecated and nobody knows how to use new :D16:41
nik90qtros: yeah, however the documentation at http://developer.ubuntu.com/api/qml/sdk-14.10/Ubuntu.Web/ seems quite limited. I would love to see some examples there :/16:41
nik90Diogo: ok so your code creates a mysql object in c++. Do you want to access the mysql object in c++ or in qml?16:42
nik90Diogo: If you want to do all the sql commands in qml, it is better to look at the link I pasted earlier16:43
nik90Diogo: on the other hand, if you want to use it in your c++ code, it seems ok16:43
nik90Diogo: you will still need to add some functions for additonal functionality16:44
Diogonik90: i dont understand c++ thats why i asked help16:45
qtrosDiogo and what do you want to do with this code?16:45
nik90Diogo: as qtros where do you want to use this code? In qml or c++ ?16:46
Diogonik90: i've found out that the only possible way you can make the mysql contection in qml is using c++16:46
Diogoqml16:46
Diogonik90: qml16:46
nik90Diogo: ok then check out http://qt-project.org/doc/qt-5/qtquick-localstorage-qmlmodule.html16:46
nik90Diogo: that is sql in qml16:46
nik90 <Diogo> nik90: i've found out that the only possible way you can make the mysql contection in qml is using c++16:46
nik90^^ that is plain wrong16:46
Diogonik90: is it??16:47
nik90yes16:47
Diogonik90: javascript cant make the conection16:47
nik90Diogo: Did you read  http://qt-project.org/doc/qt-5/qtquick-localstorage-qmlmodule.html ?16:47
Diogonik90:i'm going to read it16:48
nik90Diogo: they are using javascript to make the connection16:48
Diogonik90: they are using sqlite16:49
Diogonik90: imagin you have an app that requires you to do the login16:49
Diogonik90: and the database with you data is on the server16:50
Diogonik90: what type of DB woudl you use?16:51
qtrosDiogo yes, remote connection only with cpp16:51
nik90Diogo: then I would use MySQL since it is in a remote server16:51
nik90Diogo: you didn't specify the remote server part earlier :)16:51
Diogonik90: sorry16:51
Diogonik90: about that16:52
nik90Diogo: In that case, you will have to create a C++ plugin that you can import in your qml code.16:52
nik90Diogo: However you will need to also set up cmakelists to ensure that the c++ gets built rproperly when running your app16:52
Diogonik90: i have a huge problem now16:53
nik90Diogo: In Qtcreator, in the create project wizard, you will have to choose "App with QML Extension Library"16:53
Diogonik90: because i dont know how to program in c++16:54
nik90Diogo: you will have to learn I am afraid16:54
nik90Diogo: I was in the same boat 2-3 weeks ago where I had to develop C++ plugins for the clock app.16:55
nik90Diogo: I did some reading and eventually am getting used to it16:55
Diogonik90: any good pleaces to learn it?16:55
nik90Diogo: well if you want to learn C++, then http://www.learncpp.com/ should be good16:56
nik90Diogo: however after that you will have to know how to develop with Qt C++16:56
Diogonik90: and did you see the voidream tutorials??16:57
nik90Diogo: ?16:57
nik90Diogo: I knew a bit of c++ from high school, so I started to work straight on the Qt C++ part16:57
Diogonik90: look https://www.youtube.com/watch?v=6KtOzh0StTc&list=PL2D1942A4688E9D6316:58
nik90Diogo: ooh yes, I saw some of his videos16:59
Diogonik90: i've created the "App with QML Extension Library" to see the files17:01
Diogoand i see the backed.cpp17:01
nik90backend.cpp17:01
Diogonik90: and i see the backed.cpp in Myapp folder17:02
Diogonik90: etc..17:02
nik90yup17:02
nik90so basically the backend folder holds your c++ plugin stuff17:03
nik90while your main qml code is in the app folder17:03
Diogonik90: the new thing for me to is now the app folder and the .. folder17:03
nik90Diogo: dont worry about the .. folder. It is part of cmake17:03
Diogonik90: what is cmake?17:03
nik90Diogo: it is sort of like an instruction list which tells the compiler what to do before running your app17:04
Diogonik90: so i'll develope my c++ plugins in  the Myapp folder right?17:06
nik90Diogo: there should be already a sample C++ plugin class17:07
nik90Diogo: you can just change that with your own class17:07
Diogonik90: so i'll change mytype.cpp and mytype.h for that right?17:08
nik90Diogo: yeah17:09
Diogonik90: you are the best man17:10
Diogonik90: for a hole day i've asked on forms and no one did say anything17:10
Diogonik90: and now when i ask to the community of the OS i love so muhc they help me17:12
nik90Diogo: make sure you accordingly change the CMakeList.txt file when you rename the mytype.cpp or mytype.h files17:12
nik90Diogo: no worries17:12
nik90Diogo: just push this to your github or launchpad branch and then we can better help with debugging17:13
Diogonik90: i'm going to study c++ for a day or 2 and then i'll begin to put everything in github17:15
nik90ok17:15
Diogonik90: and then i'll tell you :)17:18
Diogonik90: thanks for everything :D17:18
nik90Diogo: yw17:19
qtrosHi all17:37
qtrosCan someone tell how to use QML package "Ubuntu.Web" on desktop?17:37
qtrosCan someone tell how to use QML package "Ubuntu.Web" on desktop17:54
mhall119qtros: http://developer.ubuntu.com/api/qml/sdk-14.10/Ubuntu.Web.WebView/19:47
mhall119qtros: you probably need to be running Utopic on the desktop to use it though19:47
mhall119qtros: also make sure you have qtdeclarative5-ubuntu-web-plugin installed19:48
mhall119hope that helps, /me is going afk for a bit19:50
=== commandoline_ is now known as commandoline
=== daker_ is now known as daker
=== commandoline is now known as Guest80539
qtrosmhall119 ping20:29
mhall119qtros: pong20:58
qtrosmhall119 "you probably need to be running Utopic on the desktop to use it though" - does it mean that I always must develop for UP only on latest version of Ubuntu? ...20:59
qtrosmhall119 what if I prefer stable releases?20:59
mhall119qtros: once we have phones on the market there will be a stable release, right now "stable" (Trusty) is missing some many needed features that you'd be hurting yourself to target it21:00
mhall119I don't know if anybody even still runs it on a phone21:01
qtrosmhall119 no no, I mean desktop version of Ubuntu)21:01
mhall119if you're only interested in targeting desktops, then there's a case to be made for using only the sdk-14.04 framework, but Ubuntu.Web isn't in it21:01
mhall119qtros: you can run the stable desktop version and target Utopic in an emulator21:01
mhall119that's still not 100% smooth, but it works21:02
qtrosmhall119 but if I interested to target both, I should use 14.10 for now?21:02
mhall119my "not smooth" I mean QtCreator won't recognize the newer API elements, so some of the help if offers won't work21:02
mhall119qtros: if you use the sdk-14.10 framework, you'll only be able to target utopic and future releases, not trusty21:02
mhall119that goes for phone and desktop21:03
qtrosmhall119 I just want to write apps for UP and have ability to test them on desktop like before)21:04
qtrosmhall119 is it possible on Utopic?)21:09
mhall119only if you have Utopic on the desktop21:12
mhall119if you have trusty on the desktop, you can only run your app locally if it's using the sdk-14.04 framework APIs21:12
mhall119basically sdk-14.04 means "Trusty and above", sdk-14.10 means "Utopic and above"21:15
mhall119so you can use an sdk-14.04 app in Utopic, but not an sdk-14.10 app in Trusty21:15

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!