Re: [Interest] [Development] Windows 7 support will be, dropped in Qt 6

2020-06-18 Thread Christoph Feck

On 06/18/20 19:27, Roland Hughes wrote:

We are all just waiting on KDE to pull the trigger and tell us what
library(ies) will be used in the post-Qt world. The current licensing
and royalty situation make Qt unusable going forward.


There is no post-Qt world from the KDE point of view. It is impossible
to port hundreds of applications to a different toolkit, and this is the
reason we secured the availability of Qt in source code form under a
free software license via written agreements.

BG,
Christoph Feck

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


Re: [Interest] Qt3D performance, and development resources

2020-04-17 Thread Christoph Feck
Thanks to all for the interesting C++ Qt3D links! I long wanted to play 
with Qt3D in C++. RHI supporting all major 3D APIs makes it really 
attractive.


Christoph Feck

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


Re: [Interest] Best way to threaded render (images) going forward?

2019-11-19 Thread Christoph Feck

On 11/19/19 19:52, Wesley Krasko wrote:

Yes, I've read about RHI but it all seems to imply it's for QT Quick, what
about Qt Widget based apps going forward?


Let me quote what is written there: "We will need to base all our
rendering infrastructure (QPainter, the Qt Quick Scenegraph, and our 3D
support) on top of that layer."

QWidgets use QPainter for rendering.


Is my best bet QOpenGLWidget until 6.x comes out then and then re-write again?


If you are using OpenGL, RHI won't magically change your code. Use 
QPainter, the Qt Quick scene graph, or Qt3D, depending on your case.


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


Re: [Interest] Best way to threaded render (images) going forward?

2019-11-19 Thread Christoph Feck

On 11/19/19 19:33, David M. Cotter wrote:

is someone working on something like QNativeGraphics, which picks the best impl 
under the hood? eg: metal for macos, opengl for linux, and whatever it is now 
for windows?


See https://www.qt.io/blog/2019/08/07/technical-vision-qt-6
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QPainter drawLine zValue?

2019-09-25 Thread Christoph Feck

On 09/25/19 19:13, Israel Brewster wrote:

Is there a way to set the Z value of the line drawn by the QPainter::DrawLine() 
function? I have a library that uses the drawLine function to create a grid, 
and I would like to keep the grid on the top as I draw other things, if 
possible. Thanks.


QPainter has no concept of a Z value. I suggest to look at 
QGraphicsView; it allows placing items with a Z coordinate, but also has 
support for permanent background and foreground graphics, either via 
brush or callback functions.


To minimize porting, you could wrap all your "other" painter calls into 
a single QGraphicsItem; but you could also split your scene into 
multiple smaller items.

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


Re: [Interest] Question Regarding Porting Gtk To PyQt

2019-06-16 Thread Christoph Feck

On 06/17/19 03:57, Christoph Feck wrote:

* https://doc.qt.io/qtforpython/PySide2


* https://doc.qt.io/qtforpython/

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


Re: [Interest] Question Regarding Porting Gtk To PyQt

2019-06-16 Thread Christoph Feck

On 06/17/19 03:29, Samuel Banya wrote:

Hello everyone,

I'm having a bit of difficulty of helping the Lubuntu team port a
program called RedShift from Gtk to PyQT.

The reason is that the Qt docs are primarily C++ based, and though I
know there is a PyQt variant that focuses on Python, its not as up to
date as the ones present for the C++ variant of the docs.


Qt docs include PySide documentation, but not PyQt documentation:

* https://doc.qt.io/qtforpython/PySide2


That being said, I have my current progress of trying to port this Gtk
program to PyQt here:

https://github.com/SBanya/redshift-1.12

If someone could take a look at the commented sections in the
controller.py for starters, I'd really appreciate it since I'm having
difficulty on finding the exact Gtk variant present:

https://github.com/SBanya/redshift-1.12/blob/master/redshift-1.12qt/src/redshift-qt/controller.py

Thank you for reading my message!


Spawning external processes is done with QProcess:

* https://doc.qt.io/qtforpython/PySide2/QtCore/QProcess.html

Note that QProcess is an QIODevice, so the output streams of the
external process can be monitored with its signals.
QFileSystemWatcher is used for 'inotify' handling, so unrelated.

For low-level (Linux) signal handling use QProcess.processId().

HTH,
Christoph

--
Christoph Feck

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


Re: [Interest] Qt::GlobalColor to pixel value

2019-03-19 Thread Christoph Feck

On 03/19/19 19:25, Jason H wrote:

What is the simplest way to go from:

QList pallette 
{Qt::black,Qt::red,Qt::darkRed,Qt::green,Qt::darkGreen,Qt::blue,Qt::darkBlue,Qt::cyan,Qt::darkCyan,Qt::magenta,Qt::darkMagenta,Qt::yellow,Qt::darkYellow};

