qt4.8

Catch double click in QTableView's unused area

£可爱£侵袭症+ 提交于 2020-04-07 06:55:46
问题 My application starts with an empty table, and I want to imlement different methods to add items. One should be by double-clicking the table's unused area (or "background") that is not occupied by any cells. When a cell is double-clicked, I want the default behavior. I've found way to do this by re-implementing QAbstractScrollArea::mouseDoubleClickEvent() method in my TestTable class: #include <QMouseEvent> #include <QTableView> class TestTable : public QTableView { Q_OBJECT signals: void

Catch double click in QTableView's unused area

为君一笑 提交于 2020-04-07 06:55:33
问题 My application starts with an empty table, and I want to imlement different methods to add items. One should be by double-clicking the table's unused area (or "background") that is not occupied by any cells. When a cell is double-clicked, I want the default behavior. I've found way to do this by re-implementing QAbstractScrollArea::mouseDoubleClickEvent() method in my TestTable class: #include <QMouseEvent> #include <QTableView> class TestTable : public QTableView { Q_OBJECT signals: void

Dropping a file from outside an application into QTableView

☆樱花仙子☆ 提交于 2020-01-30 11:56:26
问题 I have a QTableView and I'd like to be able to drop an image file from outside the application onto a row and upon this event it needs to identify which row it was dropped on, do things with the file (copy to a directory, resize, add to db, ...) and finally update a column in the table that this item/row now has an image file associated to it. I've figured out that I can inherit from e.g. QTableView, re-implement dropEvent(QDropEvent*), I could then call QDropEvent::pos() inside the member

QDataStream uses sometimes 32 bit and sometimes 40 bit floats

前提是你 提交于 2020-01-15 11:13:09
问题 I am writing an application that is supposed to write an array of floats to a WAVE file. I am using a QDataStream for this, but this results in a very improbable output that I can't explain. It seems like the QDataStream sometimes chooses 32 bit floats and sometimes 40 bit floats. This messes up the entire output file, since it has to obey a strict format. My code roughly looks like this: float* array; unsigned int nSamples; void saveWAV(const QString& fileName) const { QFile outFile(fileName

Porting App from Qt 4.8 to Qt 5.3 getting “ DSO missing from command line”

偶尔善良 提交于 2020-01-05 09:34:43
问题 I built this project on qt 4.8 ubuntu 12.04(working) and now building it on qt 5.3 ubuntu 14.04 . I am getting following error while compiling error: mainwindow.o: undefined reference to symbol '_ZN12QtConcurrent16ThreadEngineBase16setProgressValueEi' error: error adding symbols: DSO missing from command line /usr/lib/x86_64-linux-gnu/libQtCore.so.4: .pro file QT += serialport QT += widgets QT += network QT += core ... ... LIBS += "/usr/lib/x86_64-linux-gnu/libqjson.so.0" no Idea what to do .

Porting App from Qt 4.8 to Qt 5.3 getting “ DSO missing from command line”

时光总嘲笑我的痴心妄想 提交于 2020-01-05 09:31:45
问题 I built this project on qt 4.8 ubuntu 12.04(working) and now building it on qt 5.3 ubuntu 14.04 . I am getting following error while compiling error: mainwindow.o: undefined reference to symbol '_ZN12QtConcurrent16ThreadEngineBase16setProgressValueEi' error: error adding symbols: DSO missing from command line /usr/lib/x86_64-linux-gnu/libQtCore.so.4: .pro file QT += serialport QT += widgets QT += network QT += core ... ... LIBS += "/usr/lib/x86_64-linux-gnu/libqjson.so.0" no Idea what to do .

Get the timestamp when a QInputEvent was put onto the queue of the QEventLoop in Qt 4.8

故事扮演 提交于 2019-12-31 05:40:23
问题 This question is closely related to QEventLoop: get time when an event was scheduled. Here I'm asking specifically about input events in contrast to "all kinds of events". I'm also interested in a solution for Qt 4.8. For QInputEvent in Qt 5 there is a timestamp() member method that can be used. In Qt 4.8 there is no such method. Are there any other approaches to get the timestamp when an input event was initially "emitted" by driver/deeper systems. Or when it was initially "received" by Qt

EXC_BAD_ACCESS (SIGSEGV) On OSX 10.9.2 With Qt Application

痴心易碎 提交于 2019-12-25 07:24:35
问题 I build OSX wallets for various cryptocurrencies and use QT 4.8.5 to build them. One of the users of my .app files recently sent me these error logs which appear when he tries to open any of the apps I built on his system. He did appear to be a one off case so I assumed something was wrong with his system but someone else posted another log citing the same issue. I cannot seem to pinpoint the issue. Any ideas on what's wrong? Process: FairCoin-Qt [42516] Path: /Users/USER/Downloads/FairCoin

Lock app orientation to landscape in Qt

梦想的初衷 提交于 2019-12-25 03:14:23
问题 I would like to lock my app developed with Qt to landscape orientation, even if the screen display is portrait. I have tried adding to my code the resizeEvent method found here: http://qt-project.org/doc/qt-4.8/widgets-orientation.html, but my app still does not display correctly. Here is my code for resizeEvent: void MainWindow::resizeEvent(QResizeEvent *event) { QSize size = event->size(); qDebug() << size; bool isLandscape = size.width() > size.height(); if (isLandscape == false){ size

QDockWidget tabify/splitDockWidget weird behavior / bug?

江枫思渺然 提交于 2019-12-24 03:13:02
问题 I have an application with MdiChilds which should contain multiple QDockWidgets. I am however having troubles splitting/tabbing up the Widgets so that they produce the desired default layout. I basically want a layout like this: Widget 4 is created last and needs to go next to the tabified widgets 2 & 3. However, inserting it causes itself and another widget to go missing: Here's the code producing the second screenshot: In the constructor of the main window (or the mdi childs, doesn't really