Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • [SOLVED] XCode 7 and Qt error

    11
    0 Votes
    11 Posts
    22k Views
    F
    @wozza Found the solution by myself by setting only the version for macosx to 10.11: QMAKE_MAC_SDK.macosx.version = 10.11
  • sub window shrinks on Linux when opened through main window.

    Solved linux click
    9
    0 Votes
    9 Posts
    3k Views
    SGaistS
    In the constructor or in the showEvent ?
  • [SOLVED] Asynchronous data loading for QFileSystemModel

    11
    0 Votes
    11 Posts
    5k Views
    SGaistS
    Sorry, I didn't saw my answer wasn't sent. Indeed, dataChanged will trigger GUI update which is not possible from thread other than the GUI thread.
  • QOpenGLWindow from QOpenGLWidget

    Unsolved qopenglwindow qopenglwidget
    3
    0 Votes
    3 Posts
    2k Views
    kshegunovK
    Hello, I know they don't inherit one another, that's why I'm asking if it's possible. :) I have a form with QOpenGLWidget laid out and want to use Qt3D, which does require a QWindow subclass for its painting routines. Now I was thinking maybe creating an attached QOpenGLWindow and sharing contexts but I'm not quite sure if this is the way. Anyway, createWindowsContainer is a possible solution, but I'd need to handle the layout insertion manually, this is why I'm asking. Kind regards.
  • QSerialPort reading using QByteArray

    Unsolved qserialport qbytearray read
    3
    0 Votes
    3 Posts
    2k Views
    K
    So does the QT appends '\0' terminator after every append? ( For QByteArray - No.
  • Unable to find or load the Qt platform plugin "windows" in a DLL

    Unsolved
    4
    0 Votes
    4 Posts
    6k Views
    R
    You might need to have the platform plugin folder in the same location as your application. Static linking alone doesn't change the plugin behavour.
  • Configured wifi connection save and retrieve from qfile in qt

    Unsolved wifi connection
    3
    0 Votes
    3 Posts
    1k Views
    SGaistS
    Hi, To add to @jsulm, please consider the security hole you might be creating with your application. Storing SSID's and passwords in plain text is a bad idea.
  • First Time Install and Build (Loaded project doesn't build)

    Solved
    12
    0 Votes
    12 Posts
    3k Views
    SGaistS
    If you installed Qt with the installer then you don't need to install the qt-creator nor qt-sdk packages. build-essentials and libgl1-mesa-dev should be enough.
  • QODBC and UTF-8 issues

    Solved qodbc utf-8
    7
    0 Votes
    7 Posts
    2k Views
    hskoglundH
    It's a bit undocumented you could say :-) To push your deciphering effort along I just uploaded a simple statistics program which uses those xxxUmlaut() functions to retrieve Swedish texts. It's compiled with Qt5.4/MSVC2013 but I just tried with Qt5.5.1/MinGW, works fine Sample program on Github
  • QAbstractSocket error signal not emitted

    Solved qabstractsocket error disconnected signal
    16
    0 Votes
    16 Posts
    12k Views
    B
    @Mark81 Sorry I have misled you, I was confusing the timeout on the wait...() functions with the asynchronous signals. You do not want the wait...() functions in the GUI thread as they block. The first thing to note is that normal TCP/IP will retry 12 times to send a data segment taking up to 9 minutes before it causes an error. I think you have two choices in the normal TCP/IP framework. If you are sending data and expecting a reply, you can start a single shot timer that is cancelled if the reply is received but causes your communications failed code to run when it times out. If you are just waiting for data then you will get no notification of errors as TCP/IP will wait forever on a disconnected circuit. So in this case you must have your server send you periodic "heartbeat" data to confirm its reachability.
  • Simple yet insurmountable PathView issue <3

    Unsolved
    2
    0 Votes
    2 Posts
    480 Views
    A
    Alright, I've implemented something like; while(pathviewModel.count < 3){ pathviewModel.append({art: item.art}) } But that seriously shouldn't be my only option. What hath QML wrought?!
  • 0 Votes
    3 Posts
    996 Views
    G
    More data implicating Windows: Starting Windows this morning took an extra 3 or more minutes because I had a dead mapped drive. GUI was blocked the whole time.
  • Split hex encoded string

    qstring qstringlist hex format regex
    2
    0 Votes
    2 Posts
    2k Views
    C
    You can use a regular expression in a loop: QString s = "806982"; QRegExp re("([\\da-fA-F]{2})"); // exactly 2 hex digits QStringList l; int pos = 0; while ((pos = re.indexIn(s, pos)) != -1) { l << re.cap(1); pos += re.matchedLength(); }
  • GDB using external server

    Unsolved
    1
    0 Votes
    1 Posts
    333 Views
    No one has replied
  • independent child QMainWindow with pyqt5

    Unsolved pyqt5 qmainwindow
    3
    0 Votes
    3 Posts
    4k Views
    S
    Hi, thanks! I call the child QMainWindow from the parent QMainWindow as follows: self.responseBox = responseBox(self) This is the code initializing the child QMainWindow: class responseBox(QMainWindow): def __init__(self, parent): QMainWindow.__init__(self, parent) self.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.CustomizeWindowHint | QtCore.Qt.WindowMinimizeButtonHint | QtCore.Qt.WindowMaximizeButtonHint) self.setWindowModality(Qt.NonModal) The full source code of the application is available online: https://github.com/sam81/pychoacoustics The child main window is created on line 834 here and the code initializing it is here I'll try to generate a small reproducible example and post it here as soon as I have time.
  • Insert QRect values inside qss stylesheet

    Unsolved
    1
    0 Votes
    1 Posts
    499 Views
    No one has replied
  • Qt Bluetooth receive file

    Unsolved
    1
    0 Votes
    1 Posts
    487 Views
    No one has replied
  • Timer instance connection delete

    Solved timer instance detection
    4
    0 Votes
    4 Posts
    1k Views
    McLionM
    Thank you guys. I see that it was wrong to create it on the heap. I moved the creation and made it a private member of the class. When called, I check it's initialization and proceed accordingly. Works a treat.
  • QML Binding with Dynamic Property of QList<QObject*> type

    Solved
    2
    0 Votes
    2 Posts
    2k Views
    DongD
    I found the problem why it cannot binding with QList<DynamicObject*> on this link even thought that DynamicObject is inherited from QObject* but Qml need the the model to be QList<Object*> and each item in the model is DynamicObject* instance. This is my complete Sample DynamicObject.h #ifndef DYNAMICOBJECT_H #define DYNAMICOBJECT_H #include <QObject> #include <QString> #include <QVariant> class DynamicObject : public QObject { Q_OBJECT public: DynamicObject(QObject *parent = 0); Q_INVOKABLE QVariant binding(const QString &propName) const; } DynamicObject.cpp #include "dynamicobject.h" DynamicObject::DynamicObject(QObject *parent) { } QVariant DynamicObject::binding(const QString &propName) const { QVariant result = this->property(propName.toStdString().c_str()); return result; } main.cpp int main(int argc, char *argv[]) { QApplication app(argc, argv); QQmlApplicationEngine engine; DatacontextController datacontextController ; DynamicObject* dynamicObject = datacontextController.ReadMetadataToDynamicObject(formMetadata); QQmlContext* ctx = engine.rootContext(); ctx->setContextObject(dynamicObject); engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec(); } main.qml ApplicationWindow { id:root visible: true width: 1024 height: 768 title: qsTr("Test Application") TableView { id: tblTableView anchors.fill: parent //parent: rowLayout1 Layout.fillWidth: true Layout.fillHeight: true TableViewColumn { id:colName title: "Name" width: 150 delegate: Text{ text: model.modelData.binding("Name") } model: binding("tableviewItemSource"); }
  • How to change a member of a struct in QList

    Solved
    6
    0 Votes
    6 Posts
    3k Views
    mrjjM
    @kahlenberg Well that happens to all of us :) Good it was something simple and not some nasty memory overrun some where else.