To a pixel QRgb?

image.setPixel(x,y, pallette[5]);

The .toRgb() of QColor does not actually return a QRgb, instead it converts the 
color to RGB representation internally.

I've hacked this:
uint toRgb(const QColor ) {
return qRgb(c.red(), c.blue(), c.green());
}

image.setPixel(x,y, toRgb(pallette[5]));

but it seems so obtuse.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest




https://doc.qt.io/qt-5/qcolor.html#rgb

or use https://doc.qt.io/qt-5/qimage.html#setPixelColor
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] vs. Flutter

2019-02-19 Thread Christoph Feck

On 02/19/19 20:47, Jason H wrote:

What I've learned is that it's better to stand on the shoulders of giants than to rewrite 
the universe from scratch. I dream of a say where we can code things and everyone else 
regardless of platform can run it. I thought this was going to be .Net CLR, or Java VM, 
but corporate ownership initiatives derailed them (Much like the "You will" ATT 
ads of the 90s - we got it, but not from ATT). But C/C++ runs all more 
platforms/processors. Linux has come a long way in terms of bringing all CPUs a usable 
software ecosystem. And this though rather obtuse is one reason to pick Qt - that it'll 
support any system that can run a C++ compiler. You don't technically need to use QML, 
you can keep going with C++.


Once upon a time a mother of two curious boys called me, asking me to 
teach them programming. They have no clue what language to start with, 
so I suggested C as a base, to later learn Python, C++, Java (or C#).

Then some "smart" student told one of the kids "JavaScript is da future
of da Internetz". I stopped teaching them after it was suggested to
stop the C course and swap it for a JavaScript course.

C/C++ will be relevant in the future. All other languages will come and
go (no pun intended).

Whether Qt will be relevant in the future lies in the hands of its
developers. Don't ruin it.

Christoph Feck

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


Re: [Interest] Priority of bugs

2018-09-20 Thread Christoph Feck

On 20.09.2018 14:59, Krzysztof Kawa wrote:

[...] If a new feature has
a bug I just don't start to use it, no problem, but if something
breaks after update I'd like to at least know I can skip a release and
wait for a fix.


While this makes sense, in practice most bug fixing is spent to make the 
new features actually work. There is no point in adding features, if 
they are not useable because of bugs.


Since time and developer resources are limited, even that goal is hardly 
reached, so it seems natural that fixes for other issues need additional 
help and/or additional time.


Also note that everyone has their own favorite bugs. For example, I am 
still using Qt 4 for one of my applications because of QTBUG-57485, but 
hey, Qt 4 still works :)


--
Christoph Feck
KDE Bug Triaging Team

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


Re: [Interest] Complex border from QPainterPath

2018-06-29 Thread Christoph Feck

On 29.06.2018 19:19, Patrick Stinson wrote:

I am trying to construct a text callout QGraphicsItem. It is basically a rounded
rect plus some triangular  protrusions from the rect center to various points
outside the rounded rect (see screenshot).


See attached example code.

#include 
#include 
#include 
#include 
#include 

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

QImage im(800, 600, QImage::Format_RGB32);
im.fill(Qt::black);

QRectF bubble(500, 100, 200, 80);

QPainterPath path;
const double r = qMin(bubble.width(), bubble.height()) / 2;
path.addRoundedRect(bubble, r, r);

QList markers = {QPointF(200, 500), QPointF(400, 400), QPointF(600, 500)};
for (QPointF mark : markers) {
QPainterPath marker;
marker.moveTo(mark);
QLineF side(bubble.center(), mark);
side = side.normalVector();
side.setLength(r / 2);
marker.lineTo(bubble.center() + QPointF(side.dx(), side.dy()));
marker.lineTo(bubble.center() - QPointF(side.dx(), side.dy()));
marker.closeSubpath();
path = path.united(marker);
}

QPainter p;
p.begin();
p.setBrush(Qt::white);
QPen pen(Qt::red);
pen.setWidth(5);
pen.setCapStyle(Qt::RoundCap);
pen.setJoinStyle(Qt::RoundJoin);
pen.setMiterLimit(1);
p.setPen(pen);
p.drawPath(path);
p.drawText(bubble, Qt::AlignCenter, QStringLiteral("Here we are"));
p.end();

QLabel label;
label.setPixmap(QPixmap::fromImage(im));
label.setFixedSize(im.size());
label.show();

return app.exec();
}

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


Re: [Interest] Can't set line height for QPlainTextEdit

2018-06-05 Thread Christoph Feck

On 06.06.2018 03:52, nus1998 wrote:

I want to set line height for QPlainTextEdit, here is my code, but it doesn't 
work, the line height is always same as the font height.
btw: If I change QPlainTextEdit to QTextEdit, then it works.


