Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • QT C++ loading a mesh having multiple material

    Unsolved c++ 3d
    4
    0 Votes
    4 Posts
    711 Views
    GilboonetG
    [image: 52e549ed-712b-45d5-ba4e-ca5fd2460258.png] Now that it's ok, I'm wondering whether is is possible to directly use a QByteArray or anything else instead of a file as on my application I edit the model graphically and would like to be able to reflect any change I make to the unfolded 2D pattern to the 3D View. In fact write the file won't take long but it would be great to avoid it.
  • I can't display a png image in a label

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    beautifulcloudB
    @Abderrahmene_Rayene I think I'll stick with your absolute paths, I just wanted to know if it was obvious why the relative path didn't work. I got a project folder with my CMake, source, headers, qrc files then I got another folder into it named "assets" where the image background.png was stored and I didn't change the configuration above (despite I tested another methods) [image: 05c9da55-86bc-4803-b7b2-9de717a1386f.png] [image: 1701acda-07b2-44f5-8c7f-9766c6f48d93.png] However, thanks for help :)
  • Inactivity measurement and eventFilter() function.

    Solved
    2
    0 Votes
    2 Posts
    167 Views
    M
    @mrdebug Hi, You can install an event filter to QApplication directly.
  • How to get the effective icon size used in a QTreeView?

    Unsolved
    4
    0 Votes
    4 Posts
    723 Views
    M
    @tempus_fugit There's a protected method: [protected] int QTreeView::rowHeight(const QModelIndex &index) const
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • application is Not responding

    Unsolved
    14
    0 Votes
    14 Posts
    1k Views
    JonBJ
    @Gokul2002 In Python your Thread will be destroyed immediately after the t1.start(), when it exits thread(). Additionally, why are you trying to do a connect() in a thread? I can understand a slot needing to run in a thread, but not a connect() statement, that should complete immediately.
  • How to get Data from GUI into a thread?

    Unsolved
    13
    0 Votes
    13 Posts
    1k Views
    S
    I have stumbled on the same kind of problems over and over again. You can find a simple wrapper for this kind of multithreading on GitHub: https://github.com/SimonSchroeder/QtThreadHelper In your specific case you could just write it like this: workerThread([](const DataComingFromUI & data){ ... }, UIData); No need to write a full class or something. It is basically an extension of QThread::create which will avoid memory leaks. The only thing to consider is that a new thread is created whenever you want to execute this. With enough work inside the function the overhead of creating a thread is negligible. Because the GUI will not freeze you have to be careful that this cannot be started several times at once such that not too many threads are running at the same time. BTW, Qt also has QtConcurrent::run(). This uses a thread pool in the background (so, no oversubscribing of the CPU cores) and it makes it quite easy to run a function inside a thread as well.
  • QListWidgetItem setForeground does not work anymore

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    W
    @Christian-Ehrlicher Actually the problem is fixed. The anomaly between 5.12 and 5.15 was, that the default brush the tree-item returned, did not hold a solid brush. But I did not further investigate, what exactly it held, I simply set it. Schedule is tight - Thx anyway
  • Changing shape of point markers in QLineSeries

    Unsolved
    3
    0 Votes
    3 Posts
    647 Views
    PerdrixP
    @Gojir4 Hmm... Unless I have missed something setting a lightmarker applies to all points or to all selected points. Or does the setting stick after the points are deselected? If so that might be almost useable if very clumsy. There doesn't seem to be a way to set a different lightmarker (red square, blue circle, orange cross or whatever) on a per point basis. If it could be set using setPointConfiguration(index ...,) that might be helpful. But I can't see to how I might use it otherwise. D.
  • What's the optimal way to read QFile into a `vector<char> buffer`?

    Unsolved noob basic qfile
    2
    0 Votes
    2 Posts
    796 Views
    Christian EhrlicherC
    Use QFile::read(char* qint64).
  • How to get the signal after the QSplitter move finished

    Unsolved
    4
    0 Votes
    4 Posts
    487 Views
    Christian EhrlicherC
    @Hanson said in How to get the signal after the QSplitter move finished: But I found that it not trigger the mouseRelease event It does for sure - please show us your code.
  • Qt Widgets Error

    Unsolved qtwidgets qwidget qmainwindow
    6
    0 Votes
    6 Posts
    1k Views
    Pl45m4P
    @RudrakshS So you dont want to provide any more information? e.g. what layout, if any? move which widgets from where to where? how does the destination look like? empty widget or any other stuff in it? You dont have to apologize, but YOU have an issue with your code, not us :) If you dont show what you've done, one can only guess. If it is, what I think it is, then you are missing a layout somewhere or make any unallowed "moves".
  • Javascript debugger for QJSEngine

    Unsolved
    3
    0 Votes
    3 Posts
    706 Views
    D
    there is now a 3rd party solution for this issue: https://github.com/DavidXanatos/NeoScriptTools
  • update the data , not from the model

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    mzimmersM
    @JonB I'd like to pursue this a bit further. Though the OP didn't post any code, I suspect this will be relevant to his problem as well. I understand that the setData() implementation must emit dataChanged(), but...from where is setData() called? In my app, it's not getting called at all (judging from the telltales I put in my code). Yet, one of my models updates the QML just fine, and another one doesn't.
  • QComboBox selection makes computer crash

    Unsolved
    22
    3 Votes
    22 Posts
    4k Views
    M
    For a fix, see my comment: https://forum.qt.io/post/762082 The cause is a bug in mutter <= 42.5 under Wayland. Upgrade to proposed to get 42.9 which resolves the issue.
  • CSS styling richtext in QTextDocument

    Solved
    15
    0 Votes
    15 Posts
    4k Views
    R
    @Christian-Ehrlicher Thanks a lot Christian.
  • Can not get signal lastWindowClosed when not exec

    Unsolved
    9
    0 Votes
    9 Posts
    816 Views
    S
    @JonB said in Can not get signal lastWindowClosed when not exec: just what does await sleep(0); do? If it takes "no time" then your code will be busy running app.processEvents(); all the time, which is really bad. The comment states that this will switch over to the nodejs loop. But you are right that this approach will fully employ a single core non-stop. (Most people find that annoying or confusing.) A slightly better version (not sure if this works) is to write an async function that call app.exec() instead. There is a common trick to run a QTimer with a timeout of 0ms which will fire whenever the process is idle. The connected slot should be able to execute the await sleep(0);. As an improvement – in order not to hog a single core entirely – you could run the timer only every few milliseconds. One major problem with your approach or this approach is that the nodejs loop can block the Qt "event loop" for a long period of time. In certain circumstances this might make your app sluggish. @hongzhiyuan said in Can not get signal lastWindowClosed when not exec: It would be nice if this use case can be taken into consideration in the future. As a C++ programmer I honestly hope that this is not the future direction of Qt. I need a good C++ library. Unfortunately, Qt is one of the best libraries out there, but many concepts are a little outdated. I would rather hope that someone learns from Qt and write a new, better library for nodejs instead (I actually would hope the same for C++ as well). Sure, this is a huge amount of work initially. And this is most likely why nobody has done it yet.
  • xml to html conversion

    Unsolved
    4
    0 Votes
    4 Posts
    428 Views
    C
    @Rudresh said in xml to html conversion: QFile cssFile( "Report.xslt"); An Extensible Stylesheet Language Transformation (XSLT) is not a HTML Cascading Style Sheet (CSS). This is "not as it should be."
  • d3drm-dll not found

    Unsolved
    2
    0 Votes
    2 Posts
    244 Views
    jsulmJ
    @sherrywhatson Please provide more information! "From some days i am facing an error" - when doing what? What is example.dll and how is it related to the other missing dll?
  • how to run myfunction() when I close a window

    Unsolved
    4
    0 Votes
    4 Posts
    322 Views
    JonBJ
    @Bonnie Yes, I did not notice that was what the OP was asking about. Assuming that nothing like closeEvent() or installEventFilter() works I assume they need either to use purely non-Qt native code or perhaps Qt's nativeEventFilter()?