Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.8k Topics 458.5k Posts
  • QVarient outputting bogus data

    Unsolved
    11
    0 Votes
    11 Posts
    622 Views
    Christian EhrlicherC
    @SOrton said in QVarient outputting bogus data: int values[7] = {1,2,3,4}; //may not be these numbers but will be 4 single digit numbers. this is still wrong - there are only 4 numbers so it should be values[4]... And here the simple version of your code: values[4] = {1, 2, 3, 4} QString output; for (int val : values) output += QString::number(val) + ','; --> output = "1,2,3,4"
  • Custom MessageBox resizes when moving

    Solved
    4
    0 Votes
    4 Posts
    446 Views
    Chris KawaC
    @Dummie1138 said: All I want from this class is something that looks like a QMessageBox Then just use QMessageBox, e.g. QString title = "Friendly title"; QString text = "Password incorrect!"; QMessageBox box(QMessageBox::NoIcon, title, text, QMessageBox::Ok); box.findChild<QDialogButtonBox*>()->setCenterButtons(true); box.exec(); Btw. message box button placement in a QMessageBox conforms to platform guidelines. It's usually not a good idea to break them.
  • Qmenubar tittle issue

    Unsolved
    6
    0 Votes
    6 Posts
    429 Views
    Christian EhrlicherC
    Do you use some kind of css styling? A QMenu normally looks like this: https://doc.qt.io/qt-6/qmenu.html#details - yours looks strange.
  • How to know usb drive detected on qt ?

    Solved
    11
    0 Votes
    11 Posts
    3k Views
    Q
    @SGaist this script is doing auto mount of pendrive but unmount of pendrive not working. so i have decided to use mount and umount on triggering usb drive using ls -l /dev/sd* and then mount this device on media dir and then do umount on successful copy of file to pendrive
  • Passing a vector as function argument

    Solved
    4
    0 Votes
    4 Posts
    440 Views
    Kent-DorfmanK
    @SOrton said in Passing a vector as function argument: QVector<double> x(temp),y(temp); How can I place this into a functions paramater definition?: void MainWindow::plotGraph(int selectedIndex, QVector<double> x,y) Ok First thing. You need to create a "using" or "typedef" declaration for your container, as an alias when refering to the type later in your code using MY_VEC = QVector<double>; MY_VEC v1(27U); MY_VEC v2 = { 0.0, 1.0, 37.555 }; void someFunction(MY_VEC& v) { v.clear(); } someFunction(v2); Finally, don't put multiple variable declarations on the same line. It's considered bad form by most modern coding standards.
  • Qt Remote Objects' interoperation capabilities

    Unsolved
    1
    0 Votes
    1 Posts
    107 Views
    No one has replied
  • Questions about QToolbar/QToolButton

    Unsolved
    4
    0 Votes
    4 Posts
    623 Views
    D
    Hi, I worked it out :) I replaced QToolBar and subclassed QToolButton and now I have a toolbar, where you can reference a button by position and replace the action without changing attached shortcut. That works together with my variant of a statemachine. See github StateMachine with branch dynamic_toolbar
  • serialPort.read() is reading old data

    Unsolved
    15
    0 Votes
    15 Posts
    3k Views
    Christian EhrlicherC
    @Aeroplane123 said in serialPort.read() is reading old data: a buffer, how can I clear the buffer first and just put the received data into the buffer? If so how do I clear the buffer before reading? You can simply read all data after you opened the device but don't think this will solve your problem - you have to find the start of your data by yourself. You still want a dedicated protocol to clearly distinguish the single commands/data from each other.
  • Convert Qbytearray to QImage

    Moved Unsolved
    15
    0 Votes
    15 Posts
    2k Views
    Christian EhrlicherC
    Why do you hijack an old thread instead creating a new one with your specific problem. Also please provide some code on hwo you send and receive your data in the new thread.
  • In English - please - pairing Bluetooth QT style.

    Unsolved
    2
    0 Votes
    2 Posts
    420 Views
    C
    @AnneRanch said in In English - please - pairing Bluetooth QT style.: If you "pair " something - it HAS to involve TWO of whatever is being paired. Uh huh. As for this stream of consciousness: It appears the QT is setting "pairing status with address" I can accept "status WITH address " instead of "status OF address".... BUT 'local device is requesting pairing with what ??? am I wrong when I read "local device will pair with whatever remote device some other code discovered "? I can only guess that you complaining about something related to QBluetoothLocalDevice::requestPairing() This function will pair the local device, i.e. the Qt device, with the specific other Bluetooth device identified by the first argument. This is the two devices involved. Your local device may be able to see many other Bluetooth devices it may pair with. Unless you pair with them they remain just other devices. The btscanner example, that you so love to hate, clearly shows the difference: [image: c4c2e51e-b73e-4569-b463-254c535602ac.png] The phone is paired with my desktop machine. The JBL Flip 5 speaker is not. So, As of now my single local Bluetooth adapter is paired with ALL of mine remote Bluetooth devices. Either you are confusing visible devices with paired devices, or your code has actually paired with every device (by design or logic error).
  • How can i add new row to the existing Qtablewidget?

    Solved qtablewidget qmouseevent
    6
    0 Votes
    6 Posts
    22k Views
    U
    @mrjj How to add and delete rows in table by clicking spinbox up and down arrow? Please help me through python code.
  • "single left click " on the QListWidget "item" runs BOTH slots

    Unsolved
    2
    0 Votes
    2 Posts
    239 Views
    C
    The list issues both signals because both conditions have occurred (probably also issued currentItemChanged(), currentRowChanged() and itemClicked()). If you only want to act on one then only connect to one. The current item and the current selection are not the same thing in general. You can turn off/adjust tracking the selection with setSelectionMode()
  • Access Border

    Unsolved
    3
    0 Votes
    3 Posts
    345 Views
    Z
    Yes, you are completely right my QVBoxLayout that holds them is called MainLayout. But calling self.MainLayout.setSpacing(0) doesn't do anything. I am not sure if I understood the documentary correctly though, this might not be the right way to call this method. Anyways, i got it to work with the .setContentsMargin(0,0,0,0) method, for anyone who might have the same issue. Thanks a lot for the quick help!
  • Issue with Qt WinRT app on Qt 5.15.2

    Solved
    10
    0 Votes
    10 Posts
    710 Views
    Cobra91151C
    Hello! I have created my own tool called winrtdeploy to copy assets directory and the manifest file from Qt directory. winrtdeploy.exe --source=$$(QTDIR)/bin/assets --destination=$$shell_quote($$DESTDIR) --verbose Now, this issue is resolved. Thank you.
  • What does "got fallback qt version 0x50f02" mean ?

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    D
    i have the same problem. had same problem for over a year now just running in debugger Qt Creator 9.0.1
* Based on Qt 6.4.0 (Clang 13.0 (Apple), arm64) macOS Ventura on M1 see this bug
  • High DPI and QOpenGLWindow

    Unsolved
    1
    0 Votes
    1 Posts
    273 Views
    No one has replied
  • Layout problem

    Unsolved
    5
    0 Votes
    5 Posts
    381 Views
    M
    @SGaist Hard to understand, but ok I'll try to understand Thanks.
  • Create QLineEdit on QListWidget when double clicked

    Unsolved
    2
    0 Votes
    2 Posts
    262 Views
    SGaistS
    Hi, Two things that stand out: use the function pointer version of connect to use it with a lambda your lambda will just add an empty item to your list widget and leak a QLineEdit object every time you call it.
  • QML: Make multiple custom controls independent

    Unsolved
    1
    0 Votes
    1 Posts
    131 Views
    No one has replied
  • QMake list of all parameters, commands and variables in sources. Where to find?

    Unsolved
    4
    0 Votes
    4 Posts
    361 Views
    SGaistS
    Hi, If you want absolutely everything, the best is to read qmake's sources.