QPlainTextEdit has vastly simpler layouting code to speed up text where 
formatting is not relevant (e.g. log files). As such, it is most 
certainly intended to ignore the request for additional block formatting 
commands.

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


Re: [Interest] QDatastream, QMap, QImage serialization

2018-05-21 Thread Christoph Feck

On 21.05.2018 16:36, Murphy, Sean wrote:

Why is QImage even a GUI type?


"Has pixels" is the simplest defintiion of GUI.


As a counter to that: QImage be safely used outside of the GUI thread which
is not true for most classes that are considered GUI classes...


But doesn't QImage need PNG to serialize data? I wouldn't want a libpng 
dependency in command line applications.


Maybe for Qt6 we could have a thin QtGuiCore library, which manipulates 
image data and colors, but does not have a dependency on GUI servers 
(OpenGL, X11, etc.)


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


Re: [Interest] QImage transformed() background color

2018-05-07 Thread Christoph Feck

On 07.05.2018 21:56, Jason H wrote:

I'm rotating some images by non-90 degree amounts, but when I do, the image 
gets filled with a color value (black) for pixels where there is no image data 
after rotation, but are in the output image, which causes a problem with later 
analysis because it trips edge detection. It would be nice to be able to 
control the fill color, or better yet, not have any fill as a result of the 
rotate, and just use want's in the image. Ideally, I'd like to pass it a 
fillColor (Qt::transparent) so that I can just look at the alpha channel and 
ignore pixels with a 0 alpha. How can I accomplish that if I can't select the 
color?

I don't know that it's possible to select the rotated rectangle out and draw it 
on a transparent image with a QPainter?


QImage rotate(const QImage , double degrees){
if (degrees > 0.01 || degrees < -0.01) {
QTransform tx;
QPoint center = image.rect().center();
tx.translate(center.x(), center.y());
tx.rotate(degrees);
return image.transformed(tx, Qt::SmoothTransformation);
} else {
return image;
}
}


The rotated image is filled with transparent pixels for ARGB images. You 
can use QPainter compositing to paint that image on any colored 
background (or on your original image).


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


Re: [Interest] XML parsing

2017-07-17 Thread Christoph Feck

On 17.07.2017 21:25, Francisco Ares wrote:

Hi, all.

I'm pretty new to programming, in special regarding XML generation and
parsing.

Could anyone help me parse the following file?




1
3.0
SingleFrame


Meaning 3 settings in a device, one on each line that shows first the type
of the setting, the name to which this device's API would respond to, then
the new value for that setting.

For now, I have the following, mostly from samples:

QDomDocument doc("mydocument");
QFile file("myfile.xml");
if (!file.open(QIODevice::ReadOnly))
return;
if (!doc.setContent()) {
file.close();
return;
}
file.close();

QDomElement docElem = doc.documentElement();

QDomNode n = docElem.firstChild();
while(!n.isNull()) {
QDomElement e = n.toElement(); // try to convert the node to an element.
if( ( !e.isNull() ) && n.isElement() ) {
QString aType = e.nodeName();
QString aValue = e.text();
}
n = n.nextSibling();
}


This returns me the the type and the value, but I could not find a way
to obtain the name of the setting (for instance, "AcquisitionMode" on
line 3.

Any help will be highly appretiated!

Thanks,
Francisco


Use QDomElement::attribute() or QDomElement::attributeNode().
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] WindowStaysOnTopHint on Windows always on top?

2017-07-10 Thread Christoph Feck

On 10.07.2017 19:19, John Weeks wrote:

We have a QWidgets application that uses  WindowStaysOnTopHint for certain 
windows. My expectation is that when the application isn't the active 
application, the floating windows should not be visible. But in our application 
they are visible always. Is this expected? Maybe I should file a bug on this 
behavior.


In Plasma's window manager KWin, there is an option for this, so I guess 
it decided by the window manager, not Qt.


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


Re: [Interest] QT expert's help required for mentoring Linux Foundation GSoC project.

2017-06-30 Thread Christoph Feck

On 09.06.2017 17:17, Aveek Basu wrote:

This is Aveek from Linux Foundation. Currently myself and Till Kempeter,
are working as the org admins of the LF GSoC project. This year have
undertaken a project of developing the Common Print Dialog for Linux (
https://wiki.linuxfoundation.org/gsoc/google-summer-code-20
17-openprinting-projects). This project will for sure improve the user
experience on how we all print in Linux today.

The project involves development of the complex Common Print dialogs in QT.
We are badly in need of someone who has development experience in QT
upstream to guide our students. It will be of great help if someone from
the community could could show interest.


Is the aim to merge this printing dialog into Qt sources to replace the 
current Qt print dialog? http://doc.qt.io/qt-5/qprintdialog.html


If yes, then the GSoC students should contact Qt developers at the Qt 
development mailing list, and discuss their plans. Unfortunately, the 
former QPrinter maintainer is busy with his paid job, so I see 
difficulties here.


