maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   [WIP] Hildon Qt Components (https://talk.maemo.org/showthread.php?t=85955)

qwazix 2013-01-20 01:01

Re: [WIP] Hildon Qt Components
 
Code:

(/opt/QtSDK/Simulator/Qt/gcc/imports/org/hildon/components/libhildonplugin.so: undefined symbol: _ZTV12HildonPlugin)
The same appears on device too.

EDIT:

It worked :)

I just needed to move the declaration of the plugin class to a header file instead of a source file.

marxian 2013-01-20 15:26

Re: [WIP] Hildon Qt Components
 
Quote:

Originally Posted by qwazix (Post 1316001)
Code:

(/opt/QtSDK/Simulator/Qt/gcc/imports/org/hildon/components/libhildonplugin.so: undefined symbol: _ZTV12HildonPlugin)
The same appears on device too.

EDIT:

It worked :)

I just needed to move the declaration of the plugin class to a header file instead of a source file.

Thanks. Now that that obstacle is overcome, I'll get back to working on this.

EditBar now added:

http://t.imgbox.com/adeUEtNa.jpg

Code:

EditBar {
    titleText: qsTr("Select items to edit")

    EditButton {
        text: qsTr("Edit")
        onClicked: doStuff()
    }
}


marxian 2013-01-20 20:44

Re: [WIP] Hildon Qt Components
 
Some more changes. FileSystemModel is fixed and FileBrowserDialog is changed to conform to Hildon style.

http://t.imgbox.com/acrmPesa.jpg

http://t.imgbox.com/adz9r3qJ.jpg

Latest source: https://github.com/marx1an/qt-components-hildon

qwazix 2013-01-20 22:55

Re: [WIP] Hildon Qt Components
 
Thanks for the awesome work. Here is the first implementation using your components http://youtu.be/hVAtWl3oUHI

Source here https://github.com/qwazix/qmlBrowser

I also uploaded qt-components to github, if you got an account we can collaborate there: https://github.com/qwazix/hildon-qt-components

EDIT: stupid. I didn't see you already pushed there. I'll merge.

Finally some thoughts...
  1. Minimizing the application with screen.minimize() didn't work for me, I had to resort to using dbus 'exit-app-view'
  2. PageStackWindow crashes on device with
    Code:

    X Error: BadMatch (invalid parameter attributes) 8
      Major opcode: 42 (X_SetInputFocus)
     Resource id:  0x6200002

  3. We need all the icons in the status area, maybe using the pixmap from gtk as freemangordon suggested is the way to go. Other ideas?
  4. Or is it possible to use the system status bar and have qt menus bound into qml or some other such contraption? I know qml is supposed to be fullscreen and implement everything from scratch, but getting the icons might be harder than this.
  5. Maybe the Status Bar could be exposed so that it can be used in more creative ways. In my implementation I copied the code and modified it so that it can be used standalone, outside a pageStack, you may want to have a look at it

EDIT2: also selecting text in textfields doesn't work

marxian 2013-01-20 23:42

Re: [WIP] Hildon Qt Components
 
Quote:

Originally Posted by qwazix (Post 1316204)

Finally some thoughts...
  1. Minimizing the application with screen.minimize() didn't work for me, I had to resort to using dbus 'exit-app-view'
  2. PageStackWindow crashes on device with
    Code:

    X Error: BadMatch (invalid parameter attributes) 8
      Major opcode: 42 (X_SetInputFocus)
     Resource id:  0x6200002

  3. We need all the icons in the status area, maybe using the pixmap from gtk as freemangordon suggested is the way to go. Other ideas?
  4. Or is it possible to use the system status bar and have qt menus bound into qml or some other such contraption? I know qml is supposed to be fullscreen and implement everything from scratch, but getting the icons might be harder than this.
  5. Maybe the Status Bar could be exposed so that it can be used in more creative ways. In my implementation I copied the code and modified it so that it can be used standalone, outside a pageStack, you may want to have a look at it

Minimizing is done via the platformWindow context. I moved it from HildonScreenPlugin (which now just provides the screen dimensions and orientation) to HildonWindowPlugin. It seems I forgot to change the method call in MinimizeButton.qml. I've corrected it now.

I haven't tested on-device for a while, so I'm not sure about the crashing. It worked last time I tested, but there have been some code changes since then.

I think using the GTK pixmaps requires creating a widget instance. Whilst it is possible to render QWidgets in a QGraphicsScene, it's not recommended (according to the documentation), so it may be better to avoid that solution.

As far as the statusbar info is concerned, this can be obtained using QSystemInfo (HildonSystemPlugin currently uses it for battery, profile and network status), but I've had problems with this in Qt4.7.0, so lower-level alternatives may need to be considered. The icons are missing because I haven't finished the implementation on the QML side. The main thing missing from the status bar is the ability to raise the Hildon status menu. I wonder if a DBus method can be added to hildon-status-menu. :)

I couldn't see any difference in your StatusBar.qml. What use case do you have in mind?

