Re: [Interest] all caps font on android 8

2018-04-13 Thread maitai

Hi Christoph,

I am afraid I don't remember all the details but I think I ended up 
adding a font dialog in the app main settings, and the user succeeded to 
find a more suitable font.


I can also see in my code stuff like

QFont def = qApp->font();
if(!Settings::getSetting(defaultFontName).toString().isEmpty())
def = QFont(Settings::getSetting(defaultFontName).toString());
def.setHintingPreference(QFont::PreferNoHinting);
def.setPixelSize(QFontInfo(fapp).pixelSize());
def.setCapitalization(QFont::MixedCase);
QApplication::setFont(def);
QApplication::setFont(def, "QWidget"); //important

which as I remember are coming from that story.

Hope that helps,
Philippe.

Le 14-04-2018 08:39, Christoph Keller a écrit :

Hi Philippe,

I received the same bug report from a user. Have you found a
solution/cause? I haven't found anything by googling around, just your
mailing list entry.

Just for the statistics: QtQuickControls 2 application with Qt 5.10.1;
User has a OnePlus 3 running Android 8.0.0. Other 8.x devices from
Sony or Google Pixel don't show this bug.

Greetings,
Christoph


On 14.02.18 22:43, maitai wrote:

Hi all,

I have a user complaining that all fonts (dialog, QGraphicsScene, etc) 
are in capital letters on Android 8


It's a QWidget-based application, qt 5.9.4

I have send him some attempts to correct this, in other words forcing 
each and every setFont with a font set with 
setCapitalization(QFont::MixedCase);


Same result, all fonts are capitalized.

At start I force (in java) theme to be 
"Theme_Holo_NoActionBar_Fullscreen"


Is it linked to Android 8 (which I don't have here) ? Any idea?

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

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


Re: [Interest] all caps font on android 8

2018-04-13 Thread Christoph Keller

Hi Philippe,

I received the same bug report from a user. Have you found a 
solution/cause? I haven't found anything by googling around, just your 
mailing list entry.


Just for the statistics: QtQuickControls 2 application with Qt 5.10.1; 
User has a OnePlus 3 running Android 8.0.0. Other 8.x devices from Sony 
or Google Pixel don't show this bug.


Greetings,
Christoph


On 14.02.18 22:43, maitai wrote:

Hi all,

I have a user complaining that all fonts (dialog, QGraphicsScene, etc) 
are in capital letters on Android 8


It's a QWidget-based application, qt 5.9.4

I have send him some attempts to correct this, in other words forcing 
each and every setFont with a font set with 
setCapitalization(QFont::MixedCase);


Same result, all fonts are capitalized.

At start I force (in java) theme to be 
"Theme_Holo_NoActionBar_Fullscreen"


Is it linked to Android 8 (which I don't have here) ? Any idea?

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


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


Re: [Interest] Using leveldb in a Qt app redirects unrelated system malloc calls to tcmalloc?

2018-04-13 Thread Thiago Macieira
On Friday, 13 April 2018 00:58:46 PDT René J. V. Bertin wrote:
> Thiago Macieira wrote:
> 
> Hi,
> 
> > of the parent. The fact that it's deadlocking in the code that is supposed
> > to remove locks so that it won't deadlock is a good irony.
> 
> Yeah, very funny until it happens to you :)
> 
> > Absent further proof to the contrary, this looks like a system bug.
> 
> You could be right, but how on earth do I end up in tcmalloc code here?

It's fork(). It calls the malloc routines.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center



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


[Interest] WebGL platform and audio

2018-04-13 Thread Glen Mabey
Hello,

I'm using 5.10.1 for a very simple QML application that also instantiates a 
QAudioOutput instance and sends data to it.

Not too surprisingly, the audio comes out on the machine running the executable 
and not the one running the webbrowser.  

I see that there is some concept of basic audio playback in WebGL, but don't 
know anything more than that:  https://docs.unity3d.com/Manual/webgl-audio.html

Is that the expected behavior for the Qt webgl platform?  Any prospect of that 
changing soon?

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


[Interest] QWebEngineView, internal links, & the urlChanged signal

2018-04-13 Thread Andy
I am generating a report as an HTML document and displaying it with a
QWebEngineView. This report uses internal links such as .

I have been using the following to add "Back" and "Forward" capabilities to
a QWebEngineView:

   connect( mWebView, &QWebEngineView::urlChanged, this, [=] () {
  mUI->mActionBack->setEnabled( mWebView->history()->canGoBack() );
  mUI->mActionForward->setEnabled( mWebView->history()->canGoForward()
);
   } );

It seems that QWebEngineView::urlChanged is no longer emitted when clicking
on these internal links even though the URL has changed.

Is this a regression or should I be using a different signal? (I don't see
any that look like they apply...)

Thank you for your time.

---
Andy Maloney  //  https://asmaloney.com
twitter ~ @asmaloney 
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] FileDialog: errors and crashes, especially in debug mode