If not, then I suggest that the GSoC students just post questions to the 
Qt interest mailing list, #qt IRC channel, or official Qt forum at 
https://forum.qt.io/


Please do not use any other Qt mailing list.

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


Re: [Interest] Syncing tree views.

2016-07-29 Thread Christoph Feck
On Friday 29 July 2016 17:14:08 william.croc...@analog.com wrote:
> On 07/29/2016 11:07 AM, Christoph Feck wrote:
> > On Friday 29 July 2016 16:58:31 william.croc...@analog.com wrote:
> >> On 07/29/2016 10:33 AM, Christoph Feck wrote:
> >>> On Friday 29 July 2016 16:14:41 william.croc...@analog.com 
wrote:
> >>>>>> applies to items which are common to both.)
> >>>>> 
> >>>>> KF5 has a solution for that. I'm not an Model/View expert,
> >>>>> but i think this is what you're looking for:
> >>>>> 
> >>>>> https://api.kde.org/frameworks/kitemmodels/html/classKLinkIte
> >>>>> mS el ectionModel.html
> >>>> 
> >>>> Thanks for the pointer. Alas...
> >>>> - I am industry and this is GPL.
> >>> 
> >>> KDE libraries and frameworks are LGPL.
> >> 
> >> The commentary at the top of the associated files,
> >> as linked above, says GPL.
> >> 
> >>   This library is free software; you can redistribute it
> >>   and/or
> >> 
> >> modify it under the terms of the GNU Library General Public
> >> License as published by the Free Software Foundation; either
> >> version 2 of the License, or (at your option) any later version.
> > 
> > Which part of "Library General Public License" is not LGPL?
> 
> IIRC: The first 'L' in LGPL stands for 'Lesser', not 'Library'.

For version 2 (which the above text refers to), it was called 
"Library". You are free to use the later versions, whatever name they 
now have.
See https://www.gnu.org/licenses/old-licenses/lgpl-2.0.en.html

> >>>> - I do not currently use any KDE and
> >>>> 
> >>>>  I do not like adding dependencies.
> >>> 
> >>> Dependencies besides qtbase?
> >> 
> >> I use the Qt modules, but little more.
> > 
> > Remember that adding KItemModels, or other Tier 1 frameworks
> > listed on https://api.kde.org/frameworks/index.html is
> > equivalent to adding other Qt dependencies, e.g. QtSvg or
> > QtXmlPatterns, because those only require qtbase.
> 
> Yes. I use all of those Qt module and have no problem with that.

Exactly. If you have a problem with KItemModels, or other Tier 1 
frameworks marked "functional", then we would love to know.
The initial letter "K" cannot be the issue :)
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Syncing tree views.

2016-07-29 Thread Christoph Feck
On Friday 29 July 2016 16:58:31 william.croc...@analog.com wrote:
> On 07/29/2016 10:33 AM, Christoph Feck wrote:
> > On Friday 29 July 2016 16:14:41 william.croc...@analog.com wrote:
> >>>> applies to items which are common to both.)
> >>> 
> >>> KF5 has a solution for that. I'm not an Model/View expert, but
> >>> i think this is what you're looking for:
> >>> 
> >>> https://api.kde.org/frameworks/kitemmodels/html/classKLinkItemS
> >>> el ectionModel.html
> >> 
> >> Thanks for the pointer. Alas...
> >> - I am industry and this is GPL.
> > 
> > KDE libraries and frameworks are LGPL.
> 
> The commentary at the top of the associated files,
> as linked above, says GPL.
> 
>  This library is free software; you can redistribute it and/or
> modify it under the terms of the GNU Library General Public
> License as published by the Free Software Foundation; either
> version 2 of the License, or (at your option) any later version.

Which part of "Library General Public License" is not LGPL?

> >> - I do not currently use any KDE and
> >> 
> >> I do not like adding dependencies.
> > 
> > Dependencies besides qtbase?
> 
> I use the Qt modules, but little more.

Remember that adding KItemModels, or other Tier 1 frameworks listed on 
https://api.kde.org/frameworks/index.html is equivalent to adding 
other Qt dependencies, e.g. QtSvg or QtXmlPatterns, because those only 
require qtbase.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Syncing tree views.

2016-07-29 Thread Christoph Feck
On Friday 29 July 2016 16:14:41 william.croc...@analog.com wrote:
> >> applies to items which are common to both.)
> > 
> > KF5 has a solution for that. I'm not an Model/View expert, but i
> > think this is what you're looking for:
> > 
> > https://api.kde.org/frameworks/kitemmodels/html/classKLinkItemSel
> > ectionModel.html
> 
> Thanks for the pointer. Alas...
> - I am industry and this is GPL.

KDE libraries and frameworks are LGPL.

