Re: [Interest] Custom-shaped QDialog or similar

2013-05-20 Thread Rutledge Shawn

On 21 May 2013, at 8:20 AM, Rutledge Shawn wrote:

> 
> On 17 May 2013, at 4:19 PM, Sensei wrote:
> 
>> Dear all,
>> 
>> I'd like to try something new for an application: having a custom shaped 
>> dialog for some options. You can see my desire in the attachment.
>> 
>> Now, what do you suggest to do that? I am lost here!
>> 
>> Using a QDialog maybe? But how can I position it exactly where I'd like? 
>> Should this be modal? I'd say no: if a user clicks elsewhere, it should 
>> disappear, probably.
>> 
>> It's the first time I'm trying something like this, so any suggestion is 
>> more than welcome!
> 
> If you are using a Mac, that kind of window is called a popover.  We don't 
> have support for it yet in Qt, but it should be in Qt::WindowFlags eventually 
> (but only on the Mac).
> 
> Yes you can fake it with Qt Quick, and you could draw the outline with the 
> Canvas API, but probably it's easier to use BorderImage because of the 
> shadows.  See 
> qtdeclarative/examples/quick/imageelements/content/ShadowRectangle.qml for 
> example, but you will need an image with the pointy part already done.  Make 
> it as wide as the maximum-width popover you will ever want, so you can use 
> horizontalTileMode: BorderImage.Repeat without ever repeating the pointy 
> part.  The height won't matter as much.  If the popovers sometimes go upwards 
> then you might need two different images.
> 
> Since the pointy part is always inside another window, you don't necessarily 
> need a shaped window for the popover, but a separate Window will allow the 
> popover to extend outside the main window if necessary.  Maybe use a QtQuick 
> Window, set color: "transparent" and then provide the frame yourself with 
> BorderImage?  Later on you can remove that and set the new window flag when 
> it's working.

But since this is a bit complex I'm beginning to wonder if we should provide a 
reusable Popover in QtQuick.Dialogs.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Development] Nested Mousearea don't pass events

2013-05-20 Thread Rutledge Shawn

On 20 May 2013, at 4:36 PM, Matteo Brichese wrote:

> I've solved it in my code with a Timer.

It's probably more efficient to go back to using two MouseAreas and 
propagateComposedEvents as documented in the MouseArea docs.

Not being able to distinguish clicked from doubleClicked within one MA is 
inconvenient, but I suppose the alternative would be for Qt to internally use a 
timer, which would slow down the clicks.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Custom-shaped QDialog or similar

2013-05-20 Thread Rutledge Shawn

On 17 May 2013, at 4:19 PM, Sensei wrote:

> Dear all,
> 
> I'd like to try something new for an application: having a custom shaped 
> dialog for some options. You can see my desire in the attachment.
> 
> Now, what do you suggest to do that? I am lost here!
> 
> Using a QDialog maybe? But how can I position it exactly where I'd like? 
> Should this be modal? I'd say no: if a user clicks elsewhere, it should 
> disappear, probably.
> 
> It's the first time I'm trying something like this, so any suggestion is more 
> than welcome!

If you are using a Mac, that kind of window is called a popover.  We don't have 
support for it yet in Qt, but it should be in Qt::WindowFlags eventually (but 
only on the Mac).

Yes you can fake it with Qt Quick, and you could draw the outline with the 
Canvas API, but probably it's easier to use BorderImage because of the shadows. 
 See qtdeclarative/examples/quick/imageelements/content/ShadowRectangle.qml for 
example, but you will need an image with the pointy part already done.  Make it 
as wide as the maximum-width popover you will ever want, so you can use 
horizontalTileMode: BorderImage.Repeat without ever repeating the pointy part.  
The height won't matter as much.  If the popovers sometimes go upwards then you 
might need two different images.

Since the pointy part is always inside another window, you don't necessarily 
need a shaped window for the popover, but a separate Window will allow the 
popover to extend outside the main window if necessary.  Maybe use a QtQuick 
Window, set color: "transparent" and then provide the frame yourself with 
BorderImage?  Later on you can remove that and set the new window flag when 
it's working.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML Window handling focus events

2013-05-20 Thread Daiwei Li
Thanks for the quick response, Alan! appliaction.active works for me for
now, but I'm looking forward to onActiveChanged being added to Qt 5.1.