EDIT: Text selection via mouse drag is now fixed. Just needed to set selectByMouse to true. :)

qwazix 2013-01-22 23:14

Re: [WIP] Hildon Qt Components
 
Sorry, I wasn't clear enough. I was talking about this https://github.com/qwazix/qmlBrowser...omTitleBar.qml

marxian 2013-01-23 18:53

Re: [WIP] Hildon Qt Components
 
StatusBar, Menu, and PageStack are now independent components, so they can be used outside of PageStackWindow. There is also a new ApplicationWindow component.

Code:

ApplicationWindow {
    id: appWindow

    StatusBar {
        id: statusBar

        property string backPressedState: backButtonPressed ? "Pressed" : ""

        anchors {
            top: parent.top
            left: parent.left
            right: parent.right
        }

        titleText: pageStack.currentPage === null ? "" : pageStack.currentPage.title
        showMenuIndicator: (pageStack.currentPage !== null) && (pageStack.currentPage.tools !== null)
        backButtonIconSource: (pageStack === null) || (pageStack.depth === 1) ? "image://theme/wmCloseIcon" + backPressedState : "image://theme/wmBackIcon" + backPressedState
        onTitleAreaClicked: menu.open()
        onBackClicked: (pageStack === null) || (pageStack.depth === 1) ? Qt.quit() : pageStack.pop()
        onBackPressAndHold: if ((pageStack !== null) && (pageStack.depth > 1)) pageStack.pop(null);
    }

    PageStack {
        id: pageStack

        anchors {
            top: statusBar.bottom
            left: parent.left
            right: parent.right
            bottom: parent.bottom
        }

        Component.onCompleted: push(Qt.resolvedUrl("HomePage.qml"), null, true)
    }

    Menu {
        id: menu

        tools: pageStack.currentPage === null ? null : pageStack.currentPage.tools
    }
}


marxian 2013-01-24 14:55

Re: [WIP] Hildon Qt Components
 
I've now added a QDeclarativeProcess plugin. This makes the the QProcess API accessible via QML. It doesn't depend on qt-components-hildon, so if you have a QML project and want to use QProcess, feel free to use my code.

Example:

Code:

import QtQuick 1.0
import org.hildon.components 1.0

Page {
    id: root

    title: qsTr("Process page")

    Process {
        id: process

        processEnvironment: { "PATH": "/usr/bin:/usr/local/bin", "USER": "stuart" }
        workingDirectory: "/home/stuart/Development/QtProjects"
        onError: resultLabel.text = "<font color='red'>" + qsTr("Error") + "</font>"
        onFinished: resultLabel.text = process.readAllStandardOutput()
    }

    Column {
        id: column

        spacing: 10

        anchors {
            left: parent.left
            right: parent.right
            top: parent.top
            margins: platformStyle.paddingNormal
        }

        Label {
            text: qsTr("Working directory") + ": " + process.workingDirectory
        }

        Label {
            text: "PATH: " + process.processEnvironment.PATH + ", USER: " + process.processEnvironment.USER
        }

        Label {
            text: qsTr("Command") + ":"
        }

        Row {
            spacing: platformStyle.paddingNormal

            TextField {
                id: commandEdit

                width: 300
                text: "echo hello world"
                onTextChanged: process.command = text
            }

            Button {
                id: startButton

                text: qsTr("Start")
                enabled: process.state === Processes.NotRunning
                onClicked: process.start()
            }

            Button {
                id: stopButton

                text: qsTr("Cancel")
                enabled: process.state === Processes.Running
                onClicked: process.terminate()
            }

        }

        Label {
            text: qsTr("Result") + ":"
        }
    }

    Flickable {
        id: flicker

        anchors {
            top: column.bottom
            left: parent.left
            right: parent.right
            bottom: parent.bottom
            margins: platformStyle.paddingNormal
        }
        clip: true
        contentHeight: resultLabel.height + platformStyle.paddingNormal

        Label {
            id: resultLabel

            width: parent.width
            wrapMode: Text.WordWrap
            color: "green"
        }
    }

    ScrollDecorator {
        flickableItem: flicker
    }
}

http://t.imgbox.com/adxeQDDy.jpg

marxian 2013-01-25 21:27

Re: [WIP] Hildon Qt Components
 
I've added a Qt Components Hildon Gallery to demonstrate the currently available components. :)

http://t.imgbox.com/acmK9TyU.jpg http://t.imgbox.com/adrDa5T1.jpg http://t.imgbox.com/acjusXo4.jpg http://t.imgbox.com/abwOapI3.jpg http://t.imgbox.com/acoK4TqR.jpg http://t.imgbox.com/advnOyss.jpg http://t.imgbox.com/adsC5TC6.jpg

https://github.com/marx1an/qt-compon...master/gallery

I'll add a couple of small example applications soon.

freemangordon 2013-01-25 22:23

Re: [WIP] Hildon Qt Components
 
Impressive work :)


All times are GMT. The time now is 15:51.

vBulletin® Version 3.8.8