> - I do not currently use any KDE and
>I do not like adding dependencies.

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


Re: [Interest] harfbuzz support?

2015-04-12 Thread Christoph Feck
On Sunday 12 April 2015 01:20:36 René J.V. Bertin wrote:
 Hi,
 
 Qt can be built with or without support for text rendering using
 harfbuzz.

Harfbuzz is responsible for layout (positioning) of glyphs, not 
rendering them to bitmaps.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Bounties?

2015-03-14 Thread Christoph Feck
On Saturday 14 March 2015 00:20:27 Bo Thorsen wrote:
 When you need to have a bug fixed, pay someone to do it.

I guess those willing to pay have a problem finding someone having 
time to work on it. Why not simply have a page in the Qt wiki with 
contact addresses of developers that offer pay-per-bug support, 
instead of pay-per-year support? KDAB was mentioned, but I guess 
there are many more.

-- 
Christoph Feck
https://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Question about using QtDBus

2014-08-28 Thread Christoph Feck
On Thursday 28 August 2014 19:17:54 Rogers Nate wrote:
 Confidentiality Notice: The preceding e-mail message (including any
 attachments) contains information that may be confidential,
 protected by applicable legal privileges, or constitute non-public
 information. It is intended to be conveyed only to the designated
 recipient(s). If you are not an intended recipient of this
 message, please notify the sender by replying to this message and
 then delete it from your system. Use, dissemination, distribution
 or reproduction of this message by unintended recipients is not
 authorized and may be unlawful.

I deleted this message from my system.

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QWidget + friends; How to restore properties across sessions?

2014-08-16 Thread Christoph Feck
On Friday 15 August 2014 21:48:08 Mark Gaiser wrote:
 Now i'm searching for alternatives to this approach to prevent
 handling the bookkeeping myself and still have the same result. For
 instance, would it be possible to have some function (in QObject or
 QWidget i guess) where you either:
 - Define which properties should be saved/restored across sessions,
 bookkeeping would be done internaly.
 - or just some QObject::persistentSettings(bool) function that -
 when true - saves any properties and restores them upon next
 request in a persistent manner.

Each QMetaObject has a userProperty() which identifies the value that 
the user can change in the object. To get a key for the settings file, 
you can use special objectName()s. For example, in Smaragd, I prefix 
any object that should have a persistent user property with cm_ (for 
config manager). See code at [1].

In Skulpture, there are two older versions of this file, one of them 
uses QSettings[2] instead of KConfigGroup[3]. Those additionally 
handle oddities with combo boxes, but they do not use userProperty().

[1]
https://projects.kde.org/projects/playground/artwork/smaragd/repository/revisions/master/entry/src/config/configmanager.h
[2]
http://quickgit.kde.org/?p=scratch%2Fcfeck%2Fskulpture.gita=blobh=43b6b8a73c34c54befe3a8289908e6a8d6344077hb=431fdd98819adc8ac1890c01312b81f08f68562ff=src%2Fconfig%2Fconfigmanager.h
[3]
http://quickgit.kde.org/?p=scratch%2Fcfeck%2Fskulpture.gita=blobh=c9816cacd6bec235e776e314c9ea5400d2fb44behb=431fdd98819adc8ac1890c01312b81f08f68562ff=kwin-client%2Fconfig%2Fconfigmanager.h

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] OpenGL drivers

2013-12-30 Thread Christoph Feck
On Friday 29 November 2013 13:30:10 Sletta Gunnar wrote:
 Long term, the solution for Qt might be that we bundle a software
 GL implementation (llvmpipe for instance) and switch to that if a
 driver is too problematic for us. Hopefully, we can get by with
 applying workarounds in Qt though.
 
 So, I'm asking that if you encounter issues with flickering,
 crashes, bad rendering and similar, help us track which things are
 problematic by filing a bugreport on bugreports.qt-project.org

Is there a simple way to stress test Qt's OpenGL support? I have Qt 
stable branch (5.2.0+) installed on my system, but do not have the 
time and expertise to code OpenGL apps, yet I want to help testing it.

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
openSUSE Review Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Font measuring inconsistency between platforms in Qt5? Or, how best to draw characters with QPainter.

2013-12-29 Thread Christoph Feck
On Sunday 29 December 2013 18:16:29 George Tasopoulos wrote:
 QFont font(Liberation Mono, 18, QFont::Normal, false);
 QFontMetrics metrics(font);
 int x = metrics.height();
 
 On Windows x equals 27, which seems to be the correct value, but on
 Linux it equals 28.

The (pixel) height of the font is determined by DPI of the display, so 
it is correct that on different systems you get different results for 
the font metrics. After all, that's the reason the QFontMetrics class 
is provided, so that you can adapt to the resulting metrics.

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
openSUSE Review Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Plastique style stylesheets

