[Interest] QSyntaxHighlighter change QTextBlockFormat

2022-01-04 Thread Joshua Grauman
Hi all, I have been researching how to have a QSyntaxHighlighter change QTextBlockFormat. I need my syntax highlighter to change the indent, left and right margins, line height, etc. of a QTextDocument/QTextEdit. I was able to have my class derived from QSyntaxHighlighter change the

[Interest] QTextLayout::setPreeditArea()

2022-01-03 Thread Joshua Grauman
Hi all, I am working on using QTextLayout and I was wondering if someone could give me a quick explanation for what preedit text / preedit area was in this context? There's not much detail in the docs, reading the Qt code and googling hasn't helped me much. When/why would you use

[Interest] qSort replacement

2021-07-21 Thread Joshua Grauman
Hi all, I see that qSort is deprecated in newer versions of Qt. I can also see that std::sort is intended to replace it. But I can't figure out how to use std::sort to sort a QList with a custom compare function. With qSort you could supply your own comparison function to sort however you

Re: [Interest] QTimer and Qt::PreciseTimer

2017-07-29 Thread Joshua Grauman
Great. Helpful as always. Thanks! Josh On Saturday, 29 July 2017 13:02:20 PDT Joshua Grauman wrote: Do you know offhand about how accurate typical PC system clocks are? I'm wondering about how much drift there would be after an hour of recording screencasts. See the ntp drift file after

Re: [Interest] QTimer and Qt::PreciseTimer

2017-07-29 Thread Joshua Grauman
by correct for drift over time. But it sounds like switching to QElapsedTimer is better. Do you know offhand about how accurate typical PC system clocks are? I'm wondering about how much drift there would be after an hour of recording screencasts. Josh On Friday, 28 July 2017 16:15:27 PDT Josh

Re: [Interest] QTimer and Qt::PreciseTimer

2017-07-29 Thread Joshua Grauman
. But it sounds like switching to QElapsedTimer is better. Do you know offhand about how accurate typical PC system clocks are? I'm wondering about how much drift there would be after an hour of recording screencasts. Josh On Friday, 28 July 2017 16:15:27 PDT Joshua Grauman wrote: I have

Re: [Interest] QTimer and Qt::PreciseTimer

2017-07-28 Thread Joshua Grauman
29 PDT Joshua Grauman wrote: Thanks so much for the response. So do I have this right then? QTimer doesn't use any actually timers in the OS (no system calls/interrupts). It is all handled internally by Qt's event loop. So if the OS doesn't give Qt CPU time, it will miss a timer. Calling 'nice'

Re: [Interest] QTimer and Qt::PreciseTimer

2017-07-26 Thread Joshua Grauman
may help with this. Josh On quarta-feira, 26 de julho de 2017 12:58:43 PDT Joshua Grauman wrote: Hello all, I have a QTimer in my application that runs every 40ms. It doesn't run continuously, but I recall the start function every time my timer function is done so that the timer doesn't drift

[Interest] QTimer and Qt::PreciseTimer

2017-07-26 Thread Joshua Grauman
Hello all, I have a QTimer in my application that runs every 40ms. It doesn't run continuously, but I recall the start function every time my timer function is done so that the timer doesn't drift over time. My question though is about timeout overrun. If the system is busy, and so the timer

[Interest] Black background with QPrinter

2017-03-16 Thread Joshua Grauman
Hi all, I am trying to print a QTextDocument to PDF using QPrinter like the following. It works great. But now I'm trying to print to a PDF with a black background and I can't figure out how. If I do painter.fillRect() it doesn't cover the margins (margins are white). I've tried changing the

[Interest] Recommended way to draw formatted text with QPainter

2016-12-17 Thread Joshua Grauman
Hello all, I have a bunch of small fragments of formatted text (small paragraphs with multiple colors and fonts, using tags). I need to paint them with QPainter at different locations (multiple rectangles of text) onto my widget. I've seen recommendations to put them in a QLabel and then

Re: [Interest] allocate QImage data in QSharedMemory

2016-12-12 Thread Joshua Grauman
Brilliant! How did I miss that constructor?! Josh Hi,Why not construct the image object from the shared memory buffer to begin with? Then lock the sm while drawing. Look for example this constructor: http://doc.qt.io/qt-5/qimage.html#QImage-3 On Mon, Dec 12, 2016 at 11:45 PM, Joshua Grauman

[Interest] allocate QImage data in QSharedMemory

2016-12-12 Thread Joshua Grauman
Hello all, I have been able to generate a screen capture of my program by rendering a window into a QImage at 30fps (called from QTimer), and then copying the QImage to shared memory (QSharedMemory) where another program grabs the frames and outputs them to ffmpeg. It all works great.

Re: [Interest] QMenu size

2016-11-15 Thread Joshua Grauman
so much!!! Josh On Tue, 15 Nov 2016, Bo Thorsen wrote: Den 08-11-2016 kl. 23:05 skrev Joshua Grauman: Hello all, I am wondering if there is a way to customize the size of a QMenu used as a context menu. I have it so that when I right click, a popup menu comes up. But I would like it so

[Interest] Moc file won't compile on Android

2016-11-11 Thread Joshua Grauman
Hello all, I am working on compiling a test program for Android. It uses qttoolbardialog from Qt5.6.2-Android/5.6/Src/qttools/src/shared/qttoolbardialog. The files are included in the .pro file like: SOURCES += qttoolbardialog.cpp HEADERS += qttoolbardialog.h FORMS += qttoolbardialog.ui

[Interest] QMenu size

2016-11-08 Thread Joshua Grauman
Hello all, I am wondering if there is a way to customize the size of a QMenu used as a context menu. I have it so that when I right click, a popup menu comes up. But I would like it so the QMenu doesn't ever go outside of the window it is clicked in. Right now, if you click near the bottom,

[Interest] rendering QTreeView bug

2016-10-31 Thread Joshua Grauman
Hello all, I have a QTreeView with a custom TreeModel. It works really well and I haven't had any problems with it after exhaustive testing. The QTreeView is in a widget inside a layout. It all looks great and works perfectly on screen. However, when I try to render the widget to a QImage to

Re: [Interest] Qt mouse poll rate too slow

2016-09-23 Thread Joshua Grauman
Thanks, this is the issue. At least I'm not the only one! Josh Hi,I think mouse events are subject to compression, so you might be getting only part of the real number of "mouse moves" if Qt decides it can't keep up with the speed.For example this bugreport[1] looks relevant. [1]: 

[Interest] Qt mouse poll rate too slow

2016-09-23 Thread Joshua Grauman
Hello all, I'm running into a problem where the mouse (and touchscreen) poll rate is too slow for my application. At first I thought it was the device (mouse and/or touchscreen), but after trying in different apps, I discovered it is Qt. I am simply subclassing a QLabel and adding points to a

Re: [Interest] Qt5.6.1 16-bit color on Raspberry Pi 3

2016-09-13 Thread Joshua Grauman
Nevermind, apparently it was just the default theme that is dithered. Explicitly setting the theme to fusion fixed it. Josh Hello, I have been working for hours trying to figure out how to get 24 or 32-bit color on my Raspberry Pi 3. Currently, Qt is running at 16-bit color and everything

[Interest] Qt5.6.1 16-bit color on Raspberry Pi 3

2016-09-13 Thread Joshua Grauman
Hello, I have been working for hours trying to figure out how to get 24 or 32-bit color on my Raspberry Pi 3. Currently, Qt is running at 16-bit color and everything is dithered and looks terrible. As far as I can tell, X and the framebuffer are both running at 24 bit and I think it is only

[Interest] QSharedMemory example has excessive copies?

2016-09-02 Thread Joshua Grauman
Hello, I'm looking to use QSharedMemory to grab an image from a widget into shared memory (using QWidget::grab() or QWidget::render()), so another process/program can process the images. So I'm looking at the QSharedMemory example here:

[Interest] Mac OS defines

2014-03-01 Thread Joshua Grauman
I've tried to google and find the proper defines to use for different Mac related operating systems. Does anyone know offhand which defines to use for which OSes (moving forward for Qt 5.2+)? Is this correct? Q_OS_MAC - Mac OSX and iOS Q_OS_MACX - Mac OSX Q_OS_OSX - Mac OSX (any difference

[Interest] Widen down-arrow of QComboBox

2013-12-29 Thread Joshua Grauman
Hello all, I'm trying to get the down arrow of a QComboBox to be wider than the default. I've tried lots of different ideas and none are working as expected. I'm using the Fusion style and Qt5.2. If possible, I'd like to keep having the style draw everything and not have to redo all the

[Interest] Enabling Harfbuzz on Mac for Qt5

2013-11-21 Thread Joshua Grauman
Hello, Does anyone know if anything changed with respect to enabling Harfbuzz on Qt/Mac with Qt version 5? With the precompiled releases what is the default setting? Do I need to set the environment variable QT_ENABLE_HARFBUZZ? Is there a (programatic) way to check and verify if it has been

[Interest] Best practice for sorting multiple (connected) QLists

2013-11-19 Thread Joshua Grauman
I fairly often find myself wanting to sort a bit of data. Imagine I have a few QListint's a QStringList's and that they correspond like a database table so that I always append to all the lists together with data for one row. Something like: QListint age, height; QStringList firstname,

[Interest] macdeployqt for Qt5.2beta issues on OSX Lion

2013-11-13 Thread Joshua Grauman
I just finished getting my app ready to run with Qt5.2beta and OSX Lion and everything is running fine. However, after I run macdeployqt, I can't run the app by double clicking on it, it just immediately crashes. When I run it from the terminal it is fine. I ran otool -L on the binary and

Re: [Interest] QPrinter Support on Android

2013-11-12 Thread Joshua Grauman
... Thanks! Josh On 11 November 2013 08:07, Thiago Macieira thiago.macie...@intel.com wrote: On domingo, 10 de novembro de 2013 21:34:08, Joshua Grauman wrote: Hello all, I just tried Qt5.2 for Android and unless I'm missing something I can't use QPrinter. Now I understand the reason

[Interest] QPrinter Support on Android

2013-11-10 Thread Joshua Grauman
Hello all, I just tried Qt5.2 for Android and unless I'm missing something I can't use QPrinter. Now I understand the reason for this, obviously there is no printer backend on Android. However, when I used Qt 4.x for Android using Bogdan's version, I was still able to use QPrinter and friends,

Re: [Interest] QCamera and QCameraViewFinder

2013-11-08 Thread Joshua Grauman
://qt.digia.com On Nov 5, 2013, at 7:09 PM, Joshua Grauman wrote: Sorry, I'm using Qt5.2beta under Linux. Josh Which platform are you on? Yoann Lopes Senior Software Engineer - Digia, Qt Visit us on: http://qt.digia.com On Nov 5, 2013, at 7:14 AM, Joshua Grauman wrote: Hello all, I setup a basic

Re: [Interest] QCamera and QCameraViewFinder

2013-11-05 Thread Joshua Grauman
Sorry, I'm using Qt5.2beta under Linux. Josh Which platform are you on? Yoann Lopes Senior Software Engineer - Digia, Qt Visit us on: http://qt.digia.com On Nov 5, 2013, at 7:14 AM, Joshua Grauman wrote: Hello all, I setup a basic use of QCamera and QCameraViewFinder that work fine. I

[Interest] QCamera and QCameraViewFinder

2013-11-04 Thread Joshua Grauman
Hello all, I setup a basic use of QCamera and QCameraViewFinder that work fine. I just used the basic example in the docs to capture an image like this: camera-searchAndLock(); //on half pressed shutter button imageCapture-capture(); //on shutter button pressed camera-unlock();

Re: [Interest] C++11 support on Qt5 platforms

2013-10-29 Thread Joshua Grauman
GNU Compiler Collection (GCC) 4.8 compiler to the NDK. Since GCC 4.6 is still the default, you must explicitly enable this option. On Mon, 28 Oct 2013, Thiago Macieira wrote: On segunda-feira, 28 de outubro de 2013 14:44:02, Joshua Grauman wrote: Hello, I am wondering if there are any

[Interest] C++11 support on Qt5 platforms

2013-10-28 Thread Joshua Grauman
Hello, I am wondering if there are any potential issues with using C++11 (I want to use lamba functions for connecting to signals) on all the major Qt5 platforms --without recompiling the source--. I know the default Linux/Mac/WindowsMSVC compilers should be fine, but I'm more wondering about

[Interest] Getting QTextDocument page break positions

2013-06-03 Thread Joshua Grauman
Hello all, I have a QTextEdit/QTextDocument that I want to print. I call document()-setPageSize(QSizeF(pageWidth,pageHeight)); to set the page size and can print it fine. I have some custom drawing I need to do though and so I need to have a reliable way to see where QTextDocument did the

[Interest] Qt5.1 for iOS

2013-04-09 Thread Joshua Grauman
Hello all, I'm interested in diving into using Qt5.1 on iOS. Before I do though (I'm not a Mac or iOS user) I have two quick newbie questions for iOS: 1) I keep hearing that iOS is locked down or a walled garden. If I buy an iPad or whatever, is it pretty easy for me to compile/build my app

Re: [Interest] QTBUG-150... Change word separators for QTextCursor (QPlainTextEditor)

2013-03-14 Thread Joshua Grauman
Scott, I'm not certain that all these functions exist in QPlainTextEdit, but I'll tell you how I did it in QTextEdit by subclassing QTextEdit and reimplementing QTextEdit::mouseDoubleClickEvent(QMouseEvent *e). I get the position of the mouse click via e-pos(), and then get a QTextCursor using

Re: [Interest] mouse gestures

2013-03-09 Thread Joshua Grauman
I'm not sure if this is relevant, but the tap and hold gesture works with the mouse for me on multiple platforms, but I haven't tried other gestures. Josh Hello, guys. I just did a fresh pull from GIt, ran the example, and got nothing. Also, when I attempted the doubleclick event

Re: [Interest] Persistent Editor keep focus when opening new window

2013-02-24 Thread Joshua Grauman
Great idea. Thanks so much for the help. Josh On 02/23/2013 07:43 PM, Joshua Grauman wrote: Bill, Thanks so much, that looked like it should do the trick. But onfortunately, when my new window pops up (even with those flags, I tried both Qt::Dialog and Qt::Popup), the delegate still looses

Re: [Interest] Persistent Editor keep focus when opening new window

2013-02-23 Thread Joshua Grauman
. Josh On 02/23/2013 04:40 PM, Joshua Grauman wrote: Hello all, I have a QTableWidget that uses a custom delegate. When I double click on a cell, the editor comes up fine. But then I want to be able to pull up a helper widget/window to enter data into the persistent editor. The problem

Re: [Interest] Globally Converting QTapAndHoldGesture to Mouse Double Click

2013-02-22 Thread Joshua Grauman
That is a good thought, but I don't think that is the problem. I have a double click event handler on one of my widgets, and it's not even getting called. I would think that sending a double click event would cause the double click event handler to be called, so that's why I think that somehow

[Interest] Globally Converting QTapAndHoldGesture to Mouse Double Click

2013-02-21 Thread Joshua Grauman
Hello all, I'm trying to write a global proceedure to convert all QTapAndHoldGesture events to mouse double click events. I thought this should be trivial, but it's really stumping me. I setup an event filter globally for my QApplication and grab the gesture as follow:

Re: [Interest] QToolBar in Qt5 under Mac

2013-02-13 Thread Joshua Grauman
Thanks! Any idea if there are plans to add QToolBar back in for Mac? Josh On Feb 12, 2013, at 9:08 PM, Joshua Grauman jnf...@grauman.com wrote: Qt could not resolve function qimagetocgimage from QGuiApplication::platformNativeInterface()-nativeResourceFunctionForIntegration() Segmentation

Re: [Interest] Porting to Qt5/macx-xcode Mountain Lion

2013-01-24 Thread Joshua Grauman
Hi, On Thu, Jan 24, 2013 at 7:08 AM, Joshua Grauman jnf...@grauman.com wrote: First a disclaimer, I know very little about Mac OS specifics. I only have a Mac to build my app for it. I am porting two apps to Mac OS Mountain Lion and Qt5. The apps have run fine on quite a few of the Qt4

Re: [Interest] Porting to Qt5/macx-xcode Mountain Lion

2013-01-24 Thread Joshua Grauman
I'm not sure I did this correctly, but it did give some more information. Now I can see that it is segfaulting on QTextCodec::toUnicode(), which incidentally, also segfaults in another program I have. So I think I can trace most (all?) my segfaults to this function. Thanks for any more help!

Re: [Interest] Porting to Qt5/macx-xcode Mountain Lion

2013-01-24 Thread Joshua Grauman
Ok, I think I've found the root problem. QTextCodec::codecByName(UTF-8) is returning 0. It's a static function, so I'm lost as to why this would be. I didn't compile my own Qt, just downloaded the main Qt5.0.0-clang SDK from the qt-project website and installed. This is what is causing the

Re: [Interest] Porting to Qt5/macx-xcode Mountain Lion

2013-01-24 Thread Joshua Grauman
Sorry for all the emails, but I finally tracked it down. QTextCodec::codecForName(UTF-8) is returning 0 because I call it before QApplication is initialized. I'm not sure if this is expected behavior or not. In any case, on the other platforms it's not a problem. But where there is definitely

Re: [Interest] Qt Installer Framework

2013-01-24 Thread Joshua Grauman
Hi, I just found out about the Qt Installer Framework and so downloaded and compiled it. On linking, I see it is trying to link to QFSFileEngine, which isn't in Qt5. Is a Qt5 version of qif planned? Does anyone have it working in Qt5? Thanks! Josh 24.01.2013, × 19:36, Karsten Heimrich

Re: [Interest] Porting to Qt5/macx-xcode Mountain Lion

2013-01-24 Thread Joshua Grauman
On quinta-feira, 24 de janeiro de 2013 14.51.24, Joshua Grauman wrote: Sorry for all the emails, but I finally tracked it down. QTextCodec::codecForName(UTF-8) is returning 0 because I call it before QApplication is initialized. I'm not sure if this is expected behavior or not. In any case

Re: [Interest] Porting to Qt5/macx-xcode Mountain Lion

2013-01-24 Thread Joshua Grauman
, 24 de janeiro de 2013 16.20.37, Joshua Grauman wrote: I'm not sure I completely understand your question, but I'll give it a shot. I had a global variable as follows (bad style, I know). It seems pointless I know, but it's because I also have other custom implementations of QTextCodec that get

[Interest] Porting to Qt5/macx-xcode Mountain Lion

2013-01-23 Thread Joshua Grauman
Hello all, First a disclaimer, I know very little about Mac OS specifics. I only have a Mac to build my app for it. I am porting two apps to Mac OS Mountain Lion and Qt5. The apps have run fine on quite a few of the Qt4 series versions in Windows/Linux/Mac (Snow Leopard). They both run fine

Re: [Interest] Notes on porting exercise to Qt 5

2013-01-23 Thread Joshua Grauman
I'll add one more odd note about porting to Qt 5. I found that Qt::UniteClip is no longer an option in Qt5 as used in: painter.setClipRect(rect, Qt::UniteClip); I find this is a weird option to get rid of as Qt::IntersectClip is still there. Why one and not the other... Josh On sexta-feira,

[Interest] Enabling Harfbuzz on Mac

2012-02-22 Thread Joshua Grauman
Hello all, According to this page, it is now possible to enable Harfbuzz on Mac by setting an environment variable: https://bugreports.qt-project.org/browse/QTBUG-17728 However, unless I'm missing something I haven't been able to enable Harfbuzz on Mac. I'm using Qt 4.8, which according to the