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 theme in pure qss

    qss
    1
    0 Votes
    1 Posts
    672 Views
    No one has replied
  • Getting Access Token from Google Cloud service account

    Solved
    5
    0 Votes
    5 Posts
    563 Views
    L
    It seems this code works fine: https://jorisvergeer.nl/2023/03/22/c-qt-openssl-jwt-minimalistic-implementation-to-create-a-signed-jtw-token/
  • Qt3d: Looking for resources about offscreen rendering & shadows

    Unsolved
    2
    0 Votes
    2 Posts
    217 Views
    K
    Hello! I totally relate to you. It would be very helpful if Qt3D supported Shadow Mapping (and Reflection). Immediately, all Scenes in Qt3D would be instantly realistic. It just looks as if Qt stopped Qt3D development half-way. If any of you have news on further Core-Implementations, let us know. Us and a big community. regards, kevin_d
  • SQLite plugin rebuild and modification with Qt6 and CMake. How?

    Unsolved
    3
    0 Votes
    3 Posts
    376 Views
    Christian EhrlicherC
    @bogong said in SQLite plugin rebuild and modification with Qt6 and CMake. How?: QtCommercial You should ask the Qt support. Manuals with examples for Windows building process mostly only small part for MacOS. There are examples for unix so use them. There is not much difference between unix and macos wrt this.
  • Real example of multithreaded QHttpServer?

    Solved
    2
    0 Votes
    2 Posts
    325 Views
    C
    This code: #include <QCoreApplication> #include <QTcpServer> #include <QHttpServer> #include <QtConcurrent> #include <QDebug> QHttpServerResponse handleRequest(int id) { qDebug() << "Start" << id << QThread::currentThread(); QThread::sleep(5); qDebug() << "Finish" << id; return QHttpServerResponse("response text\n"); } int main(int argc, char **argv) { QCoreApplication app(argc, argv); QHttpServer server; server.route("/", [] (int id) { return QtConcurrent::run(&handleRequest, id); }); auto tcpserver = new QTcpServer(qApp); if (!tcpserver->listen(QHostAddress::Any, 30000) || !server.bind(tcpserver)) { return -1; } qDebug() << "Listening on port" << tcpserver->serverPort(); return app.exec(); } Produces results like this: ./test Listening on port 30000 Start 0 QThreadPoolThread(0x5d512f61d580, name = "Thread (pooled)") Start 2 QThreadPoolThread(0x5d512f8b6400, name = "Thread (pooled)") Start 1 QThreadPoolThread(0x5d512f62ecb0, name = "Thread (pooled)") Start 4 QThreadPoolThread(0x5d512f630430, name = "Thread (pooled)") Start 3 QThreadPoolThread(0x5d512f8b6ce0, name = "Thread (pooled)") Finish 0 Finish 4 Finish 1 Finish 2 Finish 3 ^C when tested with: curl -o - http://localhost:30000/0 & curl -o - http://localhost:30000/1 & curl -o - http://localhost:30000/2 & curl -o - http://localhost:30000/3 & curl -o - http://localhost:30000/4 & Request processing is interleaved, multi-threaded. The size of the thread pool is limited so more requests will start waiting. Using curl --parallel changes the behaviour with respect to the first request curl sends.
  • SSL error when downloading files with url

    Unsolved
    9
    0 Votes
    9 Posts
    933 Views
    SGaistS
    Did you check that the dlls are found and loaded by your application ?
  • Qt Windows desktop: QMediaPlayer error code 0x80040218.

    Unsolved
    7
    0 Votes
    7 Posts
    3k Views
    W
    @SGaist @gulfoslides Hello, I also encountered this issue. And after I installed divx, the issue is still not resolved. Could you guys please help me with this? Thanks a lot!
  • Qt build folder has sub folders for debug and release

    Solved
    10
    1 Votes
    10 Posts
    2k Views
    SGaistS
    Hi and welcome to devnet, I think the comment I posted above is still valid.
  • Qt6.7 Compile Failed From Source In Windows11

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    0
    With a complete rebuild it finaly worked.
  • QTcpSocket accessable between different cpp files.

    Unsolved
    9
    0 Votes
    9 Posts
    965 Views
    N
    @JonB Thank you, could you provide a full example using the connect command?
  • OpenGl in QOpenGLWidget does not render texture on Qt6 while on Qt5 works fine

    Unsolved
    3
    0 Votes
    3 Posts
    311 Views
    SGaistS
    Hi and welcome to devnet, Did you find a solution since you deleted your posts ?
  • QFileDialog won't show up when QGraphicsScene::update() is called

    Unsolved
    6
    0 Votes
    6 Posts
    593 Views
    SGaistS
    QFileDialog is a native dialog so it might react a bit differently with regard to other widgets.
  • 0 Votes
    17 Posts
    2k Views
    Christian EhrlicherC
    @GrecKo said in Image gets de-pixalated or distorted (unclear) when we change the desktop display scale to 125%: That's what setDevicePixelRatio does. Did I said something else? I was (and still am) under the impression that he wants to draw with 1000x1000 ...
  • 0 Votes
    7 Posts
    725 Views
    M
    @SGaist Hello, have you had a chance to look at my last message?
  • Using Qt 5.2 on MacOSX 15.3 Sequoia - could not resolve platform name for SDK

    Solved
    6
    0 Votes
    6 Posts
    723 Views
    jsulmJ
    @cygnus23 OK, maybe there is no Qt5 because there are no ARM binaries available. You should be able to install Qt5 via offline installer.
  • [QImage/QSettings] rotate and restore a rotated image from stored data.

    Solved
    4
    0 Votes
    4 Posts
    467 Views
    ?
    I come back one last time to state that I have just been very distracted or stupid. Subsequently applying different rotation angles means adding to - or subtracting from the most recent accumulated value. END-OF-STORY. (Beats me). I do not need to store full-blown QTransform objects but can stick with my dearly loved int-values.
  • 0 Votes
    6 Posts
    692 Views
    J
    @ChrisW67 Thank you for your reply. In the end, I used QFrame instead of QWidget, and I was able to set the color of the space in the BoxLayout using the stylesheet.
  • qtvirtualkeyboard in QWidget App

    Unsolved
    2
    0 Votes
    2 Posts
    189 Views
    M
    the whole idea of integrating a Qt Virtual keyboard in a QWidget might be not a great one. I found QQuickWidget and QQuickView attempts which both deal with integrating qml code into your QWidget application. But I couldn't find a way to only use the qt virtual keyboard without rewriting the ui then. Well at this point i don't understand the documentation under: https://doc.qt.io/qt-5/qtvirtualkeyboard-index.html where it says: Supports both Qt Quick and Qt Widgets applications. How is that feature meant?
  • ¿Why is does not set the icon?

    Solved
    5
    0 Votes
    5 Posts
    410 Views
    I
    Ok so this was the cause of the problem incorrect handling of the bitmap data and improper configuration of the BITMAPINFO structure Heres is the correct code. QPixmap groups::extractPixmapFromExe(const QString &exePath) { QFileInfo fileInfo(exePath); QString fileName = fileInfo.fileName(); qDebug() << "Extracting icon from file: " << fileName; // Extract the icon from the executable HICON hIcon = ExtractIcon(NULL, exePath.toStdWString().c_str(), 0); if (hIcon == NULL) { qDebug() << "Failed to extract icon from" << exePath; return QPixmap(); // Return an empty pixmap if icon extraction fails } // Get icon information ICONINFO iconInfo; if (!GetIconInfo(hIcon, &iconInfo)) { qDebug() << "Failed to get icon info."; DestroyIcon(hIcon); return QPixmap(); } // Get the color bitmap information BITMAP bitmap; if (!GetObject(iconInfo.hbmColor, sizeof(bitmap), &bitmap)) { qDebug() << "Failed to get bitmap info."; DestroyIcon(hIcon); return QPixmap(); } // Create a device context for the bitmap HDC hdc = GetDC(NULL); HDC memDC = CreateCompatibleDC(hdc); HBITMAP hOldBitmap = (HBITMAP)SelectObject(memDC, iconInfo.hbmColor); // Prepare the BITMAPINFO structure BITMAPINFO bmi = {}; bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmi.bmiHeader.biWidth = bitmap.bmWidth; bmi.bmiHeader.biHeight = -bitmap.bmHeight; // Negative for top-down bitmap bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biBitCount = 32; bmi.bmiHeader.biCompression = BI_RGB; // Allocate a buffer for the bitmap data QByteArray buffer(bitmap.bmWidth * bitmap.bmHeight * 4, 0); // 32-bit ARGB format // Retrieve the bitmap data if (!GetDIBits(memDC, iconInfo.hbmColor, 0, bitmap.bmHeight, buffer.data(), &bmi, DIB_RGB_COLORS)) { qDebug() << "Failed to retrieve bitmap data."; SelectObject(memDC, hOldBitmap); DeleteDC(memDC); ReleaseDC(NULL, hdc); DestroyIcon(hIcon); return QPixmap(); } // Create a QImage from the bitmap data QImage img(reinterpret_cast<const uchar*>(buffer.constData()), bitmap.bmWidth, bitmap.bmHeight, QImage::Format_ARGB32); // Clean up resources SelectObject(memDC, hOldBitmap); DeleteDC(memDC); ReleaseDC(NULL, hdc); DestroyIcon(hIcon); // Convert the QImage to a QPixmap and return it return QPixmap::fromImage(img); }
  • 1 Votes
    13 Posts
    2k Views
    SGaistS
    @Lyubov-Gencheva hi and welcome to devnet, If there's no issue raised about this on the bug tracker, then I would say highly unlikely.