2013-12-23 Thread Christoph Feck
On Monday 23 December 2013 12:17:34 Etienne Sandré-Chardonnal wrote:
 Hi,
 
 I am trying to use the plastique style and change its colors to a
 dark theme.
 
 However, simply doing :
 
 QWidget
 {
 color: #b1b1b1;
 background-color: #323232;
 }
 
 Messes several things including scrollbars:
 
 [image: Images intégrées 1]
 
 
 As you can see, the double arrow in the bottom is removed, the
 round corners are lost, etc... So it seems that plastique is not
 fully stylable.
 
 Is there a workaround, or a more customizable style in Qt4? Or is
 it time to switch to Qt5 and fusion?

First, why not simply let the user decide about the color theme? Is 
hardcoding colors a new trend?

Second, style sheets _are_ a workaround. They are not meant to create 
a custom style. Subclass QStyle instead, if you want to do your own 
rendering.

And last, do not expect changes in Qt5 regarding style sheets.

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
openSUSE Review Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] 5.2 RC1 - release

2013-12-12 Thread Christoph Feck
On Thursday 12 December 2013 22:57:03 Mark Gaiser wrote:
 Where is the page with new C++ classes and new QML
 types/properties? doc.qt-project.org is pointing to
 http://qt-project.org/doc/qt-5/index.html for 5.2 which doesn't
 show a whats new page. Well, it does, but that is 5.0, not 5.2.

Reading that page, I will find a link to What's New in Qt 5.2.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QGraphicsItem and mouse events

2013-11-02 Thread Christoph Feck
On Saturday 02 November 2013 23:21:24 Igor Mironchik wrote:
 By default QGraphicsItem must be movable by mouse but he doesn't...

What does the Qt documentation state about the default value for 
QGraphicsItem::flags()?

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Default action for a QMenu added to a QToolBar

2013-08-20 Thread Christoph Feck
On Tuesday 20 August 2013 19:27:03 Etienne Sandré-Chardonnal wrote:
 Dear all,
 
 I inserted a QMenu to a QToolBar. This displays the menu icon,
 together with a drop-down arrow for opening the menu.
 
 Clicking the menu icon in the toolbar does nothing, as the menu
 action is connected to nothing.
 Is it possible to either:
  - Set the default child action that will be triggered when the
 main menu icon is clicked (setDefaultAction doesn't do the job)
  - Popup the menu when the main menu icon is clicked (as when
 clicking the dropdown arrow)
 
 Thanks,
 
 Etienne

http://qt-project.org/doc/qt-4.8/qtoolbutton.html#ToolButtonPopupMode-enum
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] ItemDelegate and word wrapping

2013-02-02 Thread Christoph Feck
On Friday 01 February 2013 12:59:43 Иван Комиссаров wrote:
 So, what should i do?) Should i hardcode style names that support
 drawing fancy background and emulate in other cases?

From looking at KDE code, we use 

style-drawPrimitive(QStyle::PE_PanelItemViewItem, opt, painter, 
opt.widget);

instead of

style-drawControl(QStyle::CE_ItemViewItem, opt, painter, 
widget);

to draw the item's background. See kdelibs/kdeui/paged/pageview_p.cpp 
line 419+.

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Problems porting to Qt5

2013-01-05 Thread Christoph Feck
On Friday 04 January 2013 21:42:59 Nikos Chantziaras wrote:
 I'm not using anything from KDE, actually.  The application
 compiles just fine with Qt5.  The whole point is that Qt5
 applications don't have a native look under KDE.

If you mean the Oxygen look, then yes, your application uses parts of 
KDE, because Oxygen is the KDE style, in other words, you are not 
using a native Qt style.

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] HierarchicalHeaderView for a QTableView

2012-11-15 Thread Christoph Feck
On Thursday 15 November 2012 08:00:49 Alex Strickland wrote:
 On the plus side, the little example finally lifted the veil from
 my eyes about how MVC should work - I deleted tons of code and had
 a better solution.

Just curious, because this can be misinterpreted. Did you delete all 
the MVC code, because it was too complicated, and you now have a 
better solution, or did you delete old code, because the MVC 
implementation is much simpler now?

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How can i manipulate pixel data from a QWidget?

2012-09-22 Thread Christoph Feck
On Saturday 22 September 2012 21:25:42 Mark wrote:
 I could really use some way to get the widget pixel data...

If you really want to _get_ the pixels of a widget, you need to grab 
it using QPixmap::grabWidget() and convert it to a QImage. Note that 
this is very much slower than keeping an QImage buffer and copying the 
result to the widget in paintEvent().

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QPointF constructor from QPoint

2012-09-19 Thread Christoph Feck
On Wednesday 19 September 2012 04:31:33 Shriramana Sharma wrote:
 Hello. I ran into this recently: Is there a reason that there is
 currently (4.8.1) no constructor for QPointF from QPoint? I can
 understand that QPointF should be explicitly converted to QPoint
 since it involves a loss of precision but just as integers are
 accepted everywhere that doubles are, it would be most useful
 (code less create more) if QPoint is accepted everywhere that
 QPointF is.
 
 Sent from my Android phone

