Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • 0 Votes
    6 Posts
    690 Views
    W
    What problem are you running into? There are several existing X11 window managers that use Qt, so nothing in Qt should prevent it from working. Ultimately, a WM is just another X11 client like any other application. There's nothing inherently "special" about it. A "connection between X and Qt" would basically just be creation a QApplication object. That will create a connection to the X Display. QWindow can go to/frame a native window Handle: https://doc.qt.io/qt-5/qwindow.html#fromWinId You'll need something like that if you want to do things like reparenting windows from other processes
  • connect signal with slot in slot function

    Solved connection qmetaobject concurrent
    3
    0 Votes
    3 Posts
    486 Views
    M
    @jsulm Sorry, it's my fault. I write wrong parameters at lamda function :(;;;
  • C# waitone-like functionality?

    Solved
    5
    0 Votes
    5 Posts
    448 Views
    I
    @jsulm Thank you for your reply. Let's try it.
  • Custom graphics chart... use or avoid transforms?

    Unsolved
    3
    0 Votes
    3 Posts
    298 Views
    A
    I can relate to the points you raise regarding the use of transformations. Some years ago, I have written pretty much what you describe, but I was never happy with the complex code that resulted. It worked well, though, except for two issues which I couldn't find a solution for: Cosmetic pens of width != 1 paint super slow (I needed them to keep a constant line width while zooming). Here the solution would be, as you write, to calculate everything up front and paint in screen space, but the code was too progressed to make that change I used QGraphicsProxyWidget to integrate QScrollbars into my scene, which sometimes simply wouldn't repaint, no matter what I did (5.15.2, might have been fixed later) Now, I am involved in coding a similar component from scratch, using QML and SceneGraph. QML for layouting and custom QML components written in C++ for the heavy lifting. It seems to work rather well, but documentation and exacmples on SceneGraph are thin.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Static build application with QtHttpServer

    Unsolved
    3
    0 Votes
    3 Posts
    258 Views
    SGaistS
    @DungeonLords hi from the looks of the source tree you can use either qmake or cmake. The CMakeLists.txt is geared for Qt 6.
  • Environment issues: Runs in VS2022 but not outside

    Unsolved
    1
    0 Votes
    1 Posts
    139 Views
    No one has replied
  • Using WinRT/CPP with QT 6.x.x.

    Solved
    14
    0 Votes
    14 Posts
    3k Views
    A
    ok, got it working! Added "-lOLEAUT32" to win32:LIBS and added the following to the separate QThreads run function (whenever i used them) and the main function: winrt::uninit_apartment(); winrt::init_apartment(); So to condense all of this into one post (for those who are also trying to do what im doing): .pro: CONFIG += c++20 QMAKE_CXXFLAGS += /await:strict win32:LIBS += -lwindowsapp -lOLEAUT32 main.cpp: #include <winrt/base.h> int main(int argc, char *argv[]) { QApplication a(argc, argv); winrt::uninit_apartment(); winrt::init_apartment(); return a.exec(); } QThread derived classes: #include <winrt/base.h> class DerivedThread : public QThread { public: DerivedThread (QThread* parent = nullptr) : QThread(parent) {} public: void run(){ winrt::uninit_apartment(); winrt::init_apartment(); exec(); } }; Those alone should get everything up and running to be able to use functions (aside from specific things like things requiring other things [looking at you collections...]) Now to create some qobject classes and get test out actual inputs! Thank you all for your help! Oh! Almost forgot this tidbit, make sure your build tools/sdk's are up to date! EDIT: Looks like derived threads dont need to have the unint/init_appartment functions.
  • How to print hexadecimal value in Textedit Qt Widget

    Unsolved
    12
    0 Votes
    12 Posts
    3k Views
    jsulmJ
    @ananthavidhya There are examples in documentation: https://doc.qt.io/qt-5/qprocess.html Especially this one is what you need: QProcess gzip; gzip.start("gzip", QStringList() << "-c"); if (!gzip.waitForStarted()) return false; if (!gzip.waitForFinished()) return false; QByteArray result = gzip.readAll();
  • Where is Qt5QuickConfig.cmake ?

    Unsolved
    2
    0 Votes
    2 Posts
    3k Views
    kkoehneK
    @RobertB said in Where is Qt5QuickConfig.cmake ?: -nomake tools This looks suspicious. Some of the tools you will need when building Qt Quick. Can you try configuring without? Also, are you sure the compilation actually succeeded? You can try by checking the return value: make -j10 || echo "FAILURE"
  • Is it possible to detect compiled 'exe' dependencies? (Windows)

    Solved
    5
    0 Votes
    5 Posts
    373 Views
    C
    @jsulm Searching online I found this https://github.com/lucasg/Dependencies tool which supposed to be an updated version of the decencies walker. I managed to use cmd to output some of the dependencies my app needs. In CMD it prefixes the needed DLLS by category, for example it writes [WellKnownDlls] KERNEL32.dll : C:\WINDOWS\SysWOW64\kernel32.dll. So as far as I'm concerned none of the 'well known' DLL's should be copied. EDIT: I ended up making a python script that parses the output of this app and copies over files marked as [Not Found].
  • 0 Votes
    9 Posts
    390 Views
    Axel SpoerlA
    Can you please share your entire class definition / header file with us? Sorry for asking about this- we don't know what your thisactually is. Do you subclass QObject? Or QThread? Have you overridden virtual methods, e.g. QThread's run()? Have you added the debug statements I proposed and if so, what's their output?
  • How to display a specific pop-up window and then proceed with an internal procedure

    Solved
    9
    0 Votes
    9 Posts
    714 Views
    I
    @jsulm I'll give it a try.
  • How to connect a custom message lambda

    Unsolved
    17
    0 Votes
    17 Posts
    1k Views
    I
    @J-Hilk C:\Qt\5.15.2\msvc2019_64 That is all.
  • Show message

    Solved
    10
    0 Votes
    10 Posts
    733 Views
    J
    @mrjj thank you
  • QSettings

    Unsolved
    6
    0 Votes
    6 Posts
    477 Views
    jsulmJ
    @satyanarayana143 Did you try what I suggested?
  • MVC pattern with QGraphicsItem

    Solved
    6
    0 Votes
    6 Posts
    516 Views
    JonBJ
    @Desfell said in MVC pattern with QGraphicsItem: QGraphicsItem cannot emit signals :{ No but QGraphicsObject Class adds just that if it's what you are missing.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    11 Views
    No one has replied
  • QZipReader extractAll issue

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    Cobra91151C
    @Christian-Ehrlicher So, I have fixed it by adding this line: baseDir.mkpath(QFileInfo(absPath).absoluteDir().path()); Code: bool QZipReader::extractAll(const QString &destinationDir) const { QDir baseDir(destinationDir); if (!baseDir.exists()) { baseDir.mkpath(destinationDir); } const QVector<FileInfo> allFiles = fileInfoList(); for (FileInfo fi : allFiles) { const QString absPath = QDir::toNativeSeparators(QString("%1/%2").arg(destinationDir, fi.filePath)); baseDir.mkpath(QFileInfo(absPath).absoluteDir().path()); if (fi.isFile) { QFile f(absPath); if (!f.isOpen()) { f.open(QIODevice::WriteOnly); } f.write(fileData(fi.filePath)); f.setPermissions(fi.permissions); f.close(); } } return true; } Now, it creates all directories and extracts files. The issue is resolved. Thank you.
  • Qt Creator 7.0.1 - help system not working properly

    Unsolved
    1
    0 Votes
    1 Posts
    120 Views
    No one has replied