2018-04-13 Thread mail

Hi,

I still have the problem mentioned in the attached mail from a few days 
ago.


I've found out, that this behaviour is linked to QML's FileDialog that I 
use in this way:


FileDialog{

//MessageDialog{

id:csvFileDialog

//fileMode:FileDialog.SaveFile

folder:(myFolder)

onAccepted:{

appController.importCSVAction(myFilename)//for testing, normally 
csvFileDialog.fileUrl
 csvFileDialog.close()

}
}

The crash (stacktrace: see below) comes a few seconds after accepting 
the FileDialog. It is - contrary to my last mail - also responsible for 
crashes without running with Debugger.
Those non-debug crashes appear later when I rush through the following 
UI pages (no crashes when I give the interface some time to rest!), 
quite some time after the FileDialog has been closed, so I had put the 
blame on my code.


Error messages before (when opening the FileDialog) are galore and 
diverse (see attached email) . Common is the term "onecore", there is 
"library not registered", "out of memory" (rubbish!), "can't find the 
specified file" and such.


When I Change it to "MessageDialog" (and comment out the folder 
property) everything runs like a charm and my code is working, too. No 
crashes, no matter how much load pressure I apply to the program.


Interesting side note: my FilderDialog doesn't know the 
"fileMode:"property!
I am importing the modules below, the problem appears with Dialogs 1.2 
as well as 1.1 (using the OLDDIALOGS qualifier).


Seems like a Qt bug because of changes in Win10 - is that correct?
Anyone any ideas?

Sebastian



importQtQuick2.7

importQtQuick.Controls1.4asQQC14

importQtQuick.Controls2.1

importde.herrdiel.classintouch.classintouch22.0

importQtQuick.Window2.2

importQtQuick.Layouts1.3

importQtQuick.Dialogs1.2

importQtQuick.Dialogs1.1asOLDDIALOGS




The stacktrace:
1   WTF::OSAllocator::reserveUncommitted OSAllocatorWin.cpp   
48   0x2e904ec2
2   WTF::PageReservation::reserve PageReservation.h    107  
0x2e882a7e
3   QV4::MemorySegment::MemorySegment qv4mm.cpp    123  
0x2e882a7e
4   QV4::ChunkAllocator::allocate qv4mm.cpp    257  
0x2e882a7e
5   QV4::BlockAllocator::allocate qv4mm.cpp    695  
0x2e882e2d
6   QV4::MemoryManager::allocData qv4mm.cpp    920  
0x2e8862d6
7   QV4::MemoryManager::allocManaged 
qv4mm_p.h    223  0x2e916f93
8   QV4::ExecutionContext::newCallContext qv4context.cpp   
69   0x2e916f93
9   QV4::ExecutionContext::call qv4context.cpp   269  
0x2e91ac5b

10  QV4::ScriptFunction::call qv4functionobject.cpp    411  0x2e94512c
11  QV4::Object::call qv4object_p.h    445  0x2e9a9bf7
12  QV4::Runtime::method_callProperty qv4runtime.cpp   1104 
0x2e9a9bf7

13  QV4::Moth::VME::run qv4vme_moth.cpp  600  0x2e99cb6b
14  QV4::Moth::VME::exec qv4vme_moth.cpp  976  0x2e99f630
15  QV4::ExecutionContext::call qv4context.cpp   274  
0x2e91af16
16  QQmlJavaScriptExpression::evaluate qqmljavascriptexpression.cpp 225  
0x2ea2535e
17  QQmlNonbindingBinding::doUpdate qqmlbinding.cpp  207  
0x2eab6c70

