Kugadzira app yeUbuntu Kubata [QML] - [Chikamu 1]

Nhanganyaya

Pano pauya akateedzana ezvinyorwa (senge dzandakaita nadzo Vala), asi ino nguva nechikumbiro che Ubuntu Bata, iko kunyorera pakutanga "kwakafanana" senge mu mbiru kubva Vala, ndokuti, mhando yemutambo uko isu tine mubvunzo uye mhinduro ina muchimiro chebvunzo, ipapo isu tine matatu mabhatani, imwe kubvisa mbiri dzingaite mhinduro (4%), imwe yekuomesa nguva uye yekupedzisira ku enda kubva kumubvunzo.

Kuti uone kutanga kwekugadzira chirongwa, unogona kushanyira izvi pambiru (zvinyorwa, gadzira chirongwa ...), sezvo isu tichatanga neiyo chirongwa chakagadzirwa kare.

Kunyangwe iko kunyorera kuri kwakanangidzirwa pa Ubuntu Bata Inogona zvakare kushandiswa mu Ubuntu sekunge chaive chiitiko chaicho

Ruzivo rwekutanga

Kugadzira iyo app isu tinoshandisa izvo zvikamu zve UbuntuKunyange isu tichigona kugadzira zvedu zvikamu, isu hatizodaro mune ino kesi.

Ubuntu Zvikamu zvinhu zvatinozoshandisa kune yedu app:

Capture kubva 2014-07-04 23:57:48

Kuti tivashandise zvakafanana tinofanira kuendesa module:

tenga Ubuntu.Components 0.1

Tinogona kuwana akasiyana zvinhu mukati mezvinhu, senge mabhatani, mabara ekufambira mberi etc. Tinogona kurodha pasi purojekiti uko kwavanotiratidza mazhinji ezvinhu izvi:

bzr bazi lp: ubuntu-ui-toolkit 
isu tinofanirwa kuve ne bzr yakaiswa

Kugadzira iyo app

Isu tinotanga kubva pamufananidzo patine chikumbiro chakaitwa na GTK, mune ino nyaya isu toshandisa QML, ipapo isu tichagadzira iyo yese application ne Qt Kurumidza (QML + JavaScript).

Iko kunyorera, semufananidzo, ichave nemubvunzo, nguva, mhinduro, sarudzo uye mapoinzi. Musiyano chete (kunze kwe "dhizaini"), ndezvekuti isu tichava nemaTab kumusoro.

Kune izvi isu tinoshandisa bhatani, chitambi uye kufambira mberiBar zvinhu. Kune chimiro isu tinoshandisa iyo Element Column y Mutsara.

Gare gare isu tichagadzira iyo yakawanda mibvunzo

Kugadzira marongero eiyo huru skrini:

Isu tinotanga ne MainView, uko kunowanikwa Matabhu akasiyana, mune ino kesi tiri kuzoshanda pakurongwa kweiyo yekutanga skrini yeapp yedu.

