Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Insert an URL by using QPainter and QPdfWriter

    Solved
    4
    0 Votes
    4 Posts
    484 Views
    O
    Solved! I managed it using a QTextDocument to store a Rich Text, then the painter::translate() and QTextDocument ::drawContents() methods to insert the content in my pdf file. [image: 51369088916_0637b67857_o_d.png] @artwaw The way to create a report by using html will be ok if I could add css style, but the subset embbedded in Qt is very poor. I was looking the option of using QWebEngine which allow you to create a web view with html and css files, but you need to compile it with MSVC and for some reason it doesn't work as well for me as MinGW. Thanks everyone!
  • Legacy code: why sleep before restarting a QThread that is already running?

    Solved
    4
    0 Votes
    4 Posts
    261 Views
    B
    @jsulm said in Legacy code: why sleep before restarting a QThread that is already running?: As far as I can see it simply waits for the thread to finish (if it is already running) before it is started again. Nothing fancy. Oh yes... I was actually wrong when I wrote that we only wait for 10 milliseconds before restarting the thread... I must've been stilll sleeping I guess ;-) I misread the 'while' for 'if'... so you are right, it simply waits for the thread to finish (if it is already running) before starting it again.
  • What is meta object code ?

    Solved
    2
    0 Votes
    2 Posts
    175 Views
    KroMignonK
    @Qt-embedded-developer Simply read documentation ==> https://doc.qt.io/qt-5/metaobjects.html
  • Dialog close called but not closing?

    Solved
    4
    0 Votes
    4 Posts
    509 Views
    mrjjM
    @SPlatten Well, they are mostly used when dialog is being shown modally. That is, you call exec() on it. Then accept/reject set the result and closes the dialog. It's to know if the user canceled or accepted the dialog. It's basically the same as calling https://doc.qt.io/qt-5/qdialog.html#setResult and then the close
  • TableWidget border, Hearder Size Fixed, etc...

    Unsolved
    2
    0 Votes
    2 Posts
    184 Views
    mrjjM
    Hi 1: It seems you just painted the border another color and set it size hence the gaps. From a plain TableWidget i don't get so huge gaps so check your stylesheet Normally the Table don't have any huge border so I think you set the border size yourself in the stylesheet to bigger than normally. [image: CjvObQ.png] No border ? [image: 4KNuAW.png] 2: QTableWidget{ background-color: rgb(255, 170, 0); } also colors that area for me ? 3: I think you can either allow dragging for all columns or none. You could make a custom header and check if you can disallow it from being dragged, say with mousePress function and check which section its over. 4: Well each item can be set if can be selected/edited etc but not seen for sections https://stackoverflow.com/questions/5421947/disable-selecting-row-or-column-by-clicking-the-header-in-qtablewidget 5: table->setSelectionBehavior(QAbstractItemView::SelectRows); If you mean JUST for that row, all else is selected by cells, then you have to hand code it so when clicking in any of the cells in the magic row, you slot select all other cell in same rw as the item clicked.
  • Qt window adds zoom animation for the first time the window will flicker

    Unsolved
    11
    0 Votes
    11 Posts
    772 Views
    J.HilkJ
    @Nan-Feng said in Qt window adds zoom animation for the first time the window will flicker: What may be the reason for this phenomenon? what version of Qt do you use? there was a bug, that when a stylesheet was set via Designer and changed via code at runtime, that changes were not applied correctly. :( To the flickering problem, have you tried, moving it way off screen ? ( a million pixels away e.g) show() it, and then moving it into position ? I remember a workaround, where I did it that way.
  • Code Signing

    Solved
    2
    0 Votes
    2 Posts
    222 Views
    O
    https://github.com/electron-userland/electron-builder/issues/4040 it's fixed by add entitlement file when code signing.
  • Updating/Inserting into table using QSqlTableModel

    Unsolved
    4
    0 Votes
    4 Posts
    374 Views
    A
    @JonB I should show just a table to user when importing products to store. So there should be product list that's just imported, not the list of whole products in the store. When the user presses "Import to store" button, If a product in the importing list is not in database, it should be inserted, otherwise it's amount should be updated to it's_amount_in_the_store + it's_amount_in_the_importing_list. I just tried to select product by it's barcode from database, using SELECT statement. Then I know if the product exists in db Sorry for my english, I couldn't describe my question clearly
  • QMap or QHash doesn't return proper value

    Solved
    9
    0 Votes
    9 Posts
    749 Views
    V
    Hi everyone, Thank you for the responses. It was a naive mistake on my side. I wrongly populated the _myDB. When I did _myDB.keys() and _myDB.contains(), I got nothing. After I correctly entered the data, the results are as expected.
  • Render transparent 2D image on mesh Qt3D

    Unsolved
    1
    0 Votes
    1 Posts
    298 Views
    No one has replied
  • Convert QGraphicsSceneDragDropEvent to QDragMoveEvent

    Unsolved
    6
    0 Votes
    6 Posts
    355 Views
    SGaistS
    See this post for the big picture..
  • With QProcess startet python script not working

    Solved qprocess
    10
    0 Votes
    10 Posts
    2k Views
    F
    @JonB Thanks. I like the QStandardPaths::StandardLocation but I did a deploy and after that I put just everythink in the folder with the *.exe file like @eyllanesc suggested and it works fine. I think my problem was that i missunderstood QProcess. I thought it is just a trigger to start the program and it is only important to know, where the path of the .py is. But thanks guys anyway :-)
  • Problems building mysql plugin on Windows for Qt 6.1.2

    Solved
    13
    0 Votes
    13 Posts
    657 Views
    M
    @SGaist Hi, i made a few tests real quick and i noticed that my Program Files folder always ask for permission before executing an action, maybe thats it. qt-cmake -G"Ninja" D:\Qt\6.1.2\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX="D:\Qt\6.1.2\msvc2019_64" -DMySQL_INCLUDE_DIR="C:\Program Files\MySQL\MySQL Server 8.0\include" -DMySQL_LIBRARY="C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" In the line above i use the mysql installation folder to specify include and lib paths.
  • QAxBase::setControl: requested control Excel.Application could not be instantiated

    Solved
    8
    0 Votes
    8 Posts
    2k Views
    JonBJ
    @duncan98 See the answer at https://forum.qt.io/topic/129216/why-export-excel-in-windows10-normal-in-windows7-export-will-crash/22 in your other on-going thread with the same question.
  • chrome OS ... never used tips

    Solved
    4
    0 Votes
    4 Posts
    311 Views
    gfxxG
    @all .... seems my ideas is not the best one ... agree with remote my workstation. real thanks Good holiday at all.
  • Deploying Qt 5.6 on Windows problem

    Solved deployment windows dll
    9
    0 Votes
    9 Posts
    11k Views
    J
    @tostrizek Here's my shell script for setup in git bash (mingw) #!/bin/bash # use " source ./setup.sh " to execute export PATH=/c/Qt/5.15.2/mingw81_64/bin:$PATH export PATH=/c/Qt/Tools/mingw810_64/bin:$PATH export PATH=/c/Qt/Tools/QtInstallerFramework/4.1/bin:$PATH
  • QCustomPlot fixed grid and subGrid lines

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    H
    Hi All, I haven't been able to figure out this either so far. There seems to be no option to reach the exact required value - the documentation states only 2 options which don't allow doing that, see: enum QCPAxisTicker::TickStepStrategy in : https://www.qcustomplot.com/documentation/classQCPAxisTicker.html Cheers, Jan
  • how to convert a .txt files in a folder to .csv files extension provided by the user

    Unsolved
    5
    0 Votes
    5 Posts
    303 Views
    jsulmJ
    @priya-a I didn't say you have a "debugging issue". I said you should run your app through debugger to see what your code does. This is first thing to do to find out what the problem is... Also, does list_files contain anything? What does QFile::copy return? And why do you remove suffix from the file you want to rename? How should renaming work then? QFile::copy will not find the file to rename as you changed its name...
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • QComboBox and smart pointer conflict?

    Unsolved combobox smart pointers exception
    9
    0 Votes
    9 Posts
    1k Views
    S
    @CJha said in QComboBox and smart pointer conflict?: But in any case I would like to make sure that it is destroyed before the application exits. In general this is a good approach. When you write clean code all resources should be freed by your own application (typically RAII in C++). However, when your application closes the OS will free all memory belonging to the application and removes all file handles of the application. Especially in complex applications it can take quite a while to clean up everything in order. In those cases it is a lot more userfriendly to just exit without the clean up. So, don't worry too much about clean up. Still, you should understand why this happens and how it can be avoided.