qt

Changing tab switch shortcuts in LiteIDE

If you’re using LiteIde for golang development you may see that shortcuts for tab change (Ctrl+Tab and Ctrl+Shift+Tab) can’t be changed via settings. For somebody (like me) it’s a big usability problem – I have Ctrl+PgUp and Ctrl+PgDown in all other applications. But small change of code and recompilation helps as allways :) --- a/liteidex/src/liteapp/editormanager.cpp +++ b/liteidex/src/liteapp/editormanager.cpp @@ -270,9 +270,9 @@ bool EditorManager::eventFilter(QObject *target, QEvent *event) if (event->type() == QEvent::KeyPress) { QKeyEvent *e = static_cast<QKeyEvent*>(event); if ( (e->modifiers() & Qt::CTRL) && - ( e->key() == Qt::Key_Tab || e->key() == Qt::Key_Backtab) ) { + ( e->key() == Qt::Key_PageUp || e->key() == Qt::Key_PageDown) ) { int index = m_editorTabWidget->tabBar()->currentIndex(); - if (e->key() == Qt::Key_Tab) { + if (e->key() == Qt::Key_PageDown) { index++; if (index >= m_editorTabWidget->tabBar()->count()) { index = 0; P.

QHash and QMap in threaded application

As you know QMap/QHash are little bit faster than std::map and std::unordered_map … but why? I have no ideas about this before I have used them in high-load muti-thread application. I send data in QHash via queued signal/slot between threads. Anything looks fine, but 1-2 times per day application gets segfault. It was very strange because it crashed after different count iterations but it was millions iterations. GDB shows something like this:

Qt meta-object system

What is is and why we need it? From the Qt documentation we know that “Qt’s meta-object system provides the signals and slots mechanism for inter-object communication, run-time type information, and the dynamic property system.” [1]. I hope everyone knows what is signal-slot in Qt and why you need Q_OBJECT macro at the beginning of each class declaration. Meta-object is also used for object casting using qobject_cast template function. It’s much more safe then build-in C++ cast functions and often is much faster.