Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Printing: letter "o" missing

    Unsolved
    3
    0 Votes
    3 Posts
    319 Views
    PsnarfP
    It is not a language issue because it prints the umlauts. I do not understand what you mean by "printing the content of this one window". It could be printing the content correctly. If you step with debug, do the variables in the debug window match the correct text? Where does "Forderungen" change into "Fxorderungen"? The placeholder is not a space. 'o' is ascii 111, 0x6F. What is the ascii code for the placeholder? Is it related to 0x6F by flipping a bit? 0x04F='O', 0x02F='/', 0x0F=Shift-In, which might be printed as a place-holder. Obquote: "More information!" - Number 5, Short Circuit.
  • Remove spaces the from QString

    Solved
    7
    0 Votes
    7 Posts
    3k Views
    JonBJ
    @Sucharek said in Remove spaces the from QString: I've been trying to remove the first space from a QString variable. The quickest (short and reasonably performant) code to do just this is something like: if (word.startsWith(' ')) word.remove(0, 1); QString::simplified() does quite a bit more than "remove the first space". Up to you. If you have given up on moving a QString over to a std::string, and then back again, to do your work, that is good.
  • Zooming functionalities for whole qopenglwidget window

    Unsolved
    2
    0 Votes
    2 Posts
    255 Views
    JoeCFDJ
    http://goldsequence.blogspot.com/2016/04/how-to-zoom-in-in-opengl-qt.html
  • QTChart draws line from first to last point

    Solved
    5
    0 Votes
    5 Posts
    427 Views
    J
    @KroMignon Thanks for reply, i don't really need another thread from the main thread, i'm just asking my self how QT manage all QTIMER when we use many of theme if they have all fast interval ! and maybe in my case if i have one thread manage to refresh data and another that refresh graphic, maybe that will let all the QT APP work well ! again thanks for your help
  • 0 Votes
    5 Posts
    1k Views
    M
    @J-Hilk thanks for your comment. I put that to read continuously from the buffer, but of course it is not necessary as soon as the signal/slot mechansim works.
  • Problem with QT and CAN (QCanBus and friends)

    Unsolved
    10
    0 Votes
    10 Posts
    3k Views
    J.HilkJ
    @JohannesV oh my goodness, no its not working, because you're not running an event loop in your QThread of course slots aren't executed. QCanBusDevice has signals for void errorOccurred(QCanBusDevice::CanBusError) void framesReceived() void framesWritten(qint64 framesCount) so forcing synchronous behaviour on it to then move it to a thread to get a responsive remaining application is (far from) not ideal. It is true, that overwriting QThread::run is not necessarily wrong, in this case it is. Please revisit QThreads, do you want/need helpful links ? 😅
  • Use Json data in Qt in Windows

    Solved
    24
    0 Votes
    24 Posts
    3k Views
    Negar_mgN
    I finally succeeded,The code I wrote is as follows: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); m_serialPort=new QSerialPort; m_serialPort->setPortName("COM3"); m_serialPort->open(QIODevice::ReadWrite); m_serialPort->setBaudRate(QSerialPort::Baud9600); m_serialPort->setDataBits(QSerialPort::Data8); m_serialPort->setParity(QSerialPort::NoParity); m_serialPort->setStopBits(QSerialPort::OneStop); m_serialPort->setFlowControl(QSerialPort::NoFlowControl); while(!m_serialPort->isOpen()) m_serialPort->open(QIODevice::ReadWrite); connect(m_serialPort, &QSerialPort::readyRead, this, &MainWindow::handleReadyRead); connect(&m_timer, &QTimer::timeout, this, &MainWindow::handleTimeout); m_timer.start(5000); } void MainWindow::handleReadyRead() { m_readData.append(m_serialPort->readAll()); if (!m_timer.isActive()) m_timer.start(5000); } void MainWindow::handleTimeout() { if (m_readData.isEmpty()) { qDebug()<< "m_readData is empty" <<m_readData; } else { qDebug()<< "m_readData is full" <<m_readData; QJsonDocument jsonDoc = QJsonDocument::fromJson(m_readData); QJsonObject jsonObj = jsonDoc.object(); QJsonValue jsonVal; jsonVal = jsonObj.value(QString("Bat_Temp")); QTextStream textStream(stdout); textStream << QString::number(jsonVal.toInt()) << endl; }
  • Building QT 5.12.11 LTS to run on both CentOS7 and CentOS8

    Unsolved
    5
    0 Votes
    5 Posts
    449 Views
    Q
    ... trying upload of smaller size for my previous post. [image: 85d0a9a9-d1d6-4ca4-93f5-7735c39fab44.jpg]
  • Insert/Overwrite keyboard shortcut in QtCreator

    keyboard mappin
    4
    1 Votes
    4 Posts
    3k Views
    B
    I think MikePelton is long gone but nevertheless I would like to thank him for his contribution. I was caught out by this today. I always use the 'INS' on the numeric pad to toggle insert/overstrike - in other editors at least - so was a bit baffled as to how to get back to insert mode. As noted by Mike, the separate INSERT key does work.
  • Can't compile my dynamic lib if I include OpenGL on windows 10 but can on ubuntu

    Unsolved
    1
    0 Votes
    1 Posts
    210 Views
    No one has replied
  • How to replace the event handler used in c# in qt?

    Solved
    2
    0 Votes
    2 Posts
    358 Views
    JonBJ
    @LISP Basically declare a Qt signals: ... for a C# event, declare a Qt slots: ... for a slot, and use Qt connect() to connect instances of the signal & slot objects. This appends the connection to any existing connections on the signalling object, just like C#'s +=.
  • QAxWidget does not open Word inside the widget

    Unsolved
    1
    0 Votes
    1 Posts
    267 Views
    No one has replied
  • Dev Setup For Windows CE

    Unsolved
    2
    0 Votes
    2 Posts
    226 Views
    JKSHJ
    @RahibeMeryem said in Dev Setup For Windows CE: I didnt see any information (my bad) for wndows CE qt 6. Support for Windows CE was dropped in Qt 5.0. 3rd party consultants might be able to help you set up an old version of Qt 5: https://www.qt.io/blog/2013/07/30/the-state-of-wince-support-in-qt5 However, there is no way to run Qt 6 on Windows CE. Qt 6 requires a C++17 compiler, while Windows CE is only supported by Visual Studio 2008 or earlier. (Even newer versions of Qt 5 won't work, since they require C++11)
  • qt qprinter new page

    Unsolved
    5
    0 Votes
    5 Posts
    797 Views
    artwawA
    Hi, out of curiosity: I see you commented out using QTextDocument with HTML content - was QTextDocument not handling your data properly? Asking since from my experience QTextDocument handles paging much better and automatically than anything else and getting the print out is just one command.
  • Help debugging translation failure

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    sierdzioS
    @ghutchis said in Help debugging translation failure: Do the .qm files depend on the Qt version that generate them? Like if I generate them on Ubuntu GitHub actions, can I use them on a Mac or Windows system? No, the are usually compatible with a very wide range of Qt versions. But as I mentioned in my comment - bugs happen :-)
  • qt word ColorIndex

    Unsolved
    1
    0 Votes
    1 Posts
    158 Views
    No one has replied
  • How to write msword with qt?

    Solved
    2
    0 Votes
    2 Posts
    194 Views
    Pl45m4P
    @IknowQT You can use QAxObject to access the activeX component of MSWord and do something with your file. There are some QAX examples out there how to work with Excel or Word files. https://doc.qt.io/qt-5/qaxobject.html
  • Unable to draw this kind of tabwidget in .ui?

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    A
    @mrjj @JoeCFD Thank you
  • QToolButton not receiving ToolTip events

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    G
    For now, I'm just fudging it - I installed an event filter for QEvent::Enter: Not great, but it works: if (event->type() == QEvent::Enter) { QWidget* target = qobject_cast<QWidget*>(object); QEnterEvent* ee = dynamic_cast<QEnterEvent*>(event); if (target && ee) { QToolTip::showText(ee->globalPos(), target->toolTip(), target); return true; } } return false;
  • 0 Votes
    5 Posts
    3k Views
    SGaistS
    That repo might help you.