[Interest] QStandardItemModel - Delegate with custom widget

2017-01-26 Thread Dirk Neumann
Hello,

I know that this is nearly an everlasting topic - place a custom Widget
into a QTreeView.
The widget I want to be displayed is up to now I arranged a QLabel and a
QTextEdit, but in Future the widget will be of higher complexity.
Nevertheless, the widget itself works for me and is called
ReqTextItemWidget.
I derived QStyledItemDelegate and overrode createEditor(),
setEditorData(), setModelData(). All these methods do what I expect,
the data from model will be passed into editor and vice versa, I can
edit data, fine.
I also overrode sizeHint() and paint() of the delegate. My sizeHint
method looks:

QSize ReqTextDelegate::sizeHint(const QStyleOptionViewItem ,
  const QModelIndex ) const{
  ReqTextItemWidget *item_widget=new ReqTextItemWidget();
  QString value=index.data().toString();
  item_widget->set_caption("Unicornpolish");
  item_widget->set_maintext(value);
  item_widget->setGeometry(option.rect);
  return item_widget->sizeHint();
}

where set_maintext() sets the text in the QTextEdit and set_caption()
sets the text in the QLabel, just to get a calculated size.
This is my paint()-method:

void ReqTextDelegate::paint(QPainter *painter,const
QStyleOptionViewItem , QModelIndex const& index)
const{ QPaintDevice* original_pdev_ptr = painter->device();

  if (option.state & QStyle::State_Selected)
  painter->fillRect(option.rect, option.palette.highlight());
  ReqTextItemWidget *item_widget=new ReqTextItemWidget(); QString
  value=index.data().toString();
  item_widget->set_caption("Unicornpolish");
  item_widget->set_maintext(value);

  // geometry
  item_widget->setGeometry(option.rect);

  painter->end();
  // rendering of QWidget itself
  //region relative to option.rect
  int region_x=-100;  //  > value
  int region_y=-25;   //  > value
  int region_w=option.rect.width()-region_x;
  int region_h=option.rect.height()-region_y;
  item_widget->render(painter->device(), QPoint(option.rect.x(),
option.rect.y()), QRegion(region_x, region_y, region_w, region_h),
QWidget::RenderFlag::DrawChildren);

  painter->begin(original_pdev_ptr);
}

My problem now is the adjustment of the values region_x and region_y
for placing the widget just to the same place as the editor.
But hard coding values are eval. Not portable. No-Go. What can I do
here?

I also played around with setIndexWidget(), but then it seems
that I loose control over the widgets: Selecting and editing in one
widget has nothing to do with the selected item in my QTreeView. I
could catch some signals from the widgets to adjust the selection of
the QTreeView (and maybe can even handle it by using QSignalMapper) but
I fear the moment when I do some changes in the model which change the
tree structure...

Greetings

Dirk.


pgpvAYxJsMba2.pgp
Description: Digitale Signatur von OpenPGP
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] TypeError during cythonize

2017-01-26 Thread Frank Rueter | OHUfx

true, will do, thanks.

On 26/01/17 11:03 PM, Alexandru Croitor wrote:

Hi,

In case you are using PyQt, I would suggest you will get higher 
response rates at the PyQt mailing list,
because this particular curiosity does not seem related to the 
internal Qt code.


On 25 Jan 2017, at 21:38, Frank Rueter | OHUfx > wrote:


Hi all,

I have run into this issue a couple of times now:

Some of my class declarations look like this:

class DBTaskQueue(QtCore.QObject):
def __init__(self, npdbInstance, task=None, parent=None):
super(DBTaskQueue, self).__init__(parent)


This works fine when run as pure python code but when I cythonize I 
get this error:


TypeError:super(type,obj):obj must be an instance orsubtype of type


The error only happens when I provide arguments to t super() - e.g. 
"parent" in this case.

The workaround is to use this instead:

class DBTaskQueue(QtCore.QObject):
def __init__(self, npdbInstance, task=None, parent=None):
*QtCore.QObject.__init__(self, parent)*


When there is no  argument to super() it always seems to be happy.

Is this a bug or user error?

Cheers,
frank


--
  	*vfx compositing 
 | *workflow customisation and 
consulting * *


___
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


[Interest] qtgamepad Support for Microsoft Xbox 360 Wireless Receiver+Controller for Mandelbulber2

2017-01-26 Thread ƦOB COASTN
Greetings,

Currently QTgamepad 5.7.1 on Windows Server 2012R2 fails to operate correctly.
The "Qt Gamepad Configure Buttons Example" compiles and runs, but the
connected Gamepads drop down never populates.
However, the values for the gamepad input accurately reflect button
and stick status.

It seems that something is not properly functioning with the
"GamepadManager.connectedGamepads".

Please consider the following changes:

https://github.com/buddhi1980/mandelbulber2/commit/a5da4831016cd01080b772e7690305d5a9f28f6c


Any advice for troubleshooting?

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


Re: [Interest] Qt5.8 doesnot show consolewindow on windows os

2017-01-26 Thread Günter Michel

Am 26.01.2017 um 13:46 schrieb Björn Piltz:

https://bugreports.qt.io/browse/QTBUG-57687

2017-01-26 13:45 GMT+01:00 Björn Piltz >:


Seems to be because of this:

http://code.qt.io/cgit/qt/qtbase.git/commit/src/corelib/io/qprocess_win.cpp?id=bec2fc19fd18768b16925597871c77a61e716abd






