Re: [Interest] QtCreator c++20 highlighting

2024-02-19 Thread Konstantin Shegunov
On Mon, Feb 19, 2024 at 2:22 PM Frank Mertens wrote: > Hi Konstantin, > Hi Frank, I'm here with QtCreator 12.0.1 and C++20 syntax highlighting works just > fine. > Okay, thank you! I'm then going to assume that my version is simply too old. Of course I had to enable it?! In CMakeLists.txt tha

[Interest] QtCreator c++20 highlighting

2024-02-19 Thread Konstantin Shegunov
Hello, Are c++20 features (operators/keywords) supported with the QtCreator (10.0.2) highlighter? I'm asking because what I observe is that keywords like concept, consteval, requires are not recognised and have no highlighting. So I'm not sure if my version is old, the feature isn't supported, or i

Re: [Interest] QApplication was not created in the main() thread.

2023-07-01 Thread Konstantin Shegunov
On Fri, Jun 30, 2023 at 11:12 AM Yauheni Pervenenka via Interest < interest@qt-project.org> wrote: > Hi community, > I was faced with a warning QApplication was not created in the main() > thread. on windows only, it is very rare happen, > Almost certainly you're creating a static `QObject` insta

Re: [Interest] QML plugin with wasm not building

2023-02-18 Thread Konstantin Shegunov
On Sat, Feb 18, 2023 at 3:09 AM Sze Howe Koh wrote: > Does it work if you use STATIC instead of SHARED? > No, it makes no difference. I am assuming that `qt_add_library` changes it in the post-processing stage to be the correct type. Is the plugin built at the same time as the main application?

Re: [Interest] QML plugin with wasm not building

2023-02-13 Thread Konstantin Shegunov
Me again. If it matters, the exact diagnostics is as follows: On Mon, Feb 13, 2023 at 10:22 AM Konstantin Shegunov wrote: > `qt_register_pluginXXX` (or something of this sort). > Here's what emscripten reports: error: undefined symbol: _Z31qt_static_plugin_XXX_UiPluginv (refere

[Interest] QML plugin with wasm not building

2023-02-13 Thread Konstantin Shegunov
Hi, I wanted to build a simple QML application with webassembly, to try things out. However I've hit a strange problem I can't really figure out. The application consists of an executable and a library. It builds and runs fine for desktop, however switching to wasm - it fails with an unresolved sym

Re: [Interest] [Qt6] QML notify dynamic property changes from C++

2022-03-21 Thread Konstantin Shegunov
On Mon, Mar 7, 2022 at 12:20 PM Konstantin Shegunov wrote: > Sure, I'm going to try and prepare a testcase sometime later this week. > A bit later than I'd hoped for, but I tracked down the problem; posting for anyone that may stumble onto this at a later time. I didn&#x

Re: [Interest] [Qt6] QML notify dynamic property changes from C++

2022-03-07 Thread Konstantin Shegunov
On Mon, Mar 7, 2022 at 12:05 PM Ulf Hermann wrote: > Sorry, it's called: > void insert(const QString &key, const QVariant &value); > Just checked in the debugger, but calling it doesn't appear to update the value C++-side even. In order to further examine this we > would need a minimal example

Re: [Interest] [Qt6] QML notify dynamic property changes from C++

2022-03-07 Thread Konstantin Shegunov
Hi, On Mon, Mar 7, 2022 at 11:20 AM Ulf Hermann wrote: > QQmlPropertyMap::setValue(key, value) should trigger the change signal > of the property. > Do you possibly mean QQmlPropertyMap::updateValue, because I don't see a setValue method in the documentation. Either way it doesn't appear to wor

[Interest] [Qt6] QML notify dynamic property changes from C++

2022-03-05 Thread Konstantin Shegunov
Hello, I have exposed some dynamic properties through QQmlPropertyMap to the QML engine and that works well. However I need to change the values from C++ and want to notify the bindings about the property change from there. Is there a way to do it? I attempted to manually emit the valueChanged(),

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Konstantin Shegunov
On Mon, Jan 31, 2022 at 7:15 PM Murphy, Sean 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 begin with? > The actual loop is this: > // generate each tile with its assignment >

Re: [Interest] [Qt6] Inject a QML enum from C++ at runtime

2022-01-20 Thread Konstantin Shegunov
On Thu, Jan 20, 2022 at 5:13 PM Ulf Hermann wrote: > > Well, the number of names isn't fixed is the point - they're loaded at > > runtime and will change (increase) from time to time. > > Then an enumerator won't really help you. The point of an enumerator is > that each entry is a constant. > E

Re: [Interest] [Qt6] Inject a QML enum from C++ at runtime

2022-01-20 Thread Konstantin Shegunov
On Thu, Jan 20, 2022 at 4:55 PM Ulf Hermann wrote: > Why does it have to be an enumerator? It doesn't, of course. Currently I'm simply using strings instead. However it's 'nice' for the QML person/people to refer to a real name with an integer behind instead of a free-floating string, albeit yo