The conversion constructor isn't explicit, because on some systems, 
qreal != double, so conversion from int to qreal actually does involve 
loss of precision.

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QLabel with images

2012-09-11 Thread Christoph Feck
On Tuesday 11 September 2012 16:18:54 Konrad Rosenbaum wrote:
 Create a pixmap and paint the icon and the text over it. Once
 you've done that for the first time it becomes very easy.

There is one issue with rendering text to a pixmap, instead of 
painting it directly to the widget: You lose subpixel anti-aliasing.

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QLed

2012-08-05 Thread Christoph Feck
On Sunday 05 August 2012 11:40:41 Phil wrote:
 Thank you for reading this.
 
 I'd like to add an LED widget to my application using Qt Designer.
 A quick search turned up a Designer plug-in called QLedindicator
 but I haven't been able to make much sense of it.
 
 Is there a QT library that contains an LED widget that I can add to
 Designer?

Screenshot: https://svn.reviewboard.kde.org/r/5369/s/508/
License: LGPLv2+
Code: 
http://quickgit.kde.org/index.php?p=kdelibs.gita=treehb=frameworksf=tier1/kwidgetsaddons/src

Cannot comment on Designer integration; all KDE widgets are integrated 
there, but I never cared to look how it is done, maybe ask on KDE 
development mailing lists.

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QTabBar drawBase property- what does it do?

2012-07-24 Thread Christoph Feck
On Tuesday 24 July 2012 21:34:14 John Weeks wrote:
 I am in the process of porting code that draws images of controls.
 Due to history and architecture, I'm not using QWidgets as the
 basis for these controls, they are drawn using OS primitives. Now
 I am drawing them with QStyle.
 
 There are references amonst the Tab Bar stuff to a base. The
 QTabBar widget has a property drawBase so I created a test case:
 a dialog layout with two QTabBars one with drawBase set and the
 other without. I've looked at Windows, Plastique, CleanLooks,
 Macintosh and Motif styles and can't see any difference. So...
 
 What does drawBase do? What are all those references (especially
 for QStyle::pixelMetric) to things related to TabBarBase?
 
 -John Weeks

A QTabWidget usually has a frame around its contents (let's forget 
about documentMode right now). The tab bar at the top breaks this 
frame for the active tab, in other words, the QTabBar has to render 
above the frame drawn by QTabWidget. The amount of pixels the two 
widgets share the frame is called the overlap.

The base is historically the line drawn for a QTabBar, that is 
actually a visual part of the QTabWidget. Depending on the style, the 
base might include other graphics at the background. For example, 
using the Skulpture style, the base graphics is a recessed looking 
background. See http://kdepepo.files.wordpress.com/2009/05/kde4-style-
skulpture.png?w=480

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] The Proper Way to Mix/Cross-Fade Images