2017-01-26 12:00 GMT+01:00 Günter Michel >:
>
> In Qt5.7 starting a detached console works fine.
>
> void MainWindow::start()
>
> {
>
> QProcess p;
>
> QStringList args;
>
> args << "/k";
>
> p.startDetached("cmd", args);
>
> }
>
> In Qt5.8 Process 'cmd /k' is started, but no console window is
shown.
>
> Any suggestions?
>
>
>
> ___
> 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
To restore the 5.7 behaviour i tried to do this like the documentation 
suggests


p.setCreateProcessArgumentsModifier([](QProcess::CreateProcessArguments*args) 



{

args->flags|=CREATE_NEW_CONSOLE;

args->startupInfo->dwFlags&=~STARTF_USESTDHANDLES;

args->startupInfo->dwFlags|=STARTF_USEFILLATTRIBUTE;

args->startupInfo->dwFillAttribute=BACKGROUND_BLUE|FOREGROUND_RED

|FOREGROUND_INTENSITY;

});

but the function won't be called.

--
MES Industrieautomation GmbH
Simmershäuser Straße 102D
D-34125 Kassel

Tel.  0049(0561) 813004
Fax   0049(0561) 813005
Mobil +49 172 9822485
E-mail: g...@mes-ia.de
http:// www@mes-ia.de

Registergericht: Amtsgericht Kassel HRB5618

Geschäftsführer: Ralf Brüne
 Günter Michel
 Axel Rosenthal
 Manfred Stangl

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


Re: [Interest] webenginewidgets and Qt 5.8 for WinRT armv7 kit

2017-01-26 Thread Jan 'Koviš' Struhár

On 01/25/2017 01:36 PM, Alexandru Croitor wrote:

Hello,

WebEngine is not supported on WinRT platform.

It works only on Windows Desktop, Linux and macOS.
It is neither supported for WindowsDesktop@MinGW as I learned the hard 
way. Chromium does not compile with MinGW so you need to turn to MSVC on 
WinDesktop when you surely need QWebEngine...

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


Re: [Interest] Qt5.8 doesnot show consolewindow on windows os

2017-01-26 Thread Björn Piltz
https://bugreports.qt.io/browse/QTBUG-57687

2017-01-26 13:45 GMT+01:00 Björn Piltz :

> Seems to be because of this: http://code.qt.io/cgit/qt/
> qtbase.git/commit/src/corelib/io/qprocess_win.cpp?id=
> bec2fc19fd18768b16925597871c77a61e716abd
>
>
>
> 2017-01-26 12:00 GMT+01:00 Günter Michel :
> >
> > In Qt5.7 starting a detached console works fine.
> >
> > void MainWindow::start()
> >
> > {
> >
> > QProcess p;
> >
> > QStringList args;
> >
> > args << "/k";
> >
> > p.startDetached("cmd", args);
> >
> > }
> >
> > In Qt5.8 Process 'cmd /k' is started, but no console window is shown.
> >
> > Any suggestions?
> >
> >
> >
> > ___
> > 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] Qt5.8 doesnot show consolewindow on windows os

2017-01-26 Thread Björn Piltz
Seems to be because of this:
http://code.qt.io/cgit/qt/qtbase.git/commit/src/corelib/io/qprocess_win.cpp?id=bec2fc19fd18768b16925597871c77a61e716abd


2017-01-26 12:00 GMT+01:00 Günter Michel :
>
> In Qt5.7 starting a detached console works fine.
>
> void MainWindow::start()
>
> {
>
> QProcess p;
>
> QStringList args;
>
> args << "/k";
>
> p.startDetached("cmd", args);
>
> }
>
> In Qt5.8 Process 'cmd /k' is started, but no console window is shown.
>
> Any suggestions?
>
>
>
> ___
> 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


[Interest] Qt5.8 doesnot show consolewindow on windows os

2017-01-26 Thread Günter Michel

In Qt5.7 starting a detached console works fine.

voidMainWindow::start()

{

QProcessp;

QStringListargs;

args<<"/k";

p.startDetached("cmd",args);

}

In Qt5.8 Process 'cmd /k' is started, but no console window is shown.

Any suggestions?


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


Re: [Interest] TypeError during cythonize

2017-01-26 Thread Alexandru Croitor
Hi,

In case you are using PyQt, I would suggest you will get higher response rates 
at the PyQt mailing list,
because this particular curiosity does not seem related to the internal Qt code.

On 25 Jan 2017, at 21:38, Frank Rueter | OHUfx 
> wrote:

Hi all,

I have run into this issue a couple of times now:

Some of my class declarations look like this:
class DBTaskQueue(QtCore.QObject):
def __init__(self, npdbInstance, task=None, parent=None):
super(DBTaskQueue, self).__init__(parent)

This works fine when run as pure python code but when I cythonize I get this 
error:
TypeError: super(type, obj): obj must be an instance or subtype of type

The error only happens when I provide arguments to t super() - e.g. "parent" in 
this case.
The workaround is to use this instead:
class DBTaskQueue(QtCore.QObject):
def __init__(self, npdbInstance, task=None, parent=None):
QtCore.QObject.__init__(self, parent)

When there is no  argument to super() it always seems to be happy.

Is this a bug or user error?

Cheers,
frank

--
vfx 
compositing | workflow customisation and 
consulting
___
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