[Interest] [Qt6] Inject a QML enum from C++ at runtime

2022-01-20 Thread Konstantin Shegunov
Hello, I imagine I'm not supposed to do such stuff, but is it at all possible to provide a QML enumerator at runtime from C++? I took a peek how the QML engine deals with enums, and it does appear it's technically feasible, provided there's some API, which understandingly isn't public. What I'd wa

Re: [Interest] [Qt6] QML automatic type registration in a (shared) library

2022-01-19 Thread Konstantin Shegunov
On Wed, Jan 19, 2022 at 10:44 AM Alexandru Croitor wrote: > I assume you mean you did target_sources(tsc_ui_target INTERFACE dummy.cpp) > target_link_libraries(your_shared_lib PRIVATE tsc_ui_target) > Yes. It does work if the direct consumer is a shared lib. > That doesn't quite work if the con

Re: [Interest] [Qt6] QML automatic type registration in a (shared) library

2022-01-19 Thread Konstantin Shegunov
On Wed, Jan 19, 2022 at 9:56 AM Alexandru Croitor wrote: > As far as I know, the referenced merge request only implements an > abstraction for decorations, but does not implement the specific decoration > of making sure a library is not discarded. > Yes, that's my understanding of the discussion

Re: [Interest] [Qt6] QML automatic type registration in a (shared) library

2022-01-18 Thread Konstantin Shegunov
On Fri, Jan 14, 2022 at 11:58 PM Ulf Hermann wrote: > The way we work around the issue in the generated plugin code is storing > it in a volatile pointer. That's terrible and also not guaranteed to > work, but it works in practice on all compilers we support. If you > figure out a better way, ple

Re: [Interest] [Qt6] QML automatic type registration in a (shared) library

2022-01-14 Thread Konstantin Shegunov
On Fri, Jan 14, 2022 at 1:58 PM Ulf Hermann wrote: > Indeed. And instead of the dummy symbol you can just use the existing > type registration function for that. As you've found out, "just store > it" is not enough. You have to "do" something with it. Sorry for being > inaccurate there. > I must

Re: [Interest] [Qt6] QML automatic type registration in a (shared) library

2022-01-14 Thread Konstantin Shegunov
Well, I did find out what the problem is, and how to work around it. So I'm posting for further reference to anyone that may stumble onto this. On Fri, Jan 14, 2022 at 8:09 AM Ulf Hermann wrote: > No. You can store a pointer to the type registration function somewhere > in order to prevent the l

Re: [Interest] [Qt6] QML automatic type registration in a (shared) library

2022-01-14 Thread Konstantin Shegunov
On Fri, Jan 14, 2022 at 8:09 AM Ulf Hermann wrote: > If you want the QML engine to find your module, you need to follow > certain conventions around the paths. > My resistance to this is the self-containment of the given project/target. I don't mind following the convention(s) for the paths insi

Re: [Interest] [Qt6] QML automatic type registration in a (shared) library

2022-01-14 Thread Konstantin Shegunov
On Fri, Jan 14, 2022 at 7:18 AM Ulf Hermann wrote: > Well, no, that doesn't work. If your module is called Tsc.Ui, then it > needs to live in a directory called Tsc/Ui/, not TscUi/. That's the > reason why the explicit file system import path doesn't work either. > Perhaps that's how it's suppos

Re: [Interest] [Qt6] QML automatic type registration in a (shared) library

2022-01-14 Thread Konstantin Shegunov
On Fri, Jan 14, 2022 at 6:16 AM Ulf Hermann wrote: > Is the place where the module's qmldir ends up reachable via the QML > import path? I don't know. I have the generated qmldir in the C:\Programming\tsc\build\debug\TscUi directory, which I think should be correct. I haven't messed with the ou

[Interest] [Qt6] QML automatic type registration in a (shared) library

2022-01-14 Thread Konstantin Shegunov
Hi, I've been continuing to experiment with the Qt6 QML capabilities and I hit the following problem. I have a shared library with a couple of qml files, but for some reason I don't get them installed and when I run the application I get the module not installed error. While trying to figure out w

Re: [Interest] [Qt6] Gadgets in QML

2022-01-07 Thread Konstantin Shegunov
On Fri, Jan 7, 2022 at 10:46 AM Ulf Hermann wrote: > Sure, if you have something on gerrit let me see! > Not as of yet, but it can be arranged. > However, value types with upper case names is something I probably won't > allow. Not up to me, but I have a licensing obligation to submit my cha

Re: [Interest] [Qt6] Gadgets in QML

2022-01-06 Thread Konstantin Shegunov
On Thu, Jan 6, 2022 at 4:01 PM Konstantin Shegunov wrote: > Yes, I'd intended to also provide: > > property var age: Age {} > Well, it does work, albeit I'm not convinced if it's better/efficient enough. In any case, if you're interested we ca

Re: [Interest] [Qt6] Gadgets in QML

2022-01-06 Thread Konstantin Shegunov
On Thu, Jan 6, 2022 at 12:54 PM Ulf Hermann wrote: > > Person is a `QObject`, the `Age` is a gadget I've exposed from C++. > > Then it's easy. If the "age" property is declared in C++, already today > you can do the following (just like with font): > > property var person: Person { > age { >

Re: [Interest] [Qt6] Gadgets in QML

2022-01-06 Thread Konstantin Shegunov
On Thu, Jan 6, 2022 at 12:46 PM Ulf Hermann wrote: > Well, yes, you need to declare the "person" property in C++ for now > because you cannot have named value types. Once we get named value types > (and some grammar fixes) you can do the following: Person is a `QObject`, the `Age` is a gadget I

Re: [Interest] [Qt6] Gadgets in QML

2022-01-06 Thread Konstantin Shegunov
Hi, Thanks for the information. On Thu, Jan 6, 2022 at 11:38 AM Ulf Hermann wrote: > It's not implemented yet, and there are some questions surrounding the > desired syntax. > That's a given, no argument. > We already have group properties. So, if you have a property font of > some value type

[Interest] [Qt6] Gadgets in QML

2022-01-06 Thread Konstantin Shegunov
Hello, To be frank it's been an annoyance for me that gadgets can't be instantiated the same way the QObject can within the QML document/tree. Is there a good reason to disallow this or is it simply not implemented? Am I missing some odd use/corner case why it's not a good idea? Kind regards, Kons

Re: [Interest] [Qt6] QML_ATTACHED failing with ::QQmlPrivate not declared

2022-01-05 Thread Konstantin Shegunov
On Wed, Jan 5, 2022 at 11:54 AM Ulf Hermann wrote: > would import a class called "QQmlRegistration". There > is no such class in that header. It's a collection of macros. The > correct form is . > Yes, I suppose, albeit you do ship . ___ Interest mail

Re: [Interest] [Qt6] QML_ATTACHED failing with ::QQmlPrivate not declared

2022-01-05 Thread Konstantin Shegunov
On Wed, Jan 5, 2022 at 11:23 AM Ulf Hermann wrote: > > On a side note, I was wondering, why these, contrary to other Qt > > headers, don't provide cpp style naming? > > Where do you see the lack in cpp style naming? What name is wrong? > I didn't mean the name's wrong, simply that I read in the

Re: [Interest] Qthread from QFuture?

2022-01-04 Thread Konstantin Shegunov
On Wed, Jan 5, 2022 at 3:03 AM Scott Bloom wrote: > Its such a nice simple interface for launching a background thread and > asynchronously being notified when it finishes 😊 > The point is that it doesn't start a thread at all, not necessarily. The threads are pooled and your job is queued for e

Re: [Interest] [Qt6] QML_ATTACHED failing with ::QQmlPrivate not declared

2022-01-04 Thread Konstantin Shegunov
On Mon, Jan 3, 2022 at 11:21 AM Ulf Hermann wrote: > > So, did I stumble on a bug? > > Including qqml.h instead of qqmlregistration.h should work. > Thanks! Indeed, that does fix it cleanly for me. Just noting: similarly I had 'undeclared qRegisterXXX' for the singleton if I forward declare QQm

[Interest] [Qt6] QML_ATTACHED failing with ::QQmlPrivate not declared

2022-01-01 Thread Konstantin Shegunov
Hello, I've been doing some experimenting with Qt6's QML - C++ integration (qtdeclarative @ 3d23912b0e, following the docs on providing attached properties for a QML exposed class and I'd got the aforementioned compile error. I have the C++ class(es) in a dynamic library where in the CMakeLists.tx

Re: [Interest] (Q)Plugins and QML/Quick

2021-09-14 Thread Konstantin Shegunov
On Tue, Sep 14, 2021 at 9:02 PM Rui Oliveira wrote: > PS: For reference, I'm talking about what would be the QML/Quick > equivalent of the Plug and Paint example: > > > https://doc-snapshots.qt.io/qt6-dev/qtwidgets-tools-plugandpaint-app-example.html > > Where the plugins bring UI components with

Re: [Interest] Warning about QHash keys().toVector()

2021-06-13 Thread Konstantin Shegunov
On Sun, Jun 13, 2021 at 7:22 PM Kevin André wrote: > How can I avoid the warning in this case? > return QVector<..>(_actions.keyBegin(), _actions.keyEnd()); Should work, I believe. ___ Interest mailing list Interest@qt-project.org https://lists.qt-pro

Re: [Interest] QOpenGLWindow inside QSplitter horizontal layout ?

2021-05-21 Thread Konstantin Shegunov
On Fri, May 21, 2021 at 11:43 AM Benjamin TERRIER wrote: > Regardless of QOpenGLWidget being better suited that QOpenGLWindow, > shouldn't QWidget::createWindowContainer() work with any window? > Yes but typically you go to it when you integrate an external surface, say one that you get from ano

Re: [Interest] Language and translator : Learning and questions

2021-05-03 Thread Konstantin Shegunov
On Sun, May 2, 2021 at 8:50 PM Nicholas Yue wrote: > (2) I see some examples where a translator is removed before installing > a new one, I comment that away and it still works, is there some issue > lurking in the background that will cause a crash later ? > QCoreApplicaiton supports multiple

Re: [Interest] How to get QMainWindow derived window to show

2021-05-01 Thread Konstantin Shegunov
On Sat, May 1, 2021 at 1:22 AM Nicholas Yue wrote: > but somehow, the MainWindow variety, I have not been able to > > > https://github.com/nyue/QtQuestions/blob/main/Qt5/language_change/mainwindow/MainWindow.cpp > You're treating the main window that's instantiated as a `QWidget`. Simply: int

Re: [Interest] L Word

2021-04-30 Thread Konstantin Shegunov
On Fri, Apr 30, 2021 at 6:48 PM Robert Hairgrove wrote: > There IS the other forum at https://forum.qt.io/ ... > > It has lots of subforums which would seem adequate for off-topic content > as long as it even remotely concerns Qt. > Yes, we are lenient, probably sometimes to a fault, but we have

Re: [Interest] Language file resource loaded but UI not updating

2021-04-30 Thread Konstantin Shegunov
On Fri, Apr 30, 2021 at 9:42 AM Nicholas Yue wrote: > Hi, > Hi, What function do I need to call to tell the application that I have > loaded a language file and to use it ? > You install the translator to the application. For newly initialized forms - nothing more is to be done, however for

Re: [Interest] L Word

2021-04-30 Thread Konstantin Shegunov
On Fri, Apr 30, 2021 at 1:56 PM Bernhard Lindner < priv...@bernhard-lindner.de> wrote: > Agreed. Why not configuring e-mail filters? This is what I would do. This > is definitely > better than leaving the list or getting angry and also better than waiting > for the > moderators taking actions for

Re: [Interest] L Word

2021-04-30 Thread Konstantin Shegunov
Ronald -> Roland Sorry about the typo. ___ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest

Re: [Interest] L Word

2021-04-30 Thread Konstantin Shegunov
On Thu, Apr 29, 2021 at 11:27 AM Giuseppe D'Angelo via Interest < interest@qt-project.org> wrote: > I don't. And I don't send ultimatums or threats of libel lawsuits > (seriously?) around, including to the moderators, in order to force them > to make a move. Well, us "script kiddies"* don't live

Re: [Interest] Guide me through the Qt offerings for GUIs

2021-04-26 Thread Konstantin Shegunov
On Sun, Apr 25, 2021 at 7:43 PM Ulf Hermann wrote: > For example named value types or (civilized) construction of value types > in QML. I have a question about that one. Is it feasible, in the technical sense at least, that a value object be constructed from a JSON definition? Perhaps supportin

Re: [Interest] Guide me through the Qt offerings for GUIs

2021-04-25 Thread Konstantin Shegunov
On Sun, Apr 25, 2021 at 2:21 PM Giuseppe D'Angelo via Interest < interest@qt-project.org> wrote: > 22/04/21 20:38, Konstantin Shegunov: > > Registering a struct/data class with the meta type system and/or > > marshaling it over QVariant, just so it can be visible in QML

Re: [Interest] Guide me through the Qt offerings for GUIs

2021-04-24 Thread Konstantin Shegunov
On Sat, Apr 24, 2021 at 2:42 PM Rui Oliveira wrote: > Audio applications, like DAWs solve this by just allowing VST developers > to bring their own UI at their will, on a separate window. But I have an > app I want to create a space for the plugin/module to display it's > controller for it's own

Re: [Interest] Guide me through the Qt offerings for GUIs

2021-04-22 Thread Konstantin Shegunov
On Thu, Apr 22, 2021 at 7:19 PM Giuseppe D'Angelo via Interest < interest@qt-project.org> wrote: > You should create a C++ layer (call it a "presentation" layer) that sits > between your (possibly non-Qt) business logic and the UI. That layer > contains stuff like item models, QObjects that expose

Re: [Interest] Guide me through the Qt offerings for GUIs

2021-04-22 Thread Konstantin Shegunov
On Thu, Apr 22, 2021 at 6:10 PM Rui Oliveira wrote: > Basically we're coupling the whole backend to the GUI framework. > You always have some coupling between the logic and the GUI, no matter what you use, but I do get the gist. > I'd prefer to write C++ than to learn Loaders and whatever else t

Re: [Interest] Guide me through the Qt offerings for GUIs

2021-04-22 Thread Konstantin Shegunov
On Thu, Apr 22, 2021 at 11:56 AM Volker Hilsheimer wrote: > * declarative vs imperative APIs > > Many widget classes don’t have a declarative-friendly API. Plenty of > widget properties have side effects on other properties, so the order in > which properties are set matters. That doesn’t work we

Re: [Interest] Guide me through the Qt offerings for GUIs

2021-04-22 Thread Konstantin Shegunov
On Thu, Apr 22, 2021 at 4:59 PM Jérôme Godbout wrote: > I wonder if it would be possible to totally declare the QtQuick scene from > C++ without any Qml files actually, with Qt6 you got C++ binding and the > Qml is compiled to C++ anyway. Maybe I miss something but it could be > possible to actua

Re: [Interest] QML bug?

2021-04-16 Thread Konstantin Shegunov
On Fri, Apr 16, 2021 at 2:26 PM Alexander Dyagilev wrote: > Hello, > > Hi, > Why are not they defined? These are ids of items defined in the same qml > file. > Could you try binding the property in a `Component.onCompleted` handler? Does that solve it? (My suspicion is that all the dependent ite

Re: [Interest] QtQuick over Qt3D (Qt 5.15)

2021-04-12 Thread Konstantin Shegunov
On Thu, Apr 1, 2021 at 8:40 AM Paul Lemire wrote: > Hello Paul, > Hello, > It sounds to me like Scene2D is what you want as it renders a QtQuick > scene into an offscreen texture which can then be applied to a Qt 3D mesh. > Unfortunately it can only be used from QML. > > That being said, nothing

Re: [Interest] QtQuick over Qt3D (Qt 5.15)

2021-03-31 Thread Konstantin Shegunov
On Wed, Mar 31, 2021 at 6:32 PM wrote: > Hi Konstantin, > Hello Eric, > Welcome to the hell that is 3D in Qt. > > > > To understand the problems that you are facing, you need to know a little > history. Other users can perhaps provide additional insight or correct any > errors, since my recoll

[Interest] QtQuick over Qt3D (Qt 5.15)

2021-03-29 Thread Konstantin Shegunov
Hello, I want to overlay a QtQuick UI over a Qt3D scene I'm having, however (here comes the "but") I want to do it from C++. I don't want to get into instantiating Scene3D at all, I want to drive the Quick scene from Qt3D, not vice versa (i.e. I don't want to render the 3D content to an FBO, and I

Re: [Interest] is it ok to push audio on a background thread, not a timer?

2020-05-19 Thread Konstantin Shegunov
On Wed, May 20, 2020 at 2:13 AM David M. Cotter wrote: > is it possible i'm just using QThread wrong? and it HAPPENS to work fine > on mac but fails on windows? > > is this blogger really revealing the ONE TRUE NATURE of QThread: > > https://mayaposch.wordpress.com/2011/11/01/how-to-really-truly

Re: [Interest] Why doesn't my model filter update?

2020-02-18 Thread Konstantin Shegunov
On Tue, Feb 18, 2020 at 11:20 PM Matthew Woehlke wrote: > On 18/02/2020 15.35, Matthew Woehlke wrote: > I wonder if anyone else can spot it? ;-) > Without knowing anything about the code at all, my best guess based on a very quick glance would be the range for the dataChanged is wrong. _

Re: [Interest] Qt widget parent and child visibility

2019-12-16 Thread Konstantin Shegunov
On Mon, Dec 16, 2019 at 8:13 PM Thiago Macieira wrote: > On Monday, 16 December 2019 05:58:52 PST Ramakanth Kesireddy wrote: > > Is there any means to hide parent and then show child widget in Qt 5.13? > > No. All child widgets are displayed inside the parent. If the parent is > not > visible, th

Re: [Interest] Expected event execution order in this multi-thread application

2019-09-30 Thread Konstantin Shegunov
On Mon, Sep 30, 2019 at 6:07 PM Ola Røer Thorsen wrote: > What's wrong with the sleep functions in particular? > They're uninterruptible. In 99.9(9)% of cases there's a better way to suspend a thread for some time than unconditionally putting it to sleep. > Are they worse than calling for exam

Re: [Interest] Connect to signal QProcess::finished on MSVC 2017

2019-05-14 Thread Konstantin Shegunov
On Wed, May 15, 2019 at 4:37 AM jlk wrote: > However, on MSVC 2017, I've now read about a bug (in the > C++ standard requirements, I guess) that prevents qOverload from > working. Could someone suggest a workaround for my case? > If you can't use qOverload or QOverload<...>::of(), then you have

Re: [Interest] My first 5 years with Qt and 2 suggestions

2019-05-10 Thread Konstantin Shegunov
On Fri, May 10, 2019 at 4:07 PM Shawn Rutledge wrote: > So “stable” just means old in practice, and thus uninteresting for > developers. Old AND stable. There are specific criteria the debian project uses to mark a package as stable. Old may not mean stable, but usually stable means old (althou

Re: [Interest] Issue with QSqlModel and QSortFilterModel

2019-04-18 Thread Konstantin Shegunov
On Thu, Apr 18, 2019 at 12:25 PM Bernhard Lindner < priv...@bernhard-lindner.de> wrote: > Did you write an issue tracker entry about that? > No, I haven't written a jira ticket, although I didn't get which issue you meant by "that". ___ Interest mailing

Re: [Interest] Issue with QSqlModel and QSortFilterModel

2019-04-18 Thread Konstantin Shegunov
On Thu, Apr 18, 2019 at 12:41 AM Scott Bloom wrote: > Any thoughts? > Hi! As a matter of fact I was facing a similar issue for my current project, but in my case I need to fetch the data over the network, from a DB as well, but one that I don't have direct access to. You can imagine I struggle(d

Re: [Interest] Signals, slots before the event loop starts?

2019-04-11 Thread Konstantin Shegunov
On Thu, Apr 11, 2019 at 4:57 PM Jason H wrote: > Update on this: > It didn't work. I called it, nothing (discernable) happened. Got a bunch > of serial port not open errors > Something else's amiss. Here's the test-case: #include #include int main(int argc, char *argv[]) { QCore

Re: [Interest] Signals, slots before the event loop starts?

2019-04-11 Thread Konstantin Shegunov
On Thu, Apr 11, 2019 at 3:48 PM Jason H wrote: > What is the best way to do that? I think in the past, I used a 0ms timer, > but that always feels janky. > QMetaObject::invokeMethod(qApp, &QCoreApplication::quit, Qt::QueuedConnection); is my preference. _

Re: [Interest] Parsing data from serialport

2019-04-05 Thread Konstantin Shegunov
On Thu, Apr 4, 2019 at 6:42 PM Jérôme Godbout wrote: > You jus did the same loop into your slot, the function I did made can be > called as slot to the connect you just told, I agree the > serial_port->waitForReadyRead(5); is not necessary, just often the > transmission have partial or bunch of d

Re: [Interest] Parsing data from serialport

2019-04-05 Thread Konstantin Shegunov
On Thu, Apr 4, 2019 at 9:37 PM wrote: > Try testing them with a million+ row table. > Been there, done that. Be a lamb and stop with the nonsense. I'm sure you run every file operation in a dedicated thread, 'cause you'd *"never ever ever do I/O in the main GUI thread of a Qt application" ...* W

Re: [Interest] Parsing data from serialport

2019-04-04 Thread Konstantin Shegunov
On Thu, Apr 4, 2019 at 5:46 PM Jérôme Godbout wrote: > It relief the main thread from read data all the time and keep a good > reactivity. The dedicated thread try to read and can wait until something > come along and once it found something that can be parsed, it emit his own > signal that the m

Re: [Interest] Using a QAbstractScrollArea

2019-03-22 Thread Konstantin Shegunov
On Fri, Mar 22, 2019 at 8:25 PM Bob Hood wrote: > How do I use this as a concrete Qt class type? Do I inherit from > QScrollArea > and then somehow change my parent to it? Or do I have to inherit from the > third-party class, and then recreate the entire QScrollArea interface so > it > "quacks"

Re: [Interest] popcnt for QFlags

2019-03-15 Thread Konstantin Shegunov
On Fri, Mar 15, 2019 at 4:08 PM Giuseppe D'Angelo via Interest < interest@qt-project.org> wrote: > Yes, this is public API. > Indeed, the point was that the API is a bit mismatched in regards to the used types. QFlags uses int, while qPopulationCount accepts only unsigned integers, so I'd have to

Re: [Interest] popcnt for QFlags

2019-03-15 Thread Konstantin Shegunov
PS. should I just use qPopulationCount? > ___ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest

[Interest] popcnt for QFlags

2019-03-15 Thread Konstantin Shegunov
Hello, Do we have some Qt way to count the raised bits in a QFlags instance. I saw there's an inline qt_builtin_popcount, however it's not documented. Can I rely that it's going to always exist (probably not)? Can we get a method in QFlags that does this - counting the number of raised bits, instea

Re: [Interest] Recommended exception handling

2019-03-12 Thread Konstantin Shegunov
On Tue, Mar 12, 2019 at 11:04 PM Thiago Macieira wrote: > No. Catch it before it goes back to Qt code. > Roger that! ___ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest

Re: [Interest] Recommended exception handling

2019-03-12 Thread Konstantin Shegunov
On Mon, Mar 11, 2019 at 10:56 PM william.croc...@analog.com < william.croc...@analog.com> wrote: > I wrote and installed my own notify function. > Yes, thanks, but as far as I understand from the docs this is going away in the future (or at least it is in threaded code), which is the reason for m

Re: [Interest] Whole edit window closes.

2019-03-12 Thread Konstantin Shegunov
Hello, I remembered reading something akin in the forum recently, so I dug up a bit. I think this[1] might be related to your case. I hope it helps. Kind regards. [1]: https://forum.qt.io/topic/96811/close-itemdeligate-in-view-when-some-other-widget-is-clicked

[Interest] Recommended exception handling

2019-03-11 Thread Konstantin Shegunov
Hello, Is there a current recommended way of catching exceptions before they unwind through the event loop? I want this for "debug purposes" only. I have few methods that throw and I (think I) catch (all of) my exceptions before they reach the event loop, but I wanted to be sure I hadn't forgotten

Re: [Interest] Disable -Og when configuring as developer build

2019-02-15 Thread Konstantin Shegunov
On Fri, Feb 15, 2019 at 4:57 PM Allan Sandfeld Jensen wrote: > Btw. If(when) the output isn't debug friendly, it is really a gcc bug True, and I (hope) I haven't implied otherwise. > should be reported to them if you have the time, and want it to improve in > the > future. > Perhaps, but as

Re: [Interest] Disable -Og when configuring as developer build

2019-02-15 Thread Konstantin Shegunov
On Fri, Feb 15, 2019 at 4:40 PM Konstantin Shegunov wrote: > How can I disable it? Is there -no-optimize-debug flag I could use? > Yes, apparently there is, and it worked beautifully. Thank you both! ___ Interest mailing list Interest@qt-proje

Re: [Interest] Disable -Og when configuring as developer build

2019-02-15 Thread Konstantin Shegunov
On Fri, Feb 15, 2019 at 4:05 PM Mitch Curtis wrote: > Is it the -optimize-debug configure flag? > No, not really. The configure script adds it by default to all debug builds as far as I could tell. Here's my configure line: $> ./configure -developer-build -opensource -confirm-license -nomake exa

Re: [Interest] Disable -Og when configuring as developer build

2019-02-15 Thread Konstantin Shegunov
On Fri, Feb 15, 2019 at 4:17 PM Olivier B. < perso.olivier.barthel...@gmail.com> wrote: > qtbase/configure.json says it is "optimize_debug" option that adds it > Okay. I don't pass that manually to configure, however in the summary I read the following: Build type: linux-g++ (x86_64, CPU feature

[Interest] Disable -Og when configuring as developer build

2019-02-15 Thread Konstantin Shegunov
Hello, That flag's been a pain for me to debug the Qt codebase for a while now, I'm really annoyed that configure generates it when using -developer-build. Long story short it prevents me to do step-by-step with gdb as the compiler reorders the code as it sees fit (no clue why). I remember I had fo

Re: [Interest] Netiquette [was: Feature Request - QtCreator - Multiple right margins]

2019-02-08 Thread Konstantin Shegunov
> > [...] > I do appreciate the open discussion style on this list. I even do > appreciate a somewhat harsh style, if it has a factual base and is > getting straight to the point instead of b*s*ing around. But those > lengthy wallpapers our President of Logikal solutions commonly utters, > have lon

Re: [Interest] Interest Digest, Vol 88, Issue 2

2019-01-04 Thread Konstantin Shegunov
On Thu, Jan 3, 2019 at 4:17 PM Roland Hughes wrote: > > On 1/3/2019 4:00 AM, Konstantin Shegunov wrote: > >> Yes QApplication destructor is invoked last..Does it makes sense to use > >> deleteLater() in the widget destructors instead of existing delete if it > >&g

Re: [Interest] Segmentation fault on exiting Qt event loop

2019-01-02 Thread Konstantin Shegunov
On Wed, Jan 2, 2019 at 5:55 PM Roland Hughes wrote: > By then, Qt has abandon them. Yeah, recently I had worked on a couple of projects for one such company (in aviation meteorology). They were "abandoned" for many years because it takes at least minimal effort to actually follow the new releas

Re: [Interest] Segmentation fault on exiting Qt event loop

2019-01-02 Thread Konstantin Shegunov
On Wed, Dec 19, 2018 at 11:51 AM Ramakanth Kesireddy wrote: > Yes QApplication destructor is invoked last..Does it makes sense to use > deleteLater() in the widget destructors instead of existing delete if it > could be cleaned up as part of qApp-quit()? > Your example code clearly shows otherwi

Re: [Interest] Use QMetaEnum::keyCount() to initialise array

2018-12-19 Thread Konstantin Shegunov
On Wed, Dec 19, 2018 at 11:22 AM Tom Isaacson wrote: > Is it possible to use QMetaEnum::keyCount() to initialise an array? Something > like: > > const QMetaEnum metaEnum = QMetaEnum::fromType(); > int MyArray[metaEnum.keyCount()]; > const QMetaEnum metaEnum = QMetaEnum::fromType(); in

Re: [Interest] Segmentation fault on exiting Qt event loop

2018-12-18 Thread Konstantin Shegunov
On Tue, Dec 18, 2018 at 8:25 AM Ramakanth Kesireddy wrote: > Thanks for your mail..Yes did try with valgrind but couldn't detect memory > issue may be due to the way our app is designed using threading. > But wondering why it throws segmentation fault if qApp instance is created > on stack but no

Re: [Interest] Segmentation fault on exiting Qt event loop

2018-12-17 Thread Konstantin Shegunov
On Mon, Dec 17, 2018 at 7:00 PM Ramakanth Kesireddy wrote: > Yes we do have Qt running in worker thread(pthread)..Does it throws > segmentation fault if we donot wait for the thread(like pthread::join) to > exit event loop and destroy objects accordingly? > Segmentation faults are not thrown, th

Re: [Interest] Segmentation fault on exiting Qt event loop

2018-12-17 Thread Konstantin Shegunov
On Mon, Dec 17, 2018 at 1:39 PM Andrew Ialacci wrote: > Assuming each threads quit() is called and all operations are stopped in > each thread correctly is using a loop and sleep still ok? > Ok's a relative term, but I wouldn't do (or recommend) it. That's the whole reason you have QThread::wait

Re: [Interest] Segmentation fault on exiting Qt event loop

2018-12-17 Thread Konstantin Shegunov
On Mon, Dec 17, 2018 at 1:26 PM Andrew Ialacci wrote: > I’ve had this issue on Windows especially when destroying worker threads > on an application exit. > Which you shouldn't do. What I ended up doing was sleeping the main thread until each worker > threads isRunning() return false; > > I’d l

Re: [Interest] Updated Debian packages or ppa for Qt 5.9+

2018-11-10 Thread Konstantin Shegunov
On Sat, Nov 10, 2018 at 12:23 AM Lisandro Damián Nicanor Pérez Meyer < perezme...@gmail.com> wrote: > > Pin debian testing repos with a low priority in the apt configuration and > > you can get the binaries from there. Current it 5.11.2. > > Only if you really know what you are doing. If you use K

Re: [Interest] Updated Debian packages or ppa for Qt 5.9+

2018-11-07 Thread Konstantin Shegunov
On Wed, Nov 7, 2018 at 9:59 AM Hamish Moffatt wrote: > Does anyone know of a repository for updated Qt packages for Debian > stable (stretch / 9)? > Pin debian testing repos with a low priority in the apt configuration and you can get the binaries from there. Current it 5.11.2. _

Re: [Interest] Qt API annoyances: where to log/discuss?

2018-10-30 Thread Konstantin Shegunov
On Tue, Oct 30, 2018 at 5:39 PM Jason H wrote: > I was wondering if there is a place to log annoyances/discuss with the Qt5 > API for fix in Qt6? > Probably a good idea is to submit a suggestion to the bugtracker as well. Two I am thinking of right now is: > - QUrl::port() returns an int, but Q

[Interest] SQL databases and threading

2018-10-11 Thread Konstantin Shegunov
Hello, Is there any way to tell (besides looking at the sources) if a given SQL plugin, or single methods of it, is reentrant/thread safe? The docs are rather evasive on the issue ... What would be allowed to do if I want to thread the SQL queries? Can I serialize the exec/prepare and then pull the

Re: [Interest] Qt Datetime display

2018-10-07 Thread Konstantin Shegunov
On Sun, Oct 7, 2018 at 12:42 PM Ramakanth Kesireddy wrote: > Is there any date time widget which would serve this purpose? > QDateTimeEdit will do. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest

Re: [Interest] Event inspection after delivery

2018-07-22 Thread Konstantin Shegunov
On Sun, Jul 22, 2018 at 7:08 PM, Sérgio Martins wrote: > > For statistics you probably want to use tracepoints [1]. [1] http://lists.qt-project.org/pipermail/development/ > 2017-February/028762.html > On Sun, Jul 22, 2018 at 8:13 PM, Giuseppe D'Angelo via Interest < interest@qt-project.org> wrot

Re: [Interest] Event inspection after delivery

2018-07-22 Thread Konstantin Shegunov
On Sun, Jul 22, 2018 at 6:54 PM, Thiago Macieira wrote: > > QCoreApplication::notify will help you for now, but that will not work in > Qt > 6. > Yes, I read the warning, that's why I posted here. My follow up question(s) would then be: How will the fine grained control that notify() gives be rep

Re: [Interest] Event inspection after delivery

2018-07-22 Thread Konstantin Shegunov
On Sun, Jul 22, 2018 at 6:36 PM, Thiago Macieira wrote: > > If you only need this for a particular class, Unfortunately no, not for a particular class. Ideally I'd use something like an event filter that'd be triggered after the event was delivered, but I'm not aware of any such functionality. D

[Interest] Event inspection after delivery

2018-07-22 Thread Konstantin Shegunov
Hello, Is there any way to inspect an event that was delivered, just after the fact? Looking at the source it seems the only way to do this is to have QObject::event or QCoreApplication::notify overridden, is that correct? I'm interested in QEvent::MetaCall specifically. I want to collect some sta

Re: [Interest] QDatastream, QMap, QImage serialization

2018-05-22 Thread Konstantin Shegunov
On Tue, May 22, 2018 at 4:22 PM, Thiago Macieira wrote: > On Tuesday, 22 May 2018 05:07:05 -03 Konstantin Shegunov wrote: > > Wouldn't it be the same from the point of view of a GUI application, when > > the platform plugins are already loaded? > > And fail for consol

  1   2   >