[Solved] Permanent Threads in QT

You should use Qt signaling mechanism. class QWindow : QMainWindow { //this macro is important for QMake to let the meta programming mechanism know //this class uses Qt signalling Q_OBJECT slots: void updateLabel(QString withWhat) … }; And now You just need to connect this slot to some signal class SomeThreadClass : QObject { Q_OBJECT … … Read more

[Solved] Which yocto is best for me

Morty, Jethro, Fido etc. are not different “yoctos”, but different releases given the timeline of the project. Generally, pick the most current that is available, as it is the most actively maintained one. (At the current moment in time, Rocko is the stable release) solved Which yocto is best for me

[Solved] what this code do [closed]

As Qt is a GUI framework, I don’t understand why you should have to convert that function (I mean that nothing in Qt is going to stop you from using that function as-is). Anyways: bytes_to_encode is a character pointer, so *bytes_to_encode will return the character pointed to by bytes_to_encode. bytes_to_encode++ will return the pointer and … Read more

[Solved] HighLighter Library Qt5/C++ for web languages

I would recommend looking into Kate Highlighting, which is also used for example by QtCreator. I vaguely remember hearing that the Kate and QtCreator developers were actually working on a Qt syntax highlighting library using this syntax definition files. Might be worth contacting the Kate developers 0 solved HighLighter Library Qt5/C++ for web languages

[Solved] The most accurate timer qt C++

Run a QTimer on a separate QThread which doesn’t do anything else. If you’re running the timer on an already busy thread the timeout events may not come on time or not at all. Make a worker class e.g. “PingPacketWorker”, implement a slot that does pinging. Make a QThread. Connect your QTimer and PingPacketWorker signal/slots. … Read more

[Solved] How to run gcc compiler from my qt application? [closed]

You can run any program from Qt5 and capture it’s standard output using the QProcess class. The official documentation with examples is here: http://doc.qt.io/qt-5/qprocess.html So what I would do then is simply make a GUI with 2 QTextEdit widgets, one for the code and one for the compile/run output. Documentation for QTextEdit is here: http://doc.qt.io/qt-5/qtextedit.html … Read more

[Solved] Window doesn’t appear when using while loop

Every widget constructor should never block the main message loop! The main message loop looks usually like this: int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w(nullptr); w.show(); int r = a.exec(); return r } In your case your MainWindow ctor never returns, so w.show() is never called and a.exec() (main messgae loop) … Read more

[Solved] How to override a signal in qt?

You cannot replace a signal with another signal in a subclass. You can, however, emit an additional signal with the original signal in a self-connected slot: class MyDimasCheckBox : public QCheckBox { Q_OBJECT public: MyDimasCheckBox(QWidget *parent =0); ~MyDimasCheckBox(); QString stroka; private slots: // Emits the new signal void doEmitStateChanged(int i); signals: void stateChanged(int, QString); }; … Read more

[Solved] how to stop the Qtimer upon a condition

Declare the QTimer as a member in you class h file: class Ball: public QObject, public QGraphicsRectItem{ { Q_OBJECT public: // constructor Ball(QGraphicsItem* parent=Q_NULLPTR); // control your timer void start(); void stop(); … private: QTimer * m_poTimer; } Initiate the timer object in your constractor cpp file: Ball::Ball(QGraphicsItem* parent) : QGraphicsItem(parent) { m_poTimer = new … Read more