Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • QTextStream reading line by line works only once

    Solved
    3
    0 Votes
    3 Posts
    251 Views
    S
    Hi @JonB, I've realised, that I forgot to add something to my code, so it works now. Thanks for the help anyway.
  • Add QPushButton to QTableWidget cell without using QTableWidget::setCellWidget

    Unsolved
    14
    0 Votes
    14 Posts
    1k Views
    JonBJ
    @VRonin As he pleases, if he sees this (unless you want to refer him to that from there). He doesn't seem to want to change, and thinks other things are at fault too, so it's probably a losing battle...
  • Avoid dealing with QString::normalized when converting to and from std::string

    Solved
    5
    0 Votes
    5 Posts
    795 Views
    J
    ok, too bad. Thanks for your help
  • Language translation with hot keys...

    Unsolved
    3
    0 Votes
    3 Posts
    263 Views
    SPlattenS
    @Pablo-J-Rogina , of course, thank you.
  • After Changing location of projects. QT creator isn't starting in ubuntu

    Solved
    3
    0 Votes
    3 Posts
    251 Views
    HeerokNewbieH
    @jsulm I accidentally also changed the Qt folder location.But after changing the Qt folder location it crashed and my OS become disable to detect QT. but after reinstalling it my problem is solved. i installed it using terminal. sorry for my bad English.
  • Calling a lineEdit value from one form to another form

    Unsolved
    4
    0 Votes
    4 Posts
    359 Views
    JonBJ
    @LT-K101 said in Calling a lineEdit value from one form to another form: I declared it as a global variable and it worked. I know, but that is so not the way to do it! I don't begin to have the time to show & teach you what you should be doing, I'm afraid....
  • Avoid "Not Responding" when adding rows to QTableWidget

    Unsolved
    29
    0 Votes
    29 Posts
    4k Views
    H
    @JonB said in Avoid "Not Responding" when adding rows to QTableWidget: It sounds like your slowness is to with many widgets on a QTableWidget. Not only widgets, adding rows to database also causes slowness. To solve the slowness, having the unsolved delegate topics (Add widget right aligned to a QTableWidget cell and Add QPushButton to QTableWidget cell without using QTableWidget::setCellWidget) answered solves the problem since all I will have to do is to add rows to database in a thread. Right now longuitask solves the problem described in the OP, but @jeremy_k pointed out that it's not the ideal solution so I am trying to understand why he said that and trying out his sugestions.
  • Qt app on mac

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    T
    Edit: I solved it. Or better said, the problem is gone. I made the application executable by using pyinstaller. I used to just give the command my path to the application. However, my application runs in a virtual environment. Installing pyinstaller in said virtual environment and executing the command while still in the virtual env, the problem with the double-click was resolved.
  • Help with QTextstream splitting "lang=2"

    Moved Unsolved
    11
    0 Votes
    11 Posts
    763 Views
    Q
    @JonB said in Help with QTextstream splitting "lang=2": I have not tested, and you may say it does not apply to you because you will only ever have one line (in which case the whole overhead of using a QTextStream seems quite pointless to me), but what does your new code do now on a file like, say: var1=value1 var2=value2 MyTextStream is good for splitting a single text line only - it is the replacement for the unsafe sscanf -- you split the line and put values according their types. var1=value1 is a text line that could be split in two QStrings var and value1. but if you have var1=15.5 you can put 15.5 directly into the float var. QString qstr = "lang=2.23"; MyTextStream ss(&qstr, '=', ' '); QString lang; double kol_lang = 0; ss >> lang >> fixed >> kol_lang; QString qstr = "var1=value1"; MyTextStream ss(&qstr, '=', ' '); QString lang, qval; ss >> lang >> qval;
  • QFile write to specific line

    Unsolved
    6
    0 Votes
    6 Posts
    748 Views
    jsulmJ
    @Sucharek said in QFile write to specific line: what specific point? Specific position in the file where next read/write operation will work https://doc.qt.io/qt-5/qfiledevice.html#seek But, as @J-Hilk wrote, you will overwrite what is at this position, not insert. If you want to insert something you need to write the old content at the location where you're inserting after the inserted data.
  • how to draw a star ??

    Unsolved geometry 2d graphics qt4 qt5
    1
    0 Votes
    1 Posts
    802 Views
    No one has replied
  • With header QTreeView::mapToGlobal returns an unexpected value

    Solved
    4
    0 Votes
    4 Posts
    335 Views
    eyllanescE
    @jronald The positions of the mouseXEvent methods of the classes that inherit from QAbstractScrollArea such as QTreeView are relative to the viewport.
  • Build error solution error: qtbase/lib/libQt5Charts.so: No such file or directory

    Unsolved
    2
    0 Votes
    2 Posts
    179 Views
    jsulmJ
    @IknowQT You probably did not build QtCharts module.
  • Faster webview than webkitengine?

    Unsolved
    2
    0 Votes
    2 Posts
    199 Views
    SGaistS
    Hi, Depending on your needs the QLiteHtml playground project might be of interest.
  • QHash value result when key is not in hash

    Solved
    7
    0 Votes
    7 Posts
    579 Views
    jsulmJ
    @Publicnamer said in QHash value result when key is not in hash: If the hash contains no item with the key, the function inserts a default-constructed value into the hash with the key, and returns a reference to it. If the hash contains multiple items with the key, this function returns a reference to the most recently inserted value. This is from https://doc.qt.io/qt-5/qhash.html#operator-5b-5d NOT from https://doc.qt.io/qt-5/qhash.html#value-1 !
  • 0 Votes
    4 Posts
    273 Views
    JonBJ
    @Swati777999 qDebug() messages appear when your code is run. They go to the Application Output window, or I believe to somewhere funky and hard-to-get-at if you are running under Windows. Is that your situation? If you are talking about a message to be issued when compiling your code, you will need a "directive" understood by your compiler, like #warning "This is a warning" (GCC) in your code, and that would go to the Compile Output Windows.
  • Convert QWidget back to QLayout

    Solved
    5
    0 Votes
    5 Posts
    724 Views
    M
    @JonB yes, I have tried that previously. But there's some rows that i have to make it custom. But It Solved now with QGroupBox. Thanks for your answers again
  • QHash remove item while iterating?

    Solved
    2
    0 Votes
    2 Posts
    234 Views
    jsulmJ
    @Publicnamer It's all in the documentation: https://doc.qt.io/qt-5/qhash.html#erase
  • Return value of QHeaderView ::logicalIndexAt is not accurate

    Solved
    5
    0 Votes
    5 Posts
    360 Views
    jronaldJ
    I've found the cause of the problem, mouse position when clicking on a menu item is different from the mouse position when popping up the context menu.
  • How to use the new QtCreator for console input/output?

    Solved
    24
    0 Votes
    24 Posts
    23k Views
    jsulmJ
    @Swati777999 https://forum.qt.io/topic/131521/displaying-qstring-variable-in-application-output