18  QQmlBinding::update qqmlbinding.cpp  168  0x2ea2fc5f
19  QQmlBinding::expressionChanged qqmlbinding.cpp  484  
0x2ea2fe05
20  QQmlJavaScriptExpressionGuard_callback qqmljavascriptexpression.cpp 
490  0x2ea24e67


Crashes with the CRASH(); function/macro here:

void*OSAllocator::reserveUncommitted(size_tbytes,Usage,boolwritable,boolexecutable) 



{

void*result=VirtualAlloc(0,bytes,MEM_RESERVE,protection(writable,executable));

if(!result)

CRASH();

returnresult;

}


 * Qt 5.10.0 MinGW / 32bit Debug
 * Windows Version 10.0.16299 Build 16299, 64 bit
 * Qt Creator 4.2.1,
 * Three Monitors.




--
http://www.classintouch.de - Tablet-Software für Lehrer

--- Begin Message ---

Hi,

I am experiencing problems while debugging my QML-based app. All the 
following error messages do **not** appear when I just run (Ctrl+r), 
they only do so in debug mode (F5).


[Symptom A]

When the Program window comes to front, I get:

onecore\com\combase\inc\comcataloghelpers.hpp(67)\combase.dll!746B8550: 
(caller: 746B82E0) ReturnHr(1) tid(43f4) 80004002 Schnittstelle nicht 
unterstützt

("No such interface supported") and
mincore\com\oleaut32\dispatch\ups.cpp(2125)\OLEAUT32.dll!73CA234F: 
(caller: 73CA1EF1) ReturnHr(1) tid(2b70) 8002801D Bibliothek nicht 
registriert.

("Library not registered", same again for ReturnHr(2)).

[Symptom B]

Also, interestingly, I can not see svg images when debugging. Fine when 
just running.


[Symptom C]

Opening a FileDialog from QtQuick.Dialogs1.2 in debug mode, I get the 
loads of errors (again: works in run mode) - and afterwards many crashes 
that I cannot yet understand.


First is

onecoreuap\shell\windows.storage\regfldr.cpp(1239)\windows.storage.dll!74A1A719: 
(caller: 74A186F0) ReturnHr(1) tid(2b70) 80004001 Nicht implementiert


[Interest] Can I build qt-android with exception disabled?

2018-04-13 Thread Liang Jian
I build qt-android 5.9 with GCC 4.9, I want generate the binary as
small as possible. Disable C++ exception will be a way to reduce binary
size, the question is can I build qt-android with exception disabled?
 Thanks.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QtQuick Controls 2 and Designer: Should I use Styles or Customize?

2018-04-13 Thread Shantanu Tushar
It helps ThemeContext.qml to determine if there is already a "theme"
defined in the context and if that is using the dialog colors.

QVariant SoStronk::contextPropertyForQmlObject(QObject *o, QString name)
{
auto context = QQmlEngine::contextForObject(o);

if (!context) {
qWarning() <<
   "Context is null, maybe attempt to call
contextPropertyForQmlObject for non-QML object";
return "";
}

return context->contextProperty(name.toUtf8().data());
}

