Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • QGroupBox size

    Unsolved
    3
    0 Votes
    3 Posts
    352 Views
    S
    Hi SGaist, Yes, I added QVBoxLayout because on top of QGroupBox I've some widgets and below a QTableWidget. But now I tried: tw->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); and seems to solve my problem very good.
  • Create samples of audio and play the audio.

    Unsolved
    4
    0 Votes
    4 Posts
    285 Views
    SGaistS
    So I think you are looking for QAudioSink::start.
  • 0 Votes
    5 Posts
    2k Views
    HowardHarknessH
    @JonB DOH! Thanks... :)
  • Two way Pushbutton issue

    Unsolved
    4
    0 Votes
    4 Posts
    371 Views
    JonBJ
    @Giakara That would be better! Remember that every signal can be connected to multiple slots, and vice versa. And (unless you specify otherwise in the connect() then default is) connecting even the same slot to the same signal does not get ignored and does not replace the connection, it adds a new connection, so you end up with the one signal calling multiple instances of the slot, which sounds like what you had. That's why doing connect()s basically only once at object initialisation time is advised.
  • Segfault when calling QWidget::show (on Debian 9)

    Solved
    49
    0 Votes
    49 Posts
    7k Views
    B
    @Christian-Ehrlicher said in Segfault when calling QWidget::show (on Debian 9): so is argc a local variable? If so then you have a dangling reference because Q(Core)Application takes a reference of argc and the documentation clearly states: Warning: The data referred to by argc and argv must stay valid for the entire lifetime of the QCoreApplication object. In addition, argc must be greater than zero and argv must contain at least one valid character string. Already told you this 13 days ago btw. Finally! Yesterday the issue got fixed! The problem was indeed what @Christian-Ehrlicher hinted at (for which thanks!): We have an mfInitialize function in which we create an object of type ICBlackBoxBaseApplication which subclasses QApplication and also takes argc by int& instead of by int. bool ICBlackBoxBase::mfInitialize(int argc, char **argv, QString& errormsg) { .... some stuff ... mpApplication = new ICBlackBoxBaseApplication(argc, argv, this); ... other stuff ... } and indeed, for as far as I understand this bug, once the mfInitialize function has returned, the ICBlackBoxBaseApplication thus has a dangling reference to the (meanwhile disappeared) argc variable, which was probably causing the segfault. Passing argc by reference instead of by value bool ICBlackBoxBase::mfInitialize(int& argc, char **argv, QString& errormsg) solved the problem. Again many thanks to all in this thread who helped me think about this issue and work towards a solution. Especially @Christian-Ehrlicher (although I had the impression he was sometimes annoyed by my questions ;-) Note also that it took me more than 13 days to solve this, because there was Christmas holidays in between ;-)
  • Timers cannot be started from another thread

    Solved
    4
    0 Votes
    4 Posts
    407 Views
    Christian EhrlicherC
    @KeithS Nice to hear. Can you please mark the topic as solved then? Thx.
  • Custom Signal/Slot connection is not working (Slot is not called)

    Solved
    3
    0 Votes
    3 Posts
    273 Views
    M
    @Christian-Ehrlicher Using the new syntax already seems to have solved the issue. Thank you!
  • Get datetime in my timezone

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    H
    @SGaist I am thinking about using an api - http://www.timeapi.io/
  • Filter QTableWidget with value of QLineEdit [HELP!]

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    L
    I think I know what the "problem" is. I don't see the value after being assigned (setFilterText), because of the print execution order(The print runs instantly, so I can't see the value of self.input_data after modifying it), although the value is assigned correctly. Thanks for your answers and for your patience!
  • QListWidget signal on display?

    Solved
    2
    0 Votes
    2 Posts
    176 Views
    Christian EhrlicherC
    Override showEvent() and emit one by yourself.
  • windeployqt reduce size of app

    Unsolved windeployqt
    2
    0 Votes
    2 Posts
    483 Views
    Christian EhrlicherC
    @NicolasR said in windeployqt reduce size of app: I would like to know, what args should I use to have the strict minimum ? There are none - windeployqt does not modify the needed dlls, it just copies them.
  • Eglfs and VNC parallel

    Unsolved
    4
    0 Votes
    4 Posts
    582 Views
    T
    I have searched the web now for many hours, but I could not find a solution to share my application via vnc. So, new idea: I implement libVncServer, grab my qmlView and implement vnc myself. The question is: Has anybody done this before? How can I access the qml-framebuffer?
  • How we can run Linux command from qt code?

    Unsolved
    21
    0 Votes
    21 Posts
    3k Views
    JonBJ
    @Wasee You must convert your (integer) variable to a string. QIODevice::write() accepts either a const char * or a const QByteArray & for the string to write. You can use either QString::number() or QByteArray::number() to convert a number to a string/byte array to pass to write(), as you please.
  • 0 Votes
    3 Posts
    342 Views
    M
    @J-Hilk said in How do I get the QOpenglWidget window to work properly with Windows 10 switched to sleep?: jokes aside, a topic title is not supposed to be the whole description of your issue. How about you elaborate a but more on your situation ? Sorry, I mean how can QT programs be set up to work all the time?
  • This topic is deleted!

    Unsolved
    6
    0 Votes
    6 Posts
    527 Views
  • What is the best practice to translate whole app?

    Unsolved
    2
    0 Votes
    2 Posts
    220 Views
    Christian EhrlicherC
    Use the Qt built-in solution: https://doc.qt.io/qt-5/linguist-overview.html
  • Upload a proyect

    Unsolved
    2
    0 Votes
    2 Posts
    260 Views
    Pl45m4P
    @Osvaldo-Luciani Update where? You could upload your project to github or something, if you want to share your code. This Qt Forum doesn't have a specific place to upload and share projects.
  • Writing file and opening file working on dev but not on release.

    Solved
    3
    0 Votes
    3 Posts
    267 Views
    N
    Thanks it's working :) QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); QFile file(path + "note.txt");
  • Get multiple data from QTextEdit Pyside2

    Unsolved
    4
    0 Votes
    4 Posts
    297 Views
    SGaistS
    You get a list from the split, therefore go through each element of said list.
  • Need help on QDialog behavior in Mac

    Unsolved
    2
    0 Votes
    2 Posts
    279 Views
    SGaistS
    Hi, @BikashRDas said in Need help on QDialog behavior in Mac: Note: Sorry, but I am unable to create a sample application for this problem. I will post if I could create one. I have a main window from which I am launching a QDialog. In QDialog, I have few tooltip enabled for child widgets. In that case, remove all the code unrelated to that dialog. In the dialog remove everything not related to the tooltip. With all that removed, you should have something close to a minimal example.