Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • What is the performance of QT Script in comparison with C ++?

    Unsolved
    3
    0 Votes
    3 Posts
    678 Views
    mrjjM
    Hi It will be slower. QT Script, interepented. c++ is compiled. Will it be slow ? Depends on what the user function is doing.
  • Reindexing items in Tablewidgets

    Unsolved qtcreator qtablewidget edit reindex
    4
    0 Votes
    4 Posts
    1k Views
    SGaistS
    Sure you can, loop through the content of the left QTableWidget and update the content of the right table to match. But again, you seem to overcomplicate things.
  • Qt 5.10 tries to compile my precompiled headers as C instead of C++, obviously fails

    Unsolved
    7
    0 Votes
    7 Posts
    3k Views
    ZueukZ
    @jsulm I just generated an empty Qt GUI project with precompiled headers using the current Visual Studio Tools, and it has exactly the same problem. By the way it did not compile in VS2017 at all - did not even give any error messages. Then I exported it to a .pro file # ---------------------------------------------------- # This file is generated by the Qt Visual Studio Tools. # ------------------------------------------------------ TEMPLATE = app TARGET = QtGuiApplication1 DESTDIR = ../x64/Debug QT += core widgets gui CONFIG += debug DEFINES += _UNICODE WIN64 QT_DLL QT_WIDGETS_LIB INCLUDEPATH += ./GeneratedFiles \ . \ ./GeneratedFiles/Debug PRECOMPILED_HEADER = stdafx.h DEPENDPATH += . MOC_DIR += ./GeneratedFiles/debug OBJECTS_DIR += debug UI_DIR += ./GeneratedFiles RCC_DIR += ./GeneratedFiles include(QtGuiApplication1.pri) and tried compiling in the Qt Creator: C:\Qt\Qt5.10.0\Tools\QtCreator\bin\jom.exe -f Makefile.Debug cl -c -Yc -Fpdebug\QtGuiApplication1_pch_c.pch -Fodebug\QtGuiApplication1_pch_c.obj -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zi -MDd -W3 -w44456 -w44457 -w44458 /Fddebug\QtGuiApplication1.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -D_UNICODE -DWIN64 -DQT_DLL -DQT_WIDGETS_LIB -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\QtGuiApplication1 -I. -I..\QtGuiApplication1\GeneratedFiles -I..\QtGuiApplication1 -I..\QtGuiApplication1\GeneratedFiles\Debug -IC:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include -IC:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtWidgets -IC:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtGui -IC:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtANGLE -IC:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtCore -IGeneratedFiles\debug -IGeneratedFiles -I\include -IC:\Qt\Qt5.10.0\5.10.0\msvc2017_64\mkspecs\win32-msvc -TC ..\QtGuiApplication1\stdafx.h stdafx.h C:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtCore/qnamespace.h(53): error C2143: syntax error: missing '{' before '*' C:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtCore/qnamespace.h(68): error C2061: syntax error: identifier 'Qt' C:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtCore/qnamespace.h(68): error C2059: syntax error: ';' C:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtCore/qnamespace.h(68): error C2449: found '{' at file scope (missing function header?) C:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtCore/qnamespace.h(1760): error C2059: syntax error: '}' C:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtCore/qnamespace.h(1793): error C2054: expected '(' to follow 'class' C:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtCore/qnamespace.h(1793): error C2085: 'QInternal': not in formal parameter list C:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtCore/qnamespace.h(1793): error C2143: syntax error: missing ';' before '{' C:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtCore/qsize.h(52): error C2054: expected '(' to follow 'class' C:\Qt\Qt5.10.0\5.10.0\msvc2017_64\include\QtCore/qsize.h(53): error C2085: 'QSize': not in formal parameter list etc, etc... I dont get these errors if I rename the "stdafx.h" file to "stdafx.hpp", but that doesn't seem to be a valid answer to the problem.
  • QTreeView click problem

    Unsolved
    2
    0 Votes
    2 Posts
    620 Views
    mrjjM
    Hi I think you can hookup to QAbstractItemModel::dataChanged and check the "checkbox" state there.
  • Most efficient way to approach lots of polygons in QML/C++?

    Unsolved
    5
    0 Votes
    5 Posts
    3k Views
    sierdzioS
    @j_omega said in Most efficient way to approach lots of polygons in QML/C++?: What are the big drawback to switching to QGraphicsView at this point? Well, the code rewriting might be a drawback of course :-) QGraphicsView is based on widgets, not QML so it will require changes in the UI code. It also lacks some QML features like shader support, graphical effects etc. But it offers a lot when it comes to fine tuning the performance, and excellent support for custom shapes. Perhaps a good idea would be to wrtie a small test project/ benchmark with QGraphicsView, it will allow you to compare ease of maintenance, performance etc. of both solutions. Also, going back to your original question: What design changes can I make to make this run smoother? Here are a few general ideas on how to (potentially... I recommend checking with some benchmark) improve the performance. Some may not apply to your app: make sure you only paint and keep in memory items which are visible on the screen - invisible parts of the map should be clipped use lazy initialization - only load part of the scene initially, then continue loading more items only if needed check out the QNanoPainter and other hints from the articles I linked before use caching - this is potentially the biggest gain. For example, only paint your QPolygons in a single item once and store the result in an image. Then, when QML engine wants to paint the item, provide the image from cache instead of recalculating and repainting the whole QPainterPath try to reuse components as much as possible - it looks like a lot of them are really similar so if the cache mentioned above can be shared between items, you could see even better results if you use SVG images anywhere - don't :-) Rendering SVG is very slow read through the official guidelines for QML performance http://doc.qt.io/qt-5/qtquick-performance.html don't use QML Shape components - they are great but slow :-) see if you can port some of the items to use shaders for example, so that they are painted by your GPU instead of CPU try to minimize the load on QML engine - less bindings, more C++ (than JS), less timers and animations
  • Capture the full output of QProcess (including its child processes)

    Unsolved
    4
    0 Votes
    4 Posts
    941 Views
    aha_1980A
    @billconan Then please mark this thread as solved. Thanks and Merry Christmas.
  • QStandardItemModel vs QAbstractItemModel

    Unsolved
    2
    0 Votes
    2 Posts
    3k Views
    Paul ColbyP
    Hi @ShinSat, This is just my own personal approach, but I'd say: if QStandardItemModel offers anything useful over QAbstractItemModel for your use case (sounds like it definitely would given that you want to use QTreeView), then I'd start with QStandardItemModel. In my experience, performance issues tend to be focused in specific small areas (eg in QStandardItemModel::data(), but you're unlikely to know where until you can do some real testing / benchmarking, and using QStandardItemModel should allow you to get there more quickly. So, let QStandardItemModel take of a lot of the basics, so you to get to the real project challenges quicker. You can (and should) then override anything in QStandardItemModel that causes performance issues for your use case later. Another way to look at is: Just because QStandardItemModel might impose some performance impact, in most cases the impact is much less than your own code would impose, unless you spend a lot of time optimising (just think how much effort has gone into Qt's own implementation). Yes, Qt's implementation might be more generic, but again, leaning on Qt's generic implementations can allow you to get straight to the core challenging cases for you to then optimise heavily for your own scenario(s), without wasting a lot of time reinventing stuff that might already be more than fast enough for you. Just my approach anyway. Good luck :)
  • QT and QT Quick graphic Backend

    Solved
    11
    0 Votes
    11 Posts
    3k Views
    AlienA
    Thank you so much for your help Best Regards,
  • Qt app with QML GUI shows only window frame after major Windows10 update

    Unsolved
    2
    0 Votes
    2 Posts
    644 Views
    R
    Temporarily solved by rolling back to windows 10 build 1703
  • Sqlite Driver not loaded

    Unsolved
    18
    0 Votes
    18 Posts
    8k Views
    SGaistS
    Are you modifying the LD_LIBRARY_PATH environment variable at some point ? Note that 5.7.1 is a bit outdated, you should consider updating to a more recent version since the current LTS is 5.9.3 and the current Qt version is 5.10.
  • CDB doesn't work

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    aha_1980A
    @Linkker Sorry, I cannot help you with that. But I remember having read that installing qtcreatorcdbext.dll with the offline installer didn't work as the installer did not contain the dll. However, installing with the online installer did work. So in the worst case, you could try to install Qt again with the online installer and select the dll right from the start.
  • How to open MainWindow from Dialog

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    sierdzioS
    MainWindow w; This constructs an entirely new MainWindow, puts it on the stack. Then 2 lines later the scope ends } and your main window is destroyed. You should rather pass a pointer to your actual MainWindow instance when creating the dialog, and then show it when pushButton2 is clicked.
  • QML SplineSeries fill area

    Unsolved
    2
    0 Votes
    2 Posts
    604 Views
    T
    @dhu0504 You may use area instead of spline series ....
  • Network buffer

    Unsolved
    2
    0 Votes
    2 Posts
    338 Views
    mrjjM
    Hi I dont think you can do that with Qt. Its the normally at the driver level for the actual frame. Can i ask what you try to program ?
  • QStringList : Can't access to member functions

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    L
    I know it because i can see it in a QTextEdit at the axecution that it is not sorted. "Message" contain the name and message comming from a client. The code that i have wrote is in the server code. This code take the name from the message and put it in a QStringList. Edit: You were right, i am a big idiot, the list is sorted i'm confused. Thank you for wasting your time on this !
  • Can't translate sub projects

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    SGaistS
    The CL problem is usually: Missing Visual Studio Wrong installation of Visual Studio i.e. C++ not selected on installation. Is either your case ?
  • QPerVertexColorMateral Qusetion

    Unsolved
    1
    1 Votes
    1 Posts
    269 Views
    No one has replied
  • QGraphicsTextItem - paint and html

    Solved
    5
    0 Votes
    5 Posts
    2k Views
    mrjjM
    @ziggx Super. I often suggest that sample if people want to make any kind of diagram editor as its a good start. Yeah, every now and then our local Qt Lord suggests some class i never saw before :) Merry Christmas and a glorious new year
  • QTreeView with QAbstractItemModel nested

    Unsolved
    1
    0 Votes
    1 Posts
    385 Views
    No one has replied
  • How can I catching SIGINT signal in mingw gdb?

    Unsolved
    8
    0 Votes
    8 Posts
    3k Views
    Paul ColbyP
    Hi @Tancen, handle SIGINT nostop pass works as you're expecting on Linux (using your code sample above), so this is likely Windows-specific. I don't currently have access to a Windows dev host, but I'd try not using qDebug. My hunch (and its little more than that at this stage), is that your handler is being invoked (have you tried setting a breakpoint on it?) you're just not seeing any output. As you can see in the GDB output, you have more than one thread being started (there's only one on Linux, so presumably Qt or Win32 is doing something extra on Windows). You have no control over which thread will end up executing the handler - that's based on race conditions, and is exactly the sort of thing that will be affected by executing the application different ways (eg via a debugger, in this case). It is quite possible (though still just speculation), that qDebug 's output (or lack of) is related to the thread its being executed on. So, I'd try replacing qDebug with a simple printf or std::cerr, and see if that shows anything. Good luck.