Category : qt5

is it possible to restrict the length in a QInputDialog::getText? For example, I want to restrict the length from the user input to 10 characters directly in the InputDialog. Unfortunately, there isn’t a function like QInputDialog::setMaximum. Here’s my current code: QString input = QInputDialog::getText(this, tr("Find"), tr("Enter text:"), QLineEdit::Normal, "", nullptr, Qt::WindowFlags(), Qt::ImhDialableCharactersOnly); if (input == ..

Read more

… QT_CHARTS_USE_NAMESPACE class Chart : public QChart { private: QSplineSeries *splineSeries; QTimer *timer; QValueAxis *m_axisX; QValueAxis *m_axisY; double x{}; double y{}; bool just{true}; public: explicit Chart(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = {}); }; Chart::Chart(QGraphicsItem *parent, Qt::WindowFlags wFlags) : QChart(QChart::ChartTypeCartesian, parent, wFlags) { this->splineSeries = new QSplineSeries(); this->m_axisX = new QValueAxis; this->m_axisY = new QValueAxis; ..

Read more

I wrote a basic C++ program for simulating the signal and slot process. I made a push button "button", a QVBoxLayout "layout". I added the button in the layout. Everything is fine till now. But when push button is made to connect by signal and slot, there’s are two problem/errors. "no instance of overloaded function ..

Read more

Currently, I am using the Ubuntu version of Linux and trying to build a project that uses the ZMQ library. I would like to implement cppzmq/libzmq to do this. For reference, here is how I installed both libzmq and cpp zmq (did both in the home directory): Install libzmq git clone https://github.com/zeromq/libzmq.git sudo apt-get update ..

Read more

I want to write data from another thread in txt file. Text files will be named currentTime() and created periodically every minute. So, Txt file made very well every minute using QTimer, but In Txt file, content is null. Of course this result is correct. Because i didn’t connect data from another Thread. How to ..

Read more

Hi, I’m trying to get QKeyEvents on keypress/keyrelease on linux embedded device(EGLFS) which uses custom keypad. /dev/input/event1 is the keyevent file. With evtest the output is as expected. But in the Qt application running on EGLFS platform, the eventfilter detects the event type as QEvent::SockAct whenever key is pressed/released on custom keypad. The expected event ..

Read more