Daiwei


On Mon, May 20, 2013 at 6:57 PM, Alan Alpert <4163654...@gmail.com> wrote:

> On Mon, May 20, 2013 at 5:56 PM, Daiwei Li  wrote:
> > It looks the QQuickWindow C++ class has focusIn and focusOut event
> handlers
> > that you can override, but there's no signal in QML. Am I missing
> something
> > or is it intentionally left out of QML?
>
> The QML API for QQuickWindow is still young (and growing slowly), but
> that signal is being added in Qt 5.1 (onActiveChanged). In Qt 5.0,
> there is an application.active property you can listen to in QML to
> see if the application as a whole is active, but it's not granular to
> individual windows.
>
> There's no distinction between window focusIn/Out and window
> active/inactive. Leaving that out is intentional, because it's rarely
> an important distinction (and when it is, you have the C++ API).
>
> --
> Alan Alpert
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML Window handling focus events

2013-05-20 Thread Alan Alpert
On Mon, May 20, 2013 at 5:56 PM, Daiwei Li  wrote:
> It looks the QQuickWindow C++ class has focusIn and focusOut event handlers
> that you can override, but there's no signal in QML. Am I missing something
> or is it intentionally left out of QML?

The QML API for QQuickWindow is still young (and growing slowly), but
that signal is being added in Qt 5.1 (onActiveChanged). In Qt 5.0,
there is an application.active property you can listen to in QML to
see if the application as a whole is active, but it's not granular to
individual windows.

There's no distinction between window focusIn/Out and window
active/inactive. Leaving that out is intentional, because it's rarely
an important distinction (and when it is, you have the C++ API).

--
Alan Alpert
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] QML Window handling focus events

2013-05-20 Thread Daiwei Li
It looks the QQuickWindow C++ class has focusIn and focusOut event
handlersthat
you can override, but there's no signal in QML. Am I missing something
or is it intentionally left out of QML?

Thanks,
Daiwei
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Language codes, etc. (Set of ISO 639 standards)

2013-05-20 Thread Thiago Macieira
On segunda-feira, 20 de maio de 2013 18.19.26, Dmitrii Volosnykh wrote:
> Hi,
> 
> does Qt provide any stuff regarding language codes and their names for
> use in application multi language applications?

See QLocale's documentation, especially this one:
http://qt-project.org/doc/qt-4.8/qlocale.html#matchingLocales
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center


signature.asc
Description: This is a digitally signed message part.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Language codes, etc. (Set of ISO 639 standards)

2013-05-20 Thread Dmitrii Volosnykh
Hi,

does Qt provide any stuff regarding language codes and their names for
use in application multi language applications?

Regards,
Dmitrii.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Development] Nested Mousearea don't pass events

2013-05-20 Thread Giuseppe D'Angelo
Hi,

Il 20/05/2013 14:36, Matteo Brichese ha scritto:
> This is a sample of my code:
>
> import QtQuick 2.0
>
> Rectangle {
>  width: 1024
>  height: 768
>
>  MouseArea {
>   anchors.fill: parent;
>   onClicked: console.log("Click")
>   }
>
>  MouseArea {
>  anchors.fill: parent;
>  onDoubleClicked: console.log("Double Click")
>  }
> }
>
> I can only see logs of the double click.
> I was hoping that if I single click the last mousearea the event passed to 
> the second one, but it don't work, is that a bug?

Being a question about developing *with* Qt, the right list to post this 
message is the interest list, not the development list.

Anyhow, I think you just miss a "propagateComposedEvents: true" in the 
second MouseArea. Note that for a double click you're still going to 
receive the first click in the bottom MouseArea (in other words I expect 
that a double click will print "Click" and "Double Click").

Hope this helps,
-- 
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt5.1+, custom QQuickItem with text, not using QPainter?

2013-05-20 Thread Unai IRIGOYEN
Hello,

I'm also interested in using text in custom QQuickItem derived classes (text is 
only a part of the whole item view).
As both tasks metioned are marked as merged, what is the new status of text in 
custom QQuickItem derived classes? Is there already a doc explaining the 
process of adding text in scenegraph?

Regards.

-- 

Unai IRIGOYEN


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest