Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.3k Topics 455.9k Posts
  • This topic is deleted!

    Unsolved
    65
    0 Votes
    65 Posts
    230 Views
  • Layout problems with QtWidget::createWindowContainer

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    JKSHJ
    @Desperado17 said in Layout problems with QtWidget::createWindowContainer: The hello vulkan examples from qt work by the way but I cannot explain why as they do even less to enforce the layout. I can't see anything obviously wrong with your code. I suggest you copy the Hello Vulkan example code into your project, and then gradually integrating it into your existing widget and modifying it to fit what you want.
  • QWebEngine get response headers

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    KH-219DesignK
    I do not properly know the answer. However, reading this question piqued my curiosity, so I started down the path of trying to find an answer... I have to stop my inquiry for today, but here is where I got... There is a class inside namespace QtWebEngineCore named DevToolsFrontendQt, and this class seems to do some processing/handling of things of type HttpResponseHeaders. So, Qt webengine (which is based on Chromium) does seem to include some kind of DevTools UI. https://doc.qt.io/qt-5/qtwebengine-debugging.html#qt-webengine-developer-tools https://github.com/qt/qtwebengine/blob/cd12379d43/src/core/devtools_frontend_qt.h#L72 https://stackoverflow.com/questions/28681141/qtwebengine-debugging Technically, this "Dev Tools" presence arguably constitutes some kind of "yes" answer to "Is there any way to get response headers?" .... but probably not in the way you mean. If you only need to see the headers for debugging, then this could be acceptable. But I suspect you wish to intercept the headers programmatically as a built-in feature of your final application. If Qt has not yet exposed any end-user API for doing that in your application, then grepping the "qt/qtwebengine" source code for "HttpResponseHeaders" might suggest a way to hack into qtwebengine and make a custom build of it that exposes what you need. No doubt this would be a significant engineering effort.
  • Qt Event Loop

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    SGaistS
    Well, I would recommend timing all these stuff because at some point if you do not get faster you'll have bottlenecks anyway. You will likely need a queue from which you'll drop data it reaches a certain threshold.
  • Efficient way to display videos

    Unsolved
    7
    1 Votes
    7 Posts
    2k Views
    Y
    Hi. By QGrphicScene I meant using the following pseudo-code : self.graphics_view = QGraphicsView(self) self.scene = QGraphicsScene() self.graphics_view.setScene(self.scene) self.scene.drawBackground = self.draw_background then the method draw_background updates the image using QPainter.drawImage(QImage) after being called from self.scene.update(). I'm not sure what's happening in the background so I can't tell whether this is better or worse than my original implementation. It seems that the updated OpenGL Module supports using the QPainter. did anybody tried displaying OpenCV images ? any examples?
  • QTableWidget contextMenu crashing the application

    Solved
    3
    0 Votes
    3 Posts
    263 Views
    H
    @SGaist Yeah, I went to the documentation and I just solved the problem void MainWindow::popupMenuTableShow(const QPoint &pos) { QTableWidgetItem *item = ui->table->itemAt(pos); if(item != nullptr) { int i = item->row(); ... } ... } Still, thank you.
  • QSystemTrayIcon, change behavior

    Unsolved
    17
    0 Votes
    17 Posts
    1k Views
    H
    @SGaist I will try
  • C++ Qt BusyIndicator

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    mrjjM
    Hi does it have https://doc.qt.io/archives/qt-4.8/qmovie.html#details then its pretty easy to reuse an animated busy indicator [image: giphy.gif]
  • capture video screen

    Unsolved
    2
    0 Votes
    2 Posts
    199 Views
    mrjjM
    Hi there is nothing in Qt for this. You need to use native API to enumerate other running processes but it will be hard to block any app that can screen capture as you will need to know its .exe name.
  • QByteArray to QString with embedded escape sequence

    Solved
    9
    0 Votes
    9 Posts
    998 Views
    JKSHJ
    @Rory_1 said in QByteArray to QString with embedded escape sequence: this is in a worker thread.... While the QTextEdit solution was working in release mode, it would not run in debug mode. The QTextDocument solution solves this issue as well. The fact that it worked in Release mode was a fluke. Widgets cannot be used in worker threads, only in the GUI thread. QTextDocument, OTOH, is documented as reentrant so it can be safely used in a worker thread: https://doc.qt.io/qt-5/qtextdocument.html
  • QMainWindow : unable to position widget to extreme left

    Solved
    7
    0 Votes
    7 Posts
    866 Views
    Pl45m4P
    @Pl45m4 said in QMainWindow : unable to position widget to extreme left: Try setting setContentsMargins(0,top,right,bot) to your main layout. Then everything should move to the left by approx 11px. I already said it here :-) You must have missed it But good to hear that it worked :-) It seems quite tempting to use GridLayouts every time, but I would say in most cases cascading VBox and HBox layouts work better
  • Qchart background image tiled instead of stretched

    Solved
    3
    0 Votes
    3 Posts
    356 Views
    K
    Alright everyone, since I have so many interested parties looking and asking questions ;) I found a solution that I hate but works for me. I'll probably have to revisit it in the future but it does what I need for an upcoming demo. So the problem is somehow still with the code that is meant to draw a nice white border around the image. I believe that what the previous solution was trying to do was to keep the image from spilling over the sides of the graph, and generally just looking terrible. However since the image is already being sized for the graph via this line: spectrumFill = spectrumFill.scaled(QSize(chart_width*2.5, chart_height)); and set to paint in the top left corner via these lines: QPointF TopLeft = splineChart->plotArea().topLeft(); painter.drawImage(TopLeft, spectrumFill); I'm not sure it's necessary to do that. I guess it's possible that the rest of the image could default to some ugly color, but I'm not having that problem. The solution that I don't like is that my app will never run on a different sized device, at least not how it's been scoped so far. So I can hard-code the size of the image to be whatever I need and move on. I wasn't seeing dynamic resizing of the image depending on the size of the window anyway, so it looks like that would probably be more complex. I'm not going to look into it. So the last piece of code (these are out of order, if you're copying what I'm doing you'll have to look back at my first post in here) sets the image to the size I need, and I can move on. int chart_width = static_cast<int>(splineChart->plotArea().width()); int chart_height = static_cast<int>(splineChart->plotArea().height()); int view_width = static_cast<int>(splineChartView->width()); int view_height = static_cast<int>(splineChartView->height()); spectrumFill = spectrumFill.scaled(QSize(chart_width*2.5, chart_height)); And that does it for me. Good luck to anyone who sees this in the future, I hope you don't need dynamic resizing of your image! And thanks QT forum for listening, you're the best coding journal I've ever had. :D
  • 0 Votes
    8 Posts
    397 Views
    kshegunovK
    @IliasElk said in SIGSEGV in QCoreApplication destructor "QCoreApplicationPrivate::eventDispatcher->closingDown();". What can it be?: The SIGINT signal handler stopped responding after instantiating the QCoreApplication so it must be doing something to it no? Fetching and re-setting it resolved the issue for SIGINT. Well, I imagine it's something about the user code. Possibly the QueuedConnection call I spotted somewhere may be irresponsive. Regardless, if the QCoreApplication HAS to be in main in Mac OS, then it cannot be in a plugin where this cannot be guaranteed, that's a shame that QT precludes being used in plugins for non-QT hosts. That's a limitation of the platform. Nothing Qt can do about it. The main event loop integration is mandated to be in the main thread on macos.
  • Bluetooth Low Energy Scanner: Discover Service Details

    Solved ble bluetooth low e scanner
    9
    0 Votes
    9 Posts
    2k Views
    O
    i had same error in my project. this page helped me -> https://forum.qt.io/topic/117241/why-qlowenergyservice-unknownerror/2 i have changed my code from connect(controller, &QLowEnergyController::discoveryFinished, this, &Device::serviceScanDone); to connect(controller, &QLowEnergyController::discoveryFinished, this, &Device::serviceScanDone,Qt::QueuedConnection); and problem disappeared.
  • Downloading a file via http

    Solved
    8
    0 Votes
    8 Posts
    292 Views
    M
    Thanks for the replies. I guess that i was misunderstanding things. I just do all of the data processing in my onNetworkReply slot which fires off on a network request. Thank you for the explanations. Martyn
  • QMediaPlayer found in 5.9.7 but not found in 5.12.2

    Unsolved
    10
    0 Votes
    10 Posts
    809 Views
    jsulmJ
    @mehmety888 There should be more output
  • Audio mixer

    Unsolved
    6
    0 Votes
    6 Posts
    650 Views
    SGaistS
    Please, take the time to read the site properly. The library is Open Source and it's code is completely available. There's literally a link on the left side of the main page titled: Git Repo and just above it the Download section link.
  • Qt audio mixer

    Locked Unsolved
    3
    -1 Votes
    3 Posts
    774 Views
    SGaistS
    Closing this one as duplicate.
  • Strange behavior of mouse events or QCursor::setPos() does not work

    Unsolved
    3
    0 Votes
    3 Posts
    457 Views
    mrjbomM
    @Kent-Dorfman Even if I don't do it, I will face this problem.
  • One ItemModel with two different Item views which have different coloumn count

    Unsolved
    3
    0 Votes
    3 Posts
    131 Views
    mrjjM
    Hi https://doc.qt.io/qt-5/qtableview.html#setColumnHidden