On 11 April 2018 at 20:32, Jérôme Godbout  wrote:
> Look nice, but what exactly does the function
> SoStronk.contextPropertyForQmlObject(obj, string) does ?
>
>
>
> 
> From: Shantanu Tushar 
> Sent: April 11, 2018 9:29 AM
> To: Jérôme Godbout
> Cc: Thomas Hartmann; interest@qt-project.org
>
> Subject: Re: [Interest] QtQuick Controls 2 and Designer: Should I use Styles
> or Customize?
>
> Hi,
>
> Thanks for the suggestion. I ended up implementing it like this-
>
> $ cat theme/v2/Theme.qml
> pragma Singleton
>
> import QtQuick 2.10
> import QtQuick.Window 2.3
>
> Item {
> visible: false
>
> GlassColors {
> id: glassColors
> }
>
> PlatinumColors {
> id: platinumColors
> }
>
> readonly property var colors: glassColors
> readonly property var dialogColors: platinumColors
> ...
> ...
> }
>
> $ cat theme/v2/ThemeContext.qml
> import QtQuick 2.10
>
> Item {
> id: root
> visible: false
>
> readonly property var _inheritedTheme:
> SoStronk.contextPropertyForQmlObject(root.parent, "theme")
> readonly property bool _inheritedDialogColors: _inheritedTheme &&
> _inheritedTheme.dialogColors ? true : false
>
> property bool dialogColors: false
> readonly property var colors: dialogColors ||
> _inheritedDialogColors ? Theme.dialogColors : Theme.colors
> }
>
> where contextPropertyForQmlObject is a C++ function which returns the
> value of a property under the context of the specified object.
> Its used like this-
>
> $ cat SoStronkStyle/Button.qml
> import QtQuick 2.10
> import QtQuick.Templates 2.3 as T
>
> import SoStronk.theme 0.2
>
> T.Button {
> id: control
>
> ThemeContext {
> id: theme
> }
> ...
> // access theme.colors.foregroundColor
>
> And whenever I create a dialog-
>
> ThemeContext {
> id: theme
> dialogColors: true
> }
>
> So then any Button accessing theme.colors will end up referring to
> dialogColors :)
>
>
> On 9 April 2018 at 21:35, Jérôme Godbout  wrote:
>> You could have a property inside the controler to select the proper theme
>> value with a fallback, your theme singleton would then need to have
>> different set of color.
>>
>>
>> Theme
>>
>> {
>>
>>id: component
>>
>>property var defaultTheme: panelTheme
>>
>>property var mainTheme: ...
>>
>>property var panelTheme: ...
>>
>>
>>   function getTheme(prop)
>>
>>   {
>>
>>  if(prop && component.hasOwnProperty(prop))
>>
>> return component[prop];
>>
>>  return component.defaultTheme;
>>
>>   }
>>
>> }
>>
>>
>> T.Button
>>
>> {
>>
>>id: component
>>
>> color: Theme.getTheme(component.customTheme).backgroundColor
>>
>> }
>>
>>
>> // use style with default theme
>> Button
>> {
>> }
>>
>> // Button with theme color
>> Button
>> {
>> property string customTheme: 'mainTheme'
>> }
>>
>> As for loading a multiple different template I think it would be
>> impossible.
>>
>> 
>> From: Interest  on
>> behalf of Shantanu Tushar 
>> Sent: April 9, 2018 11:30 AM
>> To: Thomas Hartmann
>> Cc: interest@qt-project.org
>> Subject: Re: [Interest] QtQuick Controls 2 and Designer: Should I use
>> Styles
>> or Customize?
>>
>> Hi,
>>
>> I've been slowly implementing these suggestions and so far the results
>> have been great. My button style looks like this-
>>
>> import QtQuick 2.9
>> import QtQuick.Templates 2.1 as T
>>
>> import My.theme 0.2
>>
>> T.Button {
>> // Here i use properties like Theme.backgroundColor, Theme.textColor
>> etc
>> }
>>
>> However, I just hit a roadblock which deals with multiple styles in
>> the same application. Our designer has created two sets of theme
>> colors - Glass and Dark, Glass it to be used on the "Main window" of
>> our application and Dark is used on rest of the dialogs. See
>> https://www.sostronk.com/assets/tilt-a780c798bf78e6c5.png
>>
>> Now, because Theme is a singleton, there is no way for me to define a
>> different set of colors for a Dialog. Any suggestions on how to
>> achieve this?
>>
>> Thanks,
>>
>> On 26 March 2018 at 19:37, Shantanu Tushar  wrote:
>>> Hi Thomas,
>>>
>>> I've tried both your suggestions in a PoC project and it works! My
>>> actual app will need some refactoring to get the ball rolling but I
>>> think this will work fine.
>>>
>>> Thanks a lot,
>>>
>>>
>>> On 16 March 2018 at 19:32, Thomas Hartmann  wrote:
 Hi,


 I would suggest solution number 1 (Creating a Custom Style).


 To get the d

Re: [Interest] resizable QTextEdit

2018-04-13 Thread Igor Mironchik

Hi,

Something like this?


#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

class Text;

