Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • How do I add a footer to a document?

    Unsolved qt5.15.2
    2
    0 Votes
    2 Posts
    260 Views
    JonBJ
    @AlexeyGolubev92 Google add a footer to a document (QTextDocument) provides many answers, including those in this forum.
  • Can't find C:\Qt\6.4.0\msvc2019_64\plugins\multimedia\*.*

    Unsolved
    3
    0 Votes
    3 Posts
    523 Views
    E
    @ChrisW67 Thank you very much, I had downloaded the 6.5.0 and and 6.4.0 but 6.4.2...I feel very stupid! Thank you for support!
  • Work with table

    Unsolved
    11
    0 Votes
    11 Posts
    896 Views
    V
    @mpergand Thank you again, using a mask allowed me to get rid of the need to validate user input
  • Using QStack, how to remove at specific location.

    Unsolved
    5
    0 Votes
    5 Posts
    372 Views
    Axel SpoerlA
    @SPlatten: I agree with @Christian-Ehrlicher - it looks scary to remove items from the middle of a stack. As you have correctly noticed, QStackis a thin wrapper around QList, which provides access to all its container functions. In your research about those, you were just one double click away from the answer to your actual question: qsizetypeis a signed version of size_t. using qsizetype = QIntegerForSizeof<std::size_t>::Signed;
  • how do I assing "virtual (serial port ) " - (while ) using QSerialPort - ?

    Unsolved
    9
    0 Votes
    9 Posts
    2k Views
    A
    @kuzulis The question was stated - hence ? at the end of the sentence - in the post title. Here is the answer https://unix.stackexchange.com/questions/128531/rfcomm-device-seems-to-be-missing-dev-rfcomm0 CLOSED
  • Check if a font is Serif / SansSerif

    Unsolved
    5
    0 Votes
    5 Posts
    412 Views
    R
    I'm a little late to this thread, but I need to do this, too, and I haven't found a way yet. Just a note that according to the help documents, QFontInfo only returns the style hint that was set in its font which was used to create it: QFont::StyleHint QFontInfo::styleHint() const ...etc. ... "Currently only returns the style hint set in QFont." So it is not really necessary to create a QFontInfo object from the font since this function seems to be just as useless as QFont::styleHint()is (to me, at any rate). I expect that there might be a way to get this information, at least from TrueType or OpenType fonts, by examining the font file itself. However, it looks like there is no API exposed by Qt to do this through the existing interfaces.
  • Does Qt allow the use of machine learning libararies?

    Unsolved
    6
    0 Votes
    6 Posts
    637 Views
    Christian EhrlicherC
    @HFT_developer said in Does Qt allow the use of machine learning libararies?: Is it okay to use machine learning algorithms in a GUI app(Qt/C++) I don't understand the question - we already told you that you can use any c++ library with Qt since Qt is c++..
  • Help - When i hover over a button it crashes the server.

    Unsolved
    8
    0 Votes
    8 Posts
    694 Views
    JonBJ
    @DZK11 Hovering over a QPushButton (or any QWidget) generates a number of QEventHover.../QHoverEvents. These are Qt events, not signals. You would know if you have subclassed to handle/generate such events or emit signals for them. Have you done so?? If not, it would seem unlikely that anything about "hovering" would cause a problem. Maybe your diagnosis is coincidence? The most important question is: does anything in your code try to communicate between client and server when you perform any such action in the client? If not, what do you imagine could possibly be going on? Qt is not going to do anything between client and server just because you move a mouse.... Indeed, it's not going to send/receive anything unless your code does so. So where/under what circumstances do you do any communication between these apps? If the server gets an unhandled exception what have you done about: @JonB said in Help - When i hover over a button it crashes the server.: If the server "crashes" have you run it under a debugger?
  • http request - resend after TCP failure

    Unsolved
    6
    0 Votes
    6 Posts
    462 Views
    JonBJ
    @Damian7546 Unless (a) you really intend to restart failed http requests on restarting your application at a later time, which seems odd to me, or (b) you have a large number of requests with large data content , why would you want to save to external storage, why not just keep the queue in session memory?
  • 3d data visualization, draw lines

    Unsolved
    2
    0 Votes
    2 Posts
    271 Views
    T
    @Loc888 About draw 3d line via 3d data visualization problem. it is long time, qt didn't do any improve on it.
  • QFrame versus QGroupBox

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    SavizS
    They are both a type of Widget. QFrame is simply a Widget that has a frame at the outer side as well as vertical and horizontal layout. You usually use this if you want to layout elements inside of it in either horizontal or vertical orientation with a nice frame at the outer parameter. QGroupBox on the other hand has a box layout as well as a title at the top. This widget is ideal for grouping a set of options (such as buttons, checkboxes, combo boxes) together in a professional matter. It also helps with providing a relationship between the elements that are placed inside of it. Here is an image of the GroupBox: (Not the best example, but should demonstrate it) [image: c4d8318c-7f3c-4eb2-b3ab-054cdfe45b21.png]
  • How to save any string in text file in Qt ?

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    SavizS
    If you are attempting to store your string data in a file, then you can probably look at this example: void save_to_file(QString filePath, QString data) { if(filePath.isEmpty()) { qDebug() << "File path is empty!" return; } QFile fileObject(filePath); if(!fileObject.open(QIODevice::WriteOnly)) { qDebug() << "Error! could not open file." return; } QTextStream stream(&fileObject); stream << data; fileObject.close(); } Hope this helps.
  • correct qt approach

    Unsolved
    3
    0 Votes
    3 Posts
    225 Views
    H
    Hi Pixmaps are small, 90x70 pxs, i don't need scroll or panning....seems i was choosing wrong..... Maybe is better to explain my goal so can propose me the best way. I want to draw the same video N times on the window and to have independent control on each one, imagine a 5x5 grid and in each cell i want to draw the video and each cell have independent playback from others.... The video content is the same for all cells, even the video is small size i don't want to create 25 objects of mediaplayer and load same file on each one.... So what i'm doing is to extract all the video frames to a vector of pixmaps and later share that vector among N classes where i use a qtimeline to control playback. That way i only load content to memory once and share that frames that i can control independent in each class. This point is clear. What im missing is what is the best approach to draw that content. Thank you
  • Style sheet property for QDial

    Solved
    2
    0 Votes
    2 Posts
    879 Views
    mrjjM
    Hi QDial is just a composite QWidget and does not really support style sheets directly. https://doc.qt.io/qt-6/stylesheet-reference.html However, you can style some elements using QWidget etc as selectors. Im not sure you can get the result you want without a custom QDial as seen here https://forum.qt.io/topic/62315/design-a-custom-dial
  • No Console Output To Terminal on Windows When Using CMake

    Unsolved
    4
    0 Votes
    4 Posts
    4k Views
    Christian EhrlicherC
    @KenAppleby-0 said in No Console Output To Terminal on Windows When Using CMake: So the answer seems to be to not have either WIN32 in the add_executable or WIN32_EXECUTABLE ON in the set_target_properties? Yes - as the documentation states WIN32 creates an application with WinMain() as entry point and therefore has no console.
  • Qt installer crashes, blue screen, windows 10

    Unsolved
    2
    0 Votes
    2 Posts
    266 Views
    C
    You want to install Qt 5.15 etc. but you have an installer for Qt 4.5.1. Qt 4 seriously predates Windows 10, so it is probably unsurprising that there may be issues. Try the current installer from qt.io or your commercial account if that is appropriate.
  • why? When creating a branch with git branch, it doesn't work.

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    C
    git branch dev creates a branch but does not switch your working copy to that branch. Follow up with one of git switch dev or git checkout dev. You can create a branch and switch your working copy in one action git checkout -b dev Edit: Actually @JKSH is closer to answering the particular issue.
  • How to delete a row of Tablewidget ? If Delete button has been added using code .

    Unsolved
    4
    0 Votes
    4 Posts
    353 Views
    JonBJ
    @micha_eleric Hide what, instead of delete? The OP is asking a common question about how to have a button against each row, to delete that row from the database, or similar functionality.
  • When I should do use the _p.h header file.

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    C
    The *_p.h files are the declaration of a private implementation, PIMPL, of the related class e.g., qlocale.h and qlocale_p.h. PIMPL is used for varied reasons, for example: Make maintaining binary compatibility across versions easier. So, for example, code written and linked against Qt 5.12 can use a Qt 5.15 library set even if the internal implementation of some classes is wildly different. Make implementation opaque, with only a public API header published with a binary library. Qt does both. Have a read here for example.
  • Unable to move ScrollBar to the top

    Solved
    11
    0 Votes
    11 Posts
    1k Views
    supergS
    @SGaist I changed the desing: Now QPushButtons are displayed in the QScrollArea, so the Button with the ssid and the other elements (The line to write a password, the button to connect to a network) are shown separately. With these simple changes, the code I wrote before works like a charm! True, It wasn't what I originally intended, but I realized that it's far better due to the circumstances where this app is going to be used. Thanks for your time and your help!