qt4

Qt/win: showMaximized() overlapping taskbar on a frameless window

与世无争的帅哥 提交于 2019-12-10 13:25:26
问题 I'm building an application that has its own custom chrome. I have turned the default window border off by setting the flag: this->setWindowFlags(Qt::FramelessWindowHint); After this flag is set and the default window border is turned off, any calls to: this->showMaximized(); result in a window that takes up the entire screen, overlapping the task bar. Is there a common work around for this or another method I should be calling instead of showMaximized()? Win7/Qt4.6 回答1: If you inherit from

MenuBar issue QT 4.7.4 on MAC OS LION

こ雲淡風輕ζ 提交于 2019-12-10 13:17:21
问题 I'm new to QT programming. I want to create a simple menubar with two menus , and several actions (3 actions for FILE menu and one action for VIEW menu).I have createMenus() method where i create those menus and actions then I add created menus to menubar ,but when i run the app , it's not showing this menubar , and i dont know why. Can anyone tell what the problem is ? Source code of MainWindow.cpp #include <QtGui> #include <QAction> #include "MainWindow.h" MainWindow::MainWindow() { //

In ScrollHandDrag mode of QGraphicsView, How to stop movement of QGraphicsItems on scene?

无人久伴 提交于 2019-12-10 12:58:53
问题 I have multiple QGraphicsItem s in scene spread across different parts of scene. In application there are different modes in one of mode user can scroll the scene (palm drag mode). To achieve scrolling over scene I set dragMode of QGraphicsView to ScrollHandDrag . But the problem is when user try to scroll over scene by dragging ( MousePress and MouseMove ) on any of QGraphicsItem instead of scrolling scene it moves QGraphicsItem . How can I stop movement of QGraphicsItem and scroll the scene

Qt's best way to display very large rich text?

浪尽此生 提交于 2019-12-10 12:58:51
问题 I need to display very large logs that uses HTML tags for marking different types of data. Using QTextEdit and QTextBrowser really slows the application, especially on append operations. I would really like to keep the QTextEdit interface and abilities. I've seen people that implemented their own flavor of TextEdit to improve performance, but I wandered if anyone solved this issue using "Qt" tools. I thought about using the Model/View framework to load data on demand but it is not quite what

How to specify auto-generated resource files to Qmake?

本秂侑毒 提交于 2019-12-10 12:52:12
问题 I have a Qt project with a german translation, Translation_de.ts , which is automatically compiled into Translation_de.qm via Qmake: TRANSLATIONS += Translation_de.ts ... QMAKE_EXTRA_COMPILERS += lrelease lrelease.input = TRANSLATIONS lrelease.output = ${QMAKE_FILE_BASE}.qm lrelease.commands = $$[QT_INSTALL_BINS]/lrelease ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_BASE}.qm lrelease.CONFIG += no_link target_predeps The generated Translation_de.qm is then compiled into the final application as a

QTableView selectionChanged

扶醉桌前 提交于 2019-12-10 12:46:24
问题 I have a QTableView that I need to get the selectionChanged event from. I can't seem to get the connect working. I have: MyWidget.h ... protected slots: void slotLoadTransaction(const QItemSelection & selected, const QItemSelection & deselected); private: QTableView table; ... MyWidget.cpp ... connect( table->selectionModel(), SIGNAL(selectionChanged(const QItemSelection & selected, const QItemSelection & deselected)), this, SLOT(slotLoadTransaction(const QItemSelection & selected, const

How to trace the missing pixels when using drawLine

孤人 提交于 2019-12-10 12:17:52
问题 We know that for drawing on an image in qt, qpainter is used. Recently, I used drawLine() function to draw whatever an user is scribbling. This was done by passing the lastPoint and currentPoint from the mouseMoveEvent to a custom function which implements drawLine(). I have passed the arguments for that custom function as given below: void myPaint::mouseMoveEvent(QMouseEvent *event) { qDebug() << event->pos(); if ((event->buttons() & Qt::LeftButton) && scribbling) { pixelList.append(event-

how to use blocking MessgeBox in kivy

折月煮酒 提交于 2019-12-10 12:17:22
问题 I have a Kivy application. From the main GUI, I want to open a new message box and force the main GUI to await the result of an action box interaction. I saw that Qt4 message box has support for this blocking call type, but I haven't found the equivalent functionality in Kivy. Does such a feature exist? 回答1: The Popup widget is used to create modal popups. By default, the popup will cover the whole “parent” window. When you are creating a popup, you must at a minimum set a Popup.title and a

Qt - serialize/deserialaize text and picture

Deadly 提交于 2019-12-10 12:09:26
问题 I want to use a field (kind of QTextEdit), which is capabale of storing picture and text (like MS Word is doing) and it serializes and deserialaizes picture+text data. Is there any Qt Widget that allows us to manipulate with picture and text simultaniously and it has set/get functions which operate with serializable type? In othger words, I want to know if there exsists any Qt widget that can store picture+text and has "get" types of function that returns the content of that widgets editable

Piping output of a QIODevice to a QTextEdit

社会主义新天地 提交于 2019-12-10 11:57:58
问题 How to I make the output of a QIODevice ( QProcess , specifically) go into a QTextEdit in real time? 回答1: Connect the QProcess::readyRead signal to a slot that then reads from the QProcess using QProcess::readAllStandardOutput and writes the text to the QTextEdit with QTextEdit::append. 回答2: Write own class! Header: class MyProcess : public QProcess { Q_OBJECT ... protected: virtual qint64 readData( char * data, qint64 maxlen ); ... }; Source: qint64 MyProcess::readData( char * data, qint64