class Corner
    :    public QWidget
{
public:
     Corner( QWidget * parent )
        :    QWidget( parent )
        ,    m_toResize( parent )
        ,    m_pressed( false )
    {
    }

    virtual ~Corner()
    {
    }

    QSize sizeHint() const Q_DECL_OVERRIDE
    {
        return QSize( 10, 10 );
    }

protected:
    void paintEvent( QPaintEvent * ) Q_DECL_OVERRIDE
    {
        QPainter p( this );
        p.setPen( Qt::red );
        p.setBrush( Qt::red );

        p.drawRect( rect() );
    }

    void mousePressEvent( QMouseEvent * e ) Q_DECL_OVERRIDE
    {
        if( e->button() == Qt::LeftButton )
        {
            m_pos = e->pos();
            m_pressed = true;
        }

        e->accept();
    }

    void mouseReleaseEvent( QMouseEvent * e ) Q_DECL_OVERRIDE
    {
        if( e->button() == Qt::LeftButton )
            m_pressed = false;

        e->accept();
    }

    void mouseMoveEvent( QMouseEvent * e ) Q_DECL_OVERRIDE
    {
        if( m_pressed )
        {
            const QPoint delta = e->pos() - m_pos;

            m_toResize->resize( m_toResize->size() + QSize( delta.x(), 
delta.y() ) );

        }

        e->accept();
    }

private:
    QWidget * m_toResize;
    QPoint m_pos;
    bool m_pressed;
};

class Text
    :    public QTextEdit
{
public:
    Text( QWidget * parent )
        :    QTextEdit( parent )
        ,    m_corner( new Corner( this ) )
    {
        m_corner->move( width() - m_corner->width(),
            height() - m_corner->height() );
    }

    virtual ~Text()
    {
    }

protected:
    void resizeEvent( QResizeEvent * e ) Q_DECL_OVERRIDE
    {
        m_corner->move( width() - m_corner->width(),
            height() - m_corner->height() );

        e->accept();
    }

private:
    Corner * m_corner;
};

class Form
    :    public QWidget
{
public:
    Form()
    {
        QVBoxLayout * v = new QVBoxLayout( this );
        QHBoxLayout * h = new QHBoxLayout;
        v->addLayout( h );
        QLabel * label = new QLabel( "Resizeable Text Field", this );
        h->addWidget( label );
        Text * text = new Text( this );
        h->addWidget( text );
        QSpacerItem * s = new QSpacerItem( 10, 10, QSizePolicy::Fixed,
            QSizePolicy::Expanding );
        v->addItem( s );

        resize( 800, 800 );
    }

    virtual ~Form()
    {
    }
};

int main( int argc, char ** argv )
{
    QApplication app( argc, argv );

    Form f;
    f.show();

    return app.exec();
}


On 13.04.2018 10:34, Alexander Semke wrote:

Hi,

one frequently sees form text fields on the web where the actual text field can
be resized by the user by clicking on the resize-symbol in the corner of the
text field and dragging it until the desired size is achieved. I'm wondering
how to get this for a QTextEdit  placed in a layout. Does somebody have an
idea here?


Thanks and Regards,
Alexander


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


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


Re: [Interest] Using leveldb in a Qt app redirects unrelated system malloc calls to tcmalloc?

2018-04-13 Thread René J . V . Bertin
Thiago Macieira wrote:

Hi,

> of the parent. The fact that it's deadlocking in the code that is supposed to
> remove locks so that it won't deadlock is a good irony.

Yeah, very funny until it happens to you :)

> 
> Absent further proof to the contrary, this looks like a system bug.

You could be right, but how on earth do I end up in tcmalloc code here?

In my experiment I'm trying to store ints (index numbers used as the key) as 4-
byte strings in QByteArrays which get converted to std::strings for use with 
leveldb. I half expect that I'm overlooking a place where this goes wrong, but 
also that that would lead to more variable crash backtraces.

I use Chrome as a browser, which must use leveldb internally, so if this were a 
system bug I'd expect to see deadlocks while surfing. That just doesn't happen, 
which probably means we can at least not factor Qt out of the equation.

R.

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


[Interest] resizable QTextEdit

2018-04-13 Thread Alexander Semke
Hi,

one frequently sees form text fields on the web where the actual text field can 
be resized by the user by clicking on the resize-symbol in the corner of the 
text field and dragging it until the desired size is achieved. I'm wondering 
how to get this for a QTextEdit  placed in a layout. Does somebody have an 
idea here?


Thanks and Regards,
Alexander


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