2012-03-20 Thread Christoph Feck
On Tuesday 20 March 2012 14:17:49 Josiah Bryan wrote:
 I may be crazy, or just aiming for something unrealistic. But here
 goes:
 
 - I want to cross-fade two images over a background. (Simple,
 right?)
 
 Well, not really. Forgot the Cross-fading part - lets just take
 one point in time, a 50/50 opacity (e.g. the two images we're
 cross fading each is at 50% opacity.) What would that look like if
 you just did this straight-forward? (Paint background, paint 1st
 image at .5 opac, paint 2nd image at .5 opac)
 
 Well, it would look like this:
 http://www.jdbryanphotography.com/fullres/fadetest-bg-renderout.png
 (200px by 200px PNG image)
 (For those who don't want to click - the blue background with the
 word (bg) on it is visible through the partial-opacity B
 behind the partial-opacity A)
 
 This would be coded like:
 double opac = .5;
 p.setOpacity(1.0-opac);
 p.drawImage(0,0,image1);
 p.setOpacity(opac);
 p.drawImage(0,0,image2);
  // render this image now over the background and you get the above
 link's image
 
 But I don't think the background should show thru - if each image
 is exactly 50% opac, in my (simple) mind, that should add up to
 100% opacity - This is what I want to see:
 http://www.jdbryanphotography.com/fullres/output-goal.png (200px by
 200px PNG image)
 (No clicky? Solid red background with partial-opacity A over
 partial opacity B)
 
 However, the best so far that I can come up with (without
 cheating) is this:
 http://www.jdbryanphotography.com/fullres/output-bestsofar.png
 (200px by 200px PNG image)
 (No clicky? 75% red bg with same partial-opacity letters.)
 
 Here's the source of the example (self-contained, 116 lines of
 cpp): http://www.jdbryanphotography.com/fullres/main.cpp
 Using the following images as source:
 http://www.jdbryanphotography.com/fullres/fadetest-A.png
 http://www.jdbryanphotography.com/fullres/fadetest-B.png
 http://www.jdbryanphotography.com/fullres/fadetest-bg.png
 
 (Basically, I render the image as above, then I create another
 image to use as the alpha channel, extract the alpha channels of
 the first two images (image1 and image2), then render them the
 same way (1.0-opac, draw, opac, draw), then I set the alpha
 channel image as the alpha channel on the first rendered image)
 
 
 ** The main problem I can't figure out **
 My main.cpp example linked here would work perfectly for my
 problem, EXCEPT that even when mixing the alpha chan properly, the
 resultant image is 25% darker than it should be - e.g. the solid
 red areas in -bestsofar.png are 189 red instead of 255 red.
 Shouldn't 50% of red from fadetest-A.png at pixel X,Y mixed with
 50% red from fadetest-B.png at the same pixel X,Y be 100% red in
 the output image?
 
 (Well, I can force it to render how I want - just render the
 first image with 100% opacity - see the comment about Want to
 cheat? in the main.cpp. But if I cheat, that wouldn't work for
 images that have different areas with different opacities - say
 trying to crossfade between two words (100% opacity) rendered on a
 30% black background.)
 
 ** The other (side) problem **
 This method is dog-slow - 4ms for me just to render and set the
 alpha channel (not to mention the 4ms to render the initial mixed
 image.) And thats with a 200x200 image - I'm talking about doing
 this with 1024x768px-sized images - which would (if I extrapolate
 correctly) be about 20-50ms a frame - ouch.
 
 So it all boils down to this:
 Is there any way to force QPainter (or, heck, just do it on a raw
 OpenGL surface and skip QPainter/QImage all together) to blend
 things where 50% opacity + 50% opacity = 100% opacity in the
 resultant image?
 
 Or, as some might say, am I just waa off base here? Perhaps the
 mere mention of this idea is causing Porter and/or Duff to want to
 smack me with a stick...I don't know. Any thoughts?
 
 Anyway, thanks for your thoughts and feedback. Cheers!
 -Josiah

Here
https://projects.kde.org/projects/playground/artwork/smaragd/repository/revisions/c71af7bc12611e462426e75c3d5793a87b67f57e/diff
is the code change I did in Smaragd when I faced the same problem.

From what you can see in the deleted code, I tried to render one image 
with 1 - a and the other image with a opacity, but that did not 
work as you noticed. The added helper function solved the issue, but 
it does not handle images of different sizes.

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [ Missing pixels when using drawLine ]

2012-03-13 Thread Christoph Feck
On Tuesday 13 March 2012 08:28:04 ashish raste wrote:
 *Dear all,
 
 Recently I worked on a paint application, where I implemented a
 function to draw whatever a user is scribbling on an image. In the
 mouseMove event, I called a function to draw with the previous
 point and the current point as its arguments, using the drawLine
 function of QPainter.
 
 Now, I noticed that the pixels sent to this function are not
 continuous but some in-between pixels were being left. I assume
 that this is due to the delay for a user-kernel and kernel-user
 mode switch when calling the underlying paint-engine's functions
 to draw the line.

If this only appears since Qt 4.8 with raster engine, this could be
https://bugreports.qt-project.org/browse/QTBUG-23430

As a workaround, use drawPixel() for single-pixel lines.

 I have looked-up in the documentation of Qt-painting to find how it
 internally calls drawLines(), which instead creates a qpainterPath
 to draw a curve, line or whatever we scribble. But I couldn't find
 how the missing pixels were added in between just knowing the
 start and end point of a line (though we know that a curve will
 contain a large set of small lines, each having a start and end
 point)
 
 Is there anyway to track these missed pixels i.e to track all the
 pixels which are being drawn?
 
 Thanks you!*

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QTextEdit and Style sheets

2012-03-13 Thread Christoph Feck
On Tuesday 13 March 2012 16:52:21 André Somers wrote:
 Op 13-3-2012 16:45, Graham Labdon schreef:
  Hi everyone
  
  Solved this!
  
  edit-setStyleSheet(background-image:url(:/images/bg.jpg));
  
  QPalettepalette=edit-palette();
  
  palette.setBrush(QPalette::Base,Qt::NoBrush);
  
  edit-setPalette(palette);
 
 Please report this as a bug. I think that setting a background
 image should already set the brush to NoBrush, or the rendering
 should be done the other way around. Either way, that would
 qualify as a Qt bug IMO.
 
 André

You have to change the background of the viewport() instead, otherwise 
the viewport will render its background over that of the QTextEdit 
object. So it is not a bug, but expected behavior. Using setPalette() 
also affects the viewport, because the palette attribute is inherited 
by children.

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest