> If, however, I move that same widget onto a QGraphicsScene via
> fooWidget* foo = new fooWidget();
> foo->setFooData(data);
> QGraphicsProxyWidget* proxy = scene->addWidget(foo) The fooWidget is
> properly added to the scene, all of its child widgets' text values are
> correctly
>
I'm attempting to add a custom widget to a QGraphicsScene and I'm having
some trouble with the palette settings.
1. I've got a custom widget class, say "fooWidget" which is a composite widget
made up of a bunch of different child widgets (QLabels, QRadioButtons,
etc.).
2. It has a
> On Tuesday, 1 February 2022 11:12:29 PST Murphy, Sean wrote:
> > So if I understand you correctly, instantiating 60,000 of them when
> > you really only need one would be considered Not Advised?!?!
>
> Correct.
>
> I find it hard to believe you have a valid use-ca
> On Tuesday, 1 February 2022 08:30:52 PST Murphy, Sean wrote:
> > I just made that switch - removed the QRandomGenerator member
> variable
> > From the tile class, and calling
> > QRandomGenerator::global()->bounded(min,
> > max). Now creating + assigning ea
> Depending on your QFuture setup, you could monitor each tile, and when it
> completes, update the min max...
I think from the testing I did yesterday, and this comment from
https://doc.qt.io/qt-5/qfuturewatcher.html prevents you from knowing WHICH
result is ready if your map function returns
> that definitely does.
>
> Of course I wonder if you had removed that, but left in the QObject etc
> etc, what would it have been. Likely, not much worse than 15ms.
Yep, once I removed the random generator object, I had the same thought:
"could I go back to QObject?!?!", but as you
> Subject: RE: [Interest] [External]Re: How to get QtConcurrent to do what I
> want?
>
> Something seems off.
>
> But without looking at the actual code that is allocation 60k tiles and the
> constructor itself, it just seems like a very expensive construction if the
> "new" + "moving a pointer"
> Not knowing if a partial value makes any sense to your system.
> Qt::Concurrent::mappedReduced might make more sense, if its purely a
> speedup you are looking for, and not a "keep the GUI alive during it" possibly
> blockingMappedReduced.
I don't think mappedReduced would help me until after
> > What's the significance of the tiles? As far as I can tell from your
> requirements, you don't care about
> > the "true geometry" of the data.
>
> Either I'm understanding what you mean by "true geometry", or this
Oops! This was supposed to say "Either I'm NOT understanding..."
> On Mon, Jan 31, 2022 at 7:15 PM Murphy, Sean
> <mailto:sean.mur...@centauricorp.com> wrote:
> > 1. Creating 60,000 QObjects in a single thread appears to be slow
> [...]
>
> Ehm, maybe I'm not understanding something, but why do you need objects to
> be
Thanks for the reply, Scott. My responses below:
> Couple things I would try.
>
> First, preallocate the size of the vector, or use a list if you don't need
> random access into it.
I had attempted this before my original post. My sequence of attempts before I
posted went
like this:
1.
ject: Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?
That's looks OK. Why does the tile object creation take so long? Is all of
the image handling in tile::process, or does tile constructor extract from the
original?
Regards, Tony
On 31/01/2022 11:59 am, Murphy, Se
extracts the bits, processes and notifies the result with its position.
Regards, Tony
On 31/01/2022 10:06 am, Murphy, Sean wrote:
I'm hitting a design issue with the way I'm using the QtConcurrent module to do
some image processing, and I'm wondering if someone can give some pointers?
At a high
I'm hitting a design issue with the way I'm using the QtConcurrent module to do
some image processing, and I'm wondering if someone can give some pointers?
At a high level, the software needs to do some processing on every pixel of an
image. The processing can mostly be done in parallel, so
cognize the sender and know the content
is safe.
You emit dataChanged with the given role (which is Qt::EditRole), but not for
Qt::DisplayRole. Is it that?
Regards,
Björn.
Am 20.09.2021 um 19:15 schrieb Murphy, Sean:
I'm having an issue where my proxy model and its associated view aren't
> to both rowCount() and columnCount() removed those errors and now my
> application runs silently.
I should have explained better. It runs silently in the sense that
the QAbstractItemModelTester instances aren't printing out
any information any more.
The broken behavior still exists where the
> > have you run QAbstractItemModelTester
> > https://doc.qt.io/qt-6/qabstractitemmodeltester.html on the source
> > model and the proxy model?
Ok, I think I'm now using the tester, but I'm not sure I'm using it correctly.
After I've populated my base model, assigned it as the source model to
> have you run QAbstractItemModelTester
> https://doc.qt.io/qt-6/qabstractitemmodeltester.html on the source model and
> the proxy model?
I had not, mostly because I didn't know it existed! Time to learn a new class
today.
I'll report back if I find something that fixes my issue.
Thanks,
Sean
> I'm having an issue where my proxy model and its associated view aren't
> updating live when changes are made in the source model.
>
> My proxy model simply is attempting to invert the rows of the source model. So
> it inherits from a QSortFilterProxyModel and implements mapFromSource() and
>
I'm having an issue where my proxy model and its associated view aren't
updating live when changes
are made in the source model.
My proxy model simply is attempting to invert the rows of the source model. So
it inherits from a
QSortFilterProxyModel and implements mapFromSource() and
We've got an application we're working on where we'd like to replace a
QListWidget that uses
cell widgets, with a view/model/delegate and we're running into a snag. Here's
what we have:
We have a "layerData" class with three member variables:
- bool visible
- QString name
- double opacity
We
I've been on this list (and it's predecessor) for a couple of decades, and have
noticed that the traffic on it seems to have slowed significantly over the past
few months. Is there somewhere else people are going, like
https://forum.qt.io/, or have people just stopped discussing Qt for some
> I want to center vertically image and text. But when I'm trying to, it does
> not
> look centered, because of an empty space at the top of the text.
> What I mean is illustrated by this image:
>
> The blue rectangle looks a bit above the text. However, these two controls are
> centered
I don't seem to be having much luck with the online installer for the open
source Mac binaries. I downloaded the Mac online installer today
(qt-unified-macOS-x86_64-4.0.1-online), I had no trouble doing that.
Then when running it, I put in my account info, and am able to log in. I get
past the
> > I'm trying to get selections on one view to be replicated to the
> > other[...]> So how do I connect things up so that selections on view1
> > are propagate through the proxy model, and then the respective indices
> > are selected in view2, and vice versa?
>
> Use
What's the best way to share selections between views when you're dealing with
different levels of models and proxy models between the separate views?
I've got the following setup:
- myData: a data only class that holds the underlying values to be displayed
- dataModel: a model that operates
I'm not on a Mac right now, so I can't try this, so I don’t know if this will
work:
As each window (I assume these are QMainWindow, or at least inherit from
one) is closed, are you deleting them? If so, when you get to the last one,
could
you hide it instead of deleting it? Or when you've
Is there a way to temporarily pause a QTableView while the underlying model
continues to update?
My scenario:
- I have two separate QTableViews connected to a single model.
- The model is being fed from a continuously updating data source, i.e. a
sensor.
- One of the views needs to remain
> Why not just replace ‘&’ with ‘&&’ in the string the user inputs, before
> setting it as the name on the tab?
That might work, the only wrinkle I see is that when the user goes to edit a
tab name, we start out the editor with the "current" text so I'd have to
substitute back the other way
In our application, we have a QTabWidget. We allow the users to rename the
tabs. One of our users discovered that if they put an '&' in the string, it
isn't displayed, and if they put two together in sequence ("&&"), a single '&'
is displayed on the tab widget.
I completely understand what's
> As with any similar widget platform-specific behavior, specifically by the
> SH_SpinBox_ClickAutoRepeatThreshold style hint. Use
> spinbox->style()->styleHint to fetch the value; use a custom style or a
> proxy style to change it.
Thanks for teaching me something new! I had no idea things like
When using a QSpinBox, if the user clicks and holds on one of the up/down
buttons (or uses one of the keyboard keys that do the same thing), there is a
bit of a delay before the autorepeat functionality starts.
Is there a spot to query what that delay is and/or change it? From trial and
error
I've got a QTableView that I'm putting a custom widget/editor in one column
to allow editing of data, that I've got a couple of questions about. First, the
custom widget is simply 3 QRadioButtons in a horizontal layout:
threeRadioButtonWidget
-- QHBoxLayout
QRadioButton
QRadioButton
> I suggest QTemporaryDir instead.
Thanks Thiago,
So just create the QTemporaryDir, then feed that path (along with an appended
filename) to QSettings, allow it to create the INI file within the temporary
directory, and then let QTemporaryDir clean up that directory when it goes out
of scope?
> > Because QSettings has the file locked. Make sure settings goes out of
> > scope before you re-open the file.
> >
> Granted, it's complex with the locking code, but underneath it all you have
> this hidden gem writeIniFile(), which takes a QIODevice and the map (you
> know, the function with
> > So I guess I can use QFile to create my own file, do what I need to
> > do, then remove it myself when I'm done, but is there any alternative
> > way to get what I want - QSetting written to a QString?
>
> There are overloads of QFile::open() that take a system file handle / file
>
I'd like to be able to have QSettings write out my settings to an INI file
format, but I'd like to avoid writing it to an actual file, instead just
writing it to "something" in memory (for example, a QString, QByteArray,
QBuffer, etc.).
As far as I can tell, there doesn't seem to be any way
I'm encountering an odd widget sizing difference on Windows, namely if I have a
QPushButton and a QComboBox together in a horizontal layout, and I set them
both to have the same fixed height, the do not appear to have the same height -
the combobox appears correct, but the push button is a
> When it loses focus it stops rendering a cursor altogether (you can test this
> out with another application arranged side-by-side with notepad).
Good point, so at least in the Notepad case, it does appear to follow the same
behavior as my quick Qt sample application - clicking and holding on
> If you want to put the effort for this, port to client side decoration and
> handle events in your application.
I mostly don't want to have to deal with it at all, mainly because it takes a
decent amount of work to execute that correctly, for no real gain, since I
don't think normal users are
> I would just tell the user that it behaves like notepad and 99% of other
> Windows applications.
That's just it, I'm not sure that it does work like other Windows applications
that don't use Qt. I just tried both Chrome and Windows Media Player and they
do NOT exhibit that behavior. For
One of my users reported an issue that I think falls into the
"nothing can be done about it" category, but wanted to see
if anyone had any ideas.
On a Windows build of our application, if the user clicks
AND HOLDS the mouse on any of the Windows buttons (so
the standard Windows Minimize,
I'm having a bit of an issue creating a custom window with the
following requirements:
1. Customized window control buttons
a. I want to keep the 'X' button to close the window,but I do not
want the minimize or maximize buttons shown
b. In addition, I then need to add my own custom
> Ah. In our case, the QLineEdit is inside (and parented by) a widget that
> provides the background of the window. That parent widget can accept
> focus, so I guess our cases are not quite the same.
Ok, good! I thought I missed something. In my case, that is a problem since the
user can click
> Hmm, about that extra step, to remember the filter stuff, since you already
> have a custom line edit class, why not embed the MouseFilter class inside it?
> I mean, the filter does not have to reside in MainWindow, it needs only the
> qApp pointer, so you could wire it up in your custom line
> Hi, had a similar problem, couldn't find any other solution than using an
> event filter, but it turned out being not so bad, made a small class:
>
> In my MainWindow I have an instance of that class, and in MainWindows's
> ctor I initialize it:
>
> MouseFilter mf;
> ...
>
I'm trying to create a custom QLineEdit where while editing, the user can click
anywhere *outside* the QLineEdit to finish editing.
The default QLineEdit behavior appears to be that once the user has clicked
inside the QLineEdit and begins editing the text, if the user then clicks on
some
> So using QGIS to convert my .shp files to .svg, and then loading the result
> in a
> QGraphicsSVGItem works like a charm - thanks! The only drawback I’m seeing
> is zooming performance. It *looks* good, but is a tad sluggish. When using
> QGIS, I noticed that it was compiled against Qt as
I'm trying to create a widget with the following setup (this is related to my
popup window question last week):
Widget hierarchy
popupWindow - unparented, top level window
- QVBoxLayout
- genericWidget (in my case it's a QGroupBox, but it could be any type of
widget in theory)
-
> AFAIK, the easiest way to trap keyPress/keyRelease irrespective of which
> widget has the focus is to install an event filter on the QApplication
> instance. Use the mouseEnter/Leave events of the thumbnails to set/clear a
> currentThumbnail, and then in eventFilter only act on the 'm' keyPress
> Not sure if this fits your use case 100%, but might give you some ideas. I
> did
> something similar for magnifying images in QLabels, but I don't have your
> additional focus issue
Yeah, that's the part I'm struggling with at the moment, but I only started
messing with this late yesterday
I'm trying to figure out the best way to receive key presses when the user
hovers over a specific widget, and deliver that keypress information to the
parent widget.
Say I've got three types of widgets:
1. thumbnailWidget - displays a low resolution version of a full resolution
image,
I'm assuming someone has already done this with Qt, but either I'm wrong or I'm
googling poorly today... I'm just trying to find if someone has already
implemented the functionality that Chrome (and other applications with tabs)
where you can select a tab on the tab bar, start dragging it, and
> Unless Qt supports negative indexes (like python's [-1]) I would have thought
> this would be an int. Thanks for catching that everyone.
I'm assuming you made a typo there and meant to say "uint"? Regardless here's
the official reason why Qt uses "int" for container indices:
> uint foregroundPixels = reverseKeys[foregroundIndex];
> uint foregroundColor = reverseKeys[foregroundPixels]; //main.cpp:66:37:
> warning: implicit conversion changes signedness: 'uint' (aka 'unsigned int')
> to 'int'
>
> Where is the "signed" conversion happening?
foregroundPixels is a
> I would just show one progress set to 3 * raw count. Each stage
> periodically signals to the ui thread its progress, and whether it has
> processed the end-of-data signal from the previous stage. In the ui
> thread slot:
>
> int totalCount, rawCount;
>
> QVector stageProgress;
>
> void
We have a data processing pipeline that looks like so:
Raw Data objects -> Type "A" data objects -> Type "B" data objects -> Final
Data objects
Each step can be considered a filtering process where the following
mathematical relationship holds for the quantities of each type of object:
> > there doesn't appear to be an easy way to add widgets in the tab widget's
> tab bar.
>
> QTabWidget::tabBar(), layout(), addItem() ?
I meant "easy" in the sense of a functions like these (which don't exist):
QToolButton* QTabWidget::leftScrollButton()
QToolButton*
> This works for me, and the button is small 16x16.
>
> m_TheTabWidget->setCornerWidget(bp1);
You know, I saw that function and for some reason switched it
in my head to be talking about the corner cell in a QTableWidget,
not talking about a QTabWidget. Apparently I need more caffeine
> You could add a tool-button with said popup menu associated to it to the
> right of the tab widget (e.g. Firefox does this). This would have the
> advantage from my PoV that it's always there and works, regardless of
> how many tabs are open.
I'll ask whether this would be acceptable. As I
> > A request has come in to allow the user to right-click on the scroll
> > buttons,
> which would then open a popup menu of all open tab names which they can
> select from, and then I could just set the selected tab as the currentIndex().
> But I don't see anything on
Is there a way to get access to the scroll buttons on a QTabWidget to customize
them?
The issue we're having is that we have a UI that uses a tab widget for
displaying file contents - one tab per open file. Once a user opens enough
files/tabs, the tab scroll buttons pop up (so far so good),
> Well there's always QSettings::registerFormat (
> https://doc.qt.io/qt-5/qsettings.html#registerFormat )
>
> Haven't tried it myself but it will give you a QSettings::SettingsMap
> which means you'll still have to serialize out it yourself to a QString,
> but at least you can get rid of the
> Hi, just tested your example program in MSVC 2017 Qt 5.12.1 and it fails
> as well.
>
> But a simple fix is just to make sure that the QFile file isn't open at
> the same time as you write out the settings to it.
> I.e. in your example program, it suffices to move that first
> file.close(); up
I'm porting an old application from Qt 5.3.2 to Qt 5.9.6 (yeah, I know, we're a
lot behind...). I'm running into an issue where code we had that was writing
out settings via the QSettings constructor that takes a file name doesn't work
anymore. I've attached a fairly minimal example that shows
> > Regarding your setMenu question, I did consider it, but I didn't think it
> > would
> > work for my needs - although I could be wrong about that. Here's my
> > requirements:
> > 1. I need a widget that pops up when the user clicks on a button So this
> > requirement
> > *could* be handled
> I have an app (Desktop) that I want it to know about other running instances
> on the local network. I figured UDP broadcast was a natural choice. I tried
> it,
> but I never saw anything but my own (local) packets. There's quite a few
> stackoverflow questions, but none used Qt. I'm wondering
> Widgets are normally positioned relative to their owner - the exception
> is popup menus, which are screen absolute. I would expect a popup menu
> to automatically close when the title bar is clicked. How have you
> implemented your captionPopupMenu? Does it capture the mouse when it
> is
>
> > So I'm not sure what I need to trigger off from to detect when I need to
> reposition the menu. I feel like I'm missing something really obvious, but not
> seeing it on a Monday apparently.
>
> I don't think you're missing anything -- if a widget doesn't move, but
> its parent does, only the
My basic question is how do child widgets get moved or repainted when some
ancestor of theirs moves?
Here's the more detailed issue, first the widget hierarchy:
QMainWindow
CustomerHeaderTable (inherits from QTableWidget)
CustomTableHeader (inherits from QHeaderView, allows you to put
I'm wondering if anyone knows of a Qt widget that already does this, similar to
this javascript example I found:
https://stackoverflow.com/questions/19089841/extjs-4-2-1-add-a-top-arrow-to-any-popup-menu
I've got a widget that has some buttons on it. When I click on one of those
buttons, I
> Yes, I used QTreeWidget ::setCellWidget(int row, int column, QWidget *widget).
> I have already used QStyledItemDelegate, but setCellWidget is far easiest for
> what I want to do.
> I don't really understand why QPushbutton are correctly displayed and not
> other widgets.
> But if only
> I would like to display colored widgets in a QTreeWidget.
> Screenshots of what I really have are in attached files.
> My wigdet is colored, but when in the QTreeWidget, it is all white. How can I
> resolve it?
Are you adding your widget to the QTreeWidget via
QTreeWidget
ission in error,
please immediately notify the sender by telephone at 989-872-7274 or send an
e-mail to smur...@walbro.com<mailto:smur...@walbro.com> and thereafter destroy
the e-mail you received and all copies thereof.
From: Interest On Behalf
Of Murphy, Sean
Sent: Tuesday, June 12,
I'm trying to plot some data using QCharts and having trouble finding the
combination of options that get me what I want, here's our setup:
Underlying data: the underlying data is basically a set of bins, with a count
of how many items are in that bin. The numerical range of each individual
I'm just looking for someone to sanity check my thought process here...
I've been tasked with having my application read in structs out of header files
to
create data structures in memory that can be populated by the user. Those
structures
which then can later be written out/displayed in a
> > 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...
Sean
This message has been scanned for malware by Forcepoint.
> By definition, you can only draw inside a window.
>
> So if you need to draw, put a window there. Maybe you can make a window
> that has no title bar, no borders and is transparent.
That was going to be my suggestion as well, and I was working on something
last week that needed a transparent
> > But the issue only comes up with the plots that are embedded into the
> table. The standalone plot has the color palette I want, and
> > the palette is being set in the plot class' constructor, so it should be the
> same palette for all 3 plots.
>
> Yea, didn't think that was it.
>
> One
> Probably not your problem, but have you tried setAutoFillBackground(true) on
> your plot? I have that in one of my Qwt apps.
I think I did. I played around a lot with the following functions, but it's
possible I didn't hit the right combination in the right location
I'm trying to figure out how to have a horizontal QHeaderView's sections span
multiple columns. I know that within the table itself, table cells can be
merged via QTableView::setSpan(int row, int column, int rowSpanCount, int
columnSpanCount), but as far as I can tell, that functionality
I didn't check to see if it's built in to Qt or not, but here's the math you
need to make it work yourself
http://iiif.io/api/annex/notes/rotation/
Sean
This message has been scanned for malware by Forcepoint. www.forcepoint.com
___
Interest mailing
> The Qt Charts module is licensed under GPL, not LGPL. See:
> http://doc.qt.io/qt-5/qtmodules.html#gpl-licensed-addons
We have a commercial Qt license, so I believe we aren't
GPL-bound for Qt Charts (or the Data Visualization &
Virtual Keyboard modules)?
That link you sent says "Add-ons
> > I find that they work well if you're just trying to have one plot, but I'm
> > struggling to get
> > them to work the way I need them to for our requirements:
> Are you looking for a library that you want to include into your application
> or do you
> simply want to visualize the data as
> As long as this isn't for printing...
> Fix 1-3 by normailizing each sensor from min to max, and plot that. This is
> C++ so you can
> override at() in the QXYLineSeries. You should be able to dymically change
> the Y legend
> when you mouse over a > specific point.
I’ll take a look at this
> That can really distort the shape of a curve in often misleading ways.
> And if the sensors can be truly zero, you have another, bigger problem.
>
> > On Jan 4, 2018, at 2:11 PM, william.croc...@analog.com wrote:
> >
> > Use a single, logarithmic Y axis.
> > (I have never use Qt Charts so I do
> I've used them. Once. 3 years ago.
Yeah, and that was sort of why I asked. Not that qt-interest would be the WRONG
place to ask, but whether it's the BEST place to ask. Mainly because I rarely
see any traffic about the classes in that module here.
Sean
This message has been scanned for
Some spreadsheet applications (notably MS Excel, Google Sheets, etc.) have a
mechanism for indicating that a cell has a comment attached to it (see attached
screenshot, the red triangle in the upper corner of the cell A1). Is there a
way to do something similar with a QTableWidgetItem?
The
> Aha, it happens when using a QApplication; the MessageDialog is actually a
> QMessageBox in that case. I can get the same result with the test qml like
> this:
>
> qml -apptype widget messagedialog.qml
>
> (that makes the qml runtime use a QApplication instead of QGuiApplication)
> and maybe
> Yes, it should be automatically transient for its parent. For me it works on
> Linux and macOS. So I wonder if we have a bug about this transient-
> parenting in general on Windows. Have you tried any older Qt versions?
Well, the example code you sent me worked correctly on the same version
I'm not sure if this is a bug, or if I'm doing something wrong, but I'm trying
to display a Qml dialog when an error occurs and it's coming up centered on my
monitor, not centered over the application.
Relevant code:
Window {
MessageDialog {
id: errorDialog
objectName:
I'm extremely new to both QML development and Android development, so I may
just be missing something obviously, but I'm struggling with a Menu's location,
but only on the Android platform. I've got a settings button down in the lower
right corner of my app. When clicked, it should popup() a
> > Is this just a difference of Android vs. Windows that our external BT device
> > doesn't show up as a serial device under Android like it does under
> Windows?
>
> The Android way of working is the same for Bluez/Linux (although with
> rfcomm you can achieve the same), WinRT and the Apple
> > On the Android device, we really only care about connected to the external
> > device via Bluetooth. But does this same behavior, where Bluetooth looks
> > like a serial device, exist under Android and I can still use QSerialPort?
> > Or
> > do I need some other device (i.e.
Basically, I think I'm just missing the glue that gets me from the Qml
delegate's text property and the QStandardItemModel::data(const QModelIndex &,
int role) method
Menu {
id: settingsMenu
Instantiator {
model: settingsModel
onObjectAdded:
> Example copied from a random project
>
> https://gist.github.com/anonymous/2f803e7b49760b509d6a23c43901f52e
Thanks, can you show me what "modelData" is in your example, or how the .cpp
side is laid out? I am using an Instantiator (and had been before I posted,
based on something I stumbled
I'd think this is a pretty easy thing to do, but I'm struggling to find an
example that shows it. In my QML, I have a button. When the button is clicked,
a popup menu should open. That part I have working, what I'm struggling with is
I need to be able to dynamically populate the popup menu from
I have an application that currently works on Windows that we would like to
port to Android. Under Windows, the application can communicate to an external
device over either a USB to Serial converter or over Bluetooth. I can
accomplish both of those connections using a class that inherits from
> > And then with the event filter approach, what would I actually be filtering
> on?
> It's similar to the above, only it solves the same problem at a
> different location in your code. Instead of modifying a delegate, you'd
> intercept the mouse click and, again, handle the state change
Thanks for the response Andre
> I'd probably handle this via either a custom delegate or by using an
> event filter.
Can you go into a little more detail on these two approaches?
As far as the custom delegate approach, I'm assuming that if I follow the Spin
Box Delegate Example
1 - 100 of 171 matches
Mail list logo