MainView {chinhuName: "mainView" // ...}

Miganhu (yeUbuntu Kubata):

upamhi: units.gu (50) kukwirira: units.gu (75)

Isu tinotsanangura kureba uye upamhi hwekushandisa kwedu, uko upamhi huchave makumi mashanu (mayunitsi) uye kureba makumi manomwe neshanu, ikozvino tave kuzopenda.

headerColor: "# 57365E" backgroundColor: "# A55263" footerColor: "# D75669"

Isu tine ruvara rwemusoro, muviri uye tsoka:

Capture kubva 2014-07-05 15:24:58

Sezvandambotaura, iko kunyorera kuchave kwakarongedzwa neTab:

    Tabs {id: tabs Set {objectName: "jocTab"} / * Wedzera {objectName: "addQuestions"} * /}

Sezvo isu tichiona isu tine maTabhu maviri, imwe yakataura (hatisati tazvigadzira izvozvi) uyezve yekutamba (iyo yatichagadzira izvozvi). Kugadzira iyo Tab, isu tichagadzira nyowani qml faira (Wedzera nyowani -> Qt -> QML Faira ->…), zita refaira richava Mutambo.qml.

Zvakanaka, ngatishandure Game.qml nenzira yekuti tishandure kuita Tab, iri mukati rine peji (Peji):

pinza QtQuick 2.0 kupinza Ubuntu.Components 0.1 Tab {zita: i18n.tr ("Mutambo") Peji {}}

Mukati mepeji isu tichatanga kuronga zvinhu izvo zvatinotaura mukugadzirwa. Chikamu chinosanganisa zvese zvinhu mukati (zvichavaisa zvichimira), tobva taisa zvinhu zvakarongeka: Chitaera, ProgressBar, iwo mabhatani mana; uye kuisa sarudzo, isu tinoshandisa iyo Row element kuiisa yakatwasuka.

Column {anchors.top: Gamepage.top anchors.topMargin: 50 spacing: 15 width: parent.width height: parent.height - 50 Label {id: question anchors.topMargin: 500 text: "Mubvunzo?" anchors. Bhatani {id: resp1 chinyorwa: "Mhinduro 1" anchors.horizontalCenter: parent.horizontalCenter} Bhatani {id: resp2 chinyorwa: "Mhinduro 2" zvimiso. HorizontalCenter: parent.horizontalCenter} Bhatani {id: chinyorwa3: "Mhinduro 3" zvimiso .horizontalCenter: parent.horizontalCenter} Row {spacing: 4 anchors.horizontalCenter: parent.horizontalCenter Button {id: b4 text: "15%"} Bhatani {id: bCon text: "Freeze"} Bhatani {id: bNext text: " Inotevera "}} Row {spacing: 50 anchors.horizontalCenter: parent.horizontalCenter Label {id: failures text:" Failures: 50 "color:" red "} Label {id: hits text:" Hit: 15 "} Label {id : anonongedza mavara: "Points: 0" fontSize: "pakati"}}

Ngatione kuti mukati mechinhu chimwe nechimwe chakatemwa neayo chitupa "id», Izvo zvichatibatsira kana tikateedzera pfungwa yekushandisa.

Pakupedzisira tinogona kuona mhedzisiro:

Capture kubva 2014-07-23 19:21:03


Izvo zviri muchinyorwa zvinoomerera pamisimboti yedu ye tsika dzekunyora. Kuti utaure chikanganiso tinya pano.

Makomendi gumi, siya zvako

Siya yako yekutaura

Your kero e havazobvumirwi ichibudiswa.

*

*

  1. Inotarisira iyo data: Miguel Ángel Gatón
  2. Chinangwa cheiyo data: Kudzora SPAM, manejimendi manejimendi.
  3. Legitimation: Kubvuma kwako
  4. Kutaurirana kwedata
  5. Dhata yekuchengetedza: Dhatabhesi inobatwa neOccentus Networks (EU)
  6. Kodzero: Panguva ipi neipi iwe unogona kudzora, kupora uye kudzima ruzivo rwako

  1.   nano akadaro

    Ini ndinoifarira, haina zvimwe zvakadzama mumaonero angu, asi iri gwara rakanaka rezita ...

  2.   Ariel akadaro

    Kugona chose! Inoshanda chaizvo kutanga neQml.
    Iyi ndiyo yakanakisa Linux blog muSpanish, nekure. Handina kumbobvira ndataura, asi ndinozvitarisa nguva zhinji; inenge inodhakwa yandinayo.
    Mubvunzo mumwe ... Ko chirongwa chakagadzirwa neUbuntu SDK chingaiswa pane yakasarudzika distro, senge Arch semuenzaniso? Ini ndinofungidzira kuti zvichave zvakakodzera kuzadzisa kumwe kutsamira (senge Qt hongu). Asi pane zvese izvi zvinoenderana kazhinji muzvitoro zvechero distro.

    1.    Ariel akadaro

      Ndine urombo, mutongo wekupedzisira unofanirwa kunge wanga uri mubvunzo chaizvo ... Kune zvese kutsamira mune chero zvinyorwa zve distro?

      1.    lolbimbo akadaro

        Nekutadza haugone kuisa -la (mune ino kesi), sezvo iine kutsamira senge ubuntu-zvinhu (mune ino kesi vhezheni 0.1), kana iwe ukavaisa gare gare haifanire kupa matambudziko, kana ukasashandisa izvo zvinhu. (Ini ndinofunga Unogona zvakare kuendesa ese kuchikumbiro kuitira kuti chiwedzere uremu asi iwe uchibvisa seyakavimbika) senge sigram application (mutengi weteregiramu) inogadzirwa ne qt nekukurumidza uye unogona kuiisa kune vakawanda distros.

  3.   Sasuke akadaro

    Ndinovimba unopedza kunyorera.

    1.    Gabielus akadaro

      Zvakanaka chaizvo. Ini ndatotevera matanho uye ndizvo zvazviri.
      Ndinovimba uchaenderera mberi nechirongwa ...