Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • How to create dynamic drag and drop functionality

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    K
    @JonB Thank you
  • Background-image || Border-image not working

    Unsolved
    2
    0 Votes
    2 Posts
    240 Views
    JonBJ
    @QSourceCreator Are you absolutely sure that your built executable image contains the specified resource? You might verify by trying e.g. QPixmap pixmap(":/resources/BackGround.png"); and verifying !pixmap.isNull() at runtime in your code run on the other machine.
  • Qt designer shows svg in QLabel, but it's invisible.

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    JonBJ
    @Megamouse said in Qt designer shows svg in QLabel, but it's invisible.: I'm using a QSvgWidget in another dialog, and it works fine. If that too is using a QLabel and the SVG image is a resource, you can look at the ui_....h file generated from your .ui (Designer) file to see how that is done, and compare against your code. Everything from the .ui goes into that .h file, there is no other "magic". EDIT Oh, I see, you are saying a QSvgWidget does work, but a QLabel with an SVG for an image does not. My bad. Then I don't know.... Example at, say, https://forum.qt.io/topic/94244/adjust-an-svg-image-to-qlabel claims QLabel::setPixmap() on a QPixmap pix("imagelocation.svg") does show. Are you using QPixmap()? You need to. You might want to read the discussion in https://stackoverflow.com/questions/35129102/simple-way-to-display-svg-image-in-a-pyqt-window/35138314. Actually, although it's Qt 4.8, you look like you might be in the same situation as https://www.qtcentre.org/threads/48710-Qt-4-8-QLabel-not-showing-SVG-QButton-does, which is also worth reading.
  • QLPreviewView cannot display after insert to QStackedWidget

    Unsolved
    3
    0 Votes
    3 Posts
    276 Views
    C
    Seems to be an Apple OS widget: QL = Quick Look
  • Library to convert tar.gz format to .tar

    Unsolved
    2
    0 Votes
    2 Posts
    230 Views
    jsulmJ
    @Ayush-Gupta zlib library https://www.zlib.net/
  • unable to send data via QTcpSocket

    Unsolved
    15
    0 Votes
    15 Posts
    842 Views
    jsulmJ
    @Lightshadown Actually I suggested to use https://doc.qt.io/qt-5/qiodevice.html#bytesWritten signal instead of doing blocking calls to wait. But it is up to you.
  • How to mute QWebView or QWebPage

    Unsolved
    1
    0 Votes
    1 Posts
    94 Views
    No one has replied
  • Qt6 +python 3.9 QMainWindow + two QFrames split ratio

    Unsolved
    10
    0 Votes
    10 Posts
    794 Views
    Q
    was testing designer and i can replicate the issue... looks like its just a limitation maybe ? so basically i added 5 push buttons then set the layout to vertical.... starting the ui preview, the buttons stretch out... which is expected. then adding a dock on the left side of the window... changing the padding of X to 50 pushes the dock to the right in design mode as well as setting the width to 500 makes it larger... i cannot seem to change the padding on the push buttons.. however when starting the preview, the dock squishes back completely to the left without any padding.... I can then stretch it out with the mouse handle to the desired width and the pushbuttons adjust accordingly. similar behavior to my two frames issue. so my assumption is that this is how its suppose to work and I am not able to set the geometry to preset values and still be able to make it fluid once the app starts. the dock also fails on its own after removing the push buttons.... it reverts back to original values on launch cheers
  • Using Qt3D to visualise 2D data

    Unsolved
    1
    0 Votes
    1 Posts
    122 Views
    No one has replied
  • QVariant saving fails on second "consecutive" save

    Solved
    16
    0 Votes
    16 Posts
    997 Views
    M
    Just for the record, in case it may serve anyone: The problem was that, as reflected above, the data was stored as an int and thus, when loaded, the first access to it as as an int. I still have not found the specific point in my code (too long to see in such a short time) where the correct type was set to the variant (I reckon it will be in some access to it). In order to get rid of this problem, I had to define the << and >> operators for the affected types (Enums) and register them by means of: qRegisterMetaTypeStreamOperators<XSignal::_pinType>("XSignal::_pinType");
  • Changing Checkbox Label Based on Check State

    Solved
    8
    0 Votes
    8 Posts
    922 Views
    P
    I figured it out. I forget to set the sender message in my custom slot. Used @Pl45m4 first set of code. Thanks
  • How do you handle Zooming in QTableView/QTreeView?

    Unsolved
    14
    0 Votes
    14 Posts
    2k Views
    D
    @SGaist, hmm.
  • QOpenGLWidget is getting black intermittently

    Unsolved
    14
    0 Votes
    14 Posts
    1k Views
    SGaistS
    It should not. Since it does not happen in standard use, one way to find what might posing problem is to disable all the code that is not related to that widget. Once that is done, gradually add bad stuff until it breaks again.
  • cast void* to class-pointer

    Solved
    8
    0 Votes
    8 Posts
    2k Views
    T
    forget what I just wrote (stupid mistake). The forward declaration works fine. Thank you guys!
  • can't start class in class

    Solved qt5 2d graphics
    8
    0 Votes
    8 Posts
    1k Views
    M
    #include "krug_qt.h" Krug_qt::Krug_qt(QWidget *parent) { } Should be: Krug_qt::Krug_qt(QWidget *parent) : QWidget(parent)
  • How to replace some characters from selected text of QPlainTextEdit

    Solved
    18
    0 Votes
    18 Posts
    3k Views
    JonBJ
    @Emon-Haque I think you just do so from the vertical "..." at the right-hand side of the new answer you want to accept.
  • .dat Files

    Unsolved
    5
    0 Votes
    5 Posts
    736 Views
    JonBJ
    @WesLow said in .dat Files: My goal is to display each line of data on a QLabel First the file just looks like text. Maybe with tabs where there are multiple spaces, we don't know; what program were you using to view that file when you took the screenshot? So you just need to do what @J-Hilk says, nothing fancy. If that works, you will see a single multi-line QLabel (if that is what your ui->datText is). If you then want to do something about breaking it into "each line", I do not suggest you create and place a QLabel for each line. Unless it's just a learning exercise. A QListView might be a preferable widget to use. P.S. I had this code, but nothing happened. I suspect something did happen. But quickly...! ui->datText->setText(line); qApp->processEvents(); You should be left at the end with whatever the final line in the file is. I think you are expecting to see each line at a time running past, but with one qApp->processEvents(); per iteration I think it will happen much faster than your eye :)
  • Error configuring cross compilation

    Unsolved
    9
    0 Votes
    9 Posts
    806 Views
    Pablo J. RoginaP
    @IknowQT you keep posting and posting on the same topic. Please stop opening new threads.... https://forum.qt.io/topic/131426/qt-cross-compile-build https://forum.qt.io/topic/131394/raspberry-cross-compiler-setting-cannot-run-target-compiler https://forum.qt.io/topic/131382/build-qt-to-cross-compile-for-arm-tutorial
  • QHash, how to update value in map?

    Solved
    13
    0 Votes
    13 Posts
    2k Views
    KroMignonK
    @SPlatten said in QHash, how to update value in map?: don't apologise, this isn't what I am seeing in Qt Creator / Debugger. I am very surprised! I always do it like this (it.value() = newValue) and it is the way it is documented. Can you show how you have set the iterator? It is an iterator or const_iterator?
  • Creating RPA bots in Qt.

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