Questions tagged [qt4]
Questions specifically relating to the deprecated version 4.x.x of the Qt C++ GUI library. If your question applies to the current major version of Qt, use the tag [qt].
5,307
questions
0
votes
0
answers
15
views
When porting Qt4 to QT5, it prompts that #include<QX11Info> cannot be found
When porting Qt4 to QT5, it prompts that #include cannot be found
I have QX11Info under Qtx11Extras, but it reported #include not found.
I want to reference the code written in qt4 as a library in my ...
0
votes
1
answer
35
views
Connecting a function to QHttp::requestFinished
I am using Qt 4.1, the last version that compiles to Windows 98 (although I am running this on Windows XP because I have an AMD processor which cannot virtualize win98). I do not have access to more ...
0
votes
1
answer
33
views
In Qt4.8, add a QToolButton to a QMenu, the auto connect not work
I have a QToolButton button1 with a popup QMenu menu. I add another QToolButton button2 into the menu. I have already defined the ObjectName. But the auto connect only works for button1, not button2.
...
0
votes
1
answer
22
views
Unable to retrieve the y-coordinate of the selected cell of a QTableWidget
I'm implementing a QTableWidget in my Qt app (version Qt 4.8).
This QTableWidget is made of 18 QTableWidgetItems
When the user wants to change the current selected cell, it just calls:
tblWdgList->...
0
votes
0
answers
67
views
Python QThread don't start in a Gitlab Pipeline
I was recently asked to pass some tests (pytest) in a Gitlab job for a professional project made in python 3.7.9 and Qt4, and it use some threads objects derivated from QThread Qt object to perform ...
0
votes
0
answers
178
views
How to install qt4 on Jetson Nano with Ubuntu 20.04 for Hector Slam?
How to Install qt4 on Jetson Nano (ubuntu 20.04) for Hector Slam
Firstly, I tried
sudo add-apt-repository ppa:rock-core/qt4
this code and tried to install the needed libraries, but in my opinion it ...
0
votes
0
answers
6
views
nanopi neo air QtEmbedded-4.8.6-arm related
If you click the UI button with a USB mouse in the QT program, it works at once.
When you click a UI button by touch, the mouse point moves and you have to click again to activate the button.
How can ...
0
votes
1
answer
439
views
How to investigate heap corruption on Windows?
I've observed a crash to desktop. After debugging it turned out that it was somehow due to an unintended destruction of an object, but I'd like to understand why this results in heap corruption. And ...
0
votes
0
answers
41
views
How to add change style sheet of QTButtons and QTLabel in a loop using QSignalMapper and findChild in C++98
I am new in QT using C++ 98.I am setting the stylesheet in QT from of 5 label and 5 button using this class function
Code 1(working)
void Display::setting_Style()
{
MyForm::getMyForm()->...
0
votes
1
answer
189
views
Convert custom type to QVariant
I have my custom type:
enum class MyType : int {
TYPENAME1 = 0,
TYPENAME2 = 1,
TYPENAME3 = 2
};
I need to convert MyType to QVariant. I tried qDebug() << QVariant::fromValue(...
0
votes
0
answers
149
views
How to remove default blue selection of QTreeWidget?
I have a QTreeWidget with rows having some colors. When I try to select row (using mouse click) row's color changes to blue.
I have clicked on middle row
To avoid change in color, I used following ...
0
votes
1
answer
192
views
How to convert a TIF file into a BMP file in C++98 using QT 4?
I am new in C++. How can I convert a TIF file into a BMP file in C++98?
Here is my "newForm.h".Here is private slots for loading tiff and coverting the image.
#ifndef _NEWFORM_H
#define ...
1
vote
0
answers
44
views
Getting wrong name in mouse hover property in Qt
I am having QGraphicsScene which contains many digital gates ( AND,OR,NOR etc ) which are made up of Arc, Polyline, Circle, Straight line etc.
I am implementing a feature like, when I hover mouse over ...
0
votes
1
answer
32
views
What is different QKeyEvent modifiers in Qt4 and Qt5
When I enter the number pad side of the keyboard in qt4, I want to receive QEvent::KeyPress and process it.
However, if I check the modifiers() of the event, KeypadModifier should come in, but ...
1
vote
1
answer
30
views
How to easily recognize searched item in a dense QGraphicsScene?
I have a QGraphicsScene with many QGraphicsItem like circle, rectangle, polylines, arc etc.
Every QGraphicsItem has a name. And I have a Search feature which highlights searched items using that name. ...
0
votes
0
answers
120
views
How to deselect / dehighlight multiple items using QGraphicsScene::clearSelection()?
I have a QGraphicsScene which has 100+ items. Sometimes I need to highlight and dehighlight multiple items.
Here is the code:
HighlightObject(QEvent* event)
{
//Finding object under cursor
...
0
votes
1
answer
47
views
Error in typecasting of QGraphicsItemGroup in Qt
I am trying to create a digital gates symbols ( like AND,NAND etc ) using line, arc, circle. To do this I am using QGraphicsItemGroup also.
For example. If a symbol contains 3 lines, 2 arc and 1 ...
0
votes
1
answer
85
views
How to use arc co-ordinates from .slib file to draw an arc in Qt?
I am trying to generate various gate symbols ( AND,NOT,XNOR,MUX etc) by reading .slib file.
But I faced a problem while reading an arc related co-ordinate from .slib file.
I am not understanding how ...
0
votes
1
answer
82
views
How to draw an arc between known points to draw XNOR gate in Qt?
I want to draw an arc between point E to point G , F to H ( I want to draw XNOR gate symbol )
I tried this way
path.moveTo(72,10); // for E --> G
QRect bound1 (52,10,20,60);
path.arcTo(bound1,90,-...
0
votes
1
answer
685
views
How to draw an arc between two known points in Qt?
I want to draw an arc between point B to point D and it should touch to point E. ( I want to draw AND gate symbol )
I tried this way
QPainterPath path;
path.arcTo(60,30,46,100,30*16,120*16); // ( ...
0
votes
0
answers
109
views
How to minimize Bounding Rect in qt?
In my view there are 2 lines. 1 Polyline, and 1 straight lines.
I am not able to select straight line. If I try to select it ,
polyline gets selected ( though I have not clicked on it )
Selection of ...
0
votes
1
answer
300
views
Selection of lines through mouse click is not sharp in Qt
In my view there are 3 lines. 1 Polyline, and 2 straight lines. I have named them as P1 and s1 and s2
I am not able to select s1 line. If I try to select it , P1 gets
selected ( though I have not ...
0
votes
0
answers
47
views
U shaped poly-lines giving a trouble in selecting other poly-lines in Qt
I have QGraphicsView which contains many rectangles and polylines. My view looks something like this.
If I click on position A , B, C , D orange color polyline gets selected. If I try to select ...
0
votes
0
answers
53
views
Text is not appearing at specified position in Qt
I have a QGraphicsView which contains many QGraphicsItem like rectangle, polylines etc.
I want to name each rectangle and name is on the rectangle.
Name should be centrally aligned i.e. half of the ...
0
votes
0
answers
191
views
How to add Horizontal scrollbar in one of the column in QTableView in Qt?
I have a QTableView with 3 columns. The columns are Name,Type,Show. I want to add Horizontal Scrollbarin Name column as names in that column are lengthy.
How to add Horizontal scrollbar in one of the ...
0
votes
1
answer
377
views
Undo-Redo functionality using Command-Pattern in Qt for FitInView feature
I have QGraphicsView which contains some QGraphicsItem. This view has some feature like zoom-in, zoom-out, fitIn, Undo-Redo.
My fitIn feature is not working in Undo-Redo functionality.
( To implement ...
0
votes
0
answers
128
views
Can we use multiple stack in Qt's Undo Framework (Command Pattern )
I am having a QgraphicsView which contains multiple QGraphicsItem. I have some features like zoom-in, zoom-out, Hide - Unhide selected item, Undo-Redo.
To implement Undo-Redo feature, I am using Qt's ...
0
votes
0
answers
211
views
How to show, hidden QGraphicsItem in Qt?
I am having QGraphicsView, which has multiple QGraphicsItem's. In QGraphicsItem's, I am having few rectangles and some polylines. Polylines are attached to rectangles.
I have a feature Hide Rectangle ...
0
votes
1
answer
662
views
How to implement undo-redo functionality in hiding QGraphicsItem using Command-Pattern in Qt?
I am having a QGraphicsView which contains some QGraphicsItem I have a feature (Hide Item) which on mouse right click, hide desired QGraphicsItem(Rectangle) and its connected polylines. I have a Undo-...
0
votes
0
answers
159
views
Text is not appearing on QGraphicsView in Qt
I am having a QGraphicsView which contains some QGraphicsItem. I want to put name on each QGraphicsItem. For that I have created class myText which is inheriting QGraphicsTextItem.
But the issue is ...
1
vote
0
answers
220
views
QtQuick 1.1 Image Rounded Corners
I am limited to using QtQuick 1.1 (Qt 4.8) , and so have no access to the GraphicalEffects library. Also I am not able to use any C++ and so the solution has to be pure QML (frustrating limitations - ...
0
votes
0
answers
147
views
How to unhide, hidden QGraphicsItem in Qt?
I am having QGraphicsView, which has multiple QGraphicsItem's.
In QGraphicsItem's, I am having few rectangles and some polylines. Polylines are attached to rectangles.
I have a feature Hide Rectangle ...
0
votes
0
answers
268
views
How to use QPainter::setTransform in paint() in Qt?
I have a simple QGraphicsView with text written over it.That text is wrapped under a bounding rect. I have truncated a text using QFontMetrics::elidedText.
When initially view gets loaded, it shows ...
0
votes
1
answer
475
views
How to truncate a string wrapped in a bounding rect in Qt?
I have a simple QGraphicsView with text written over it. That text is wrapped under a bounding rect. I want to truncate the leading characters of text according to width of the bounding rect.
If my ...
0
votes
0
answers
260
views
How to detect / avoid overlapping of text in Qt?
I am having QGraphicsView, which has multiple QGraphicsItem's. On QGraphicsView I am performing multiple transformation like zoom-in, zoom-out, Fit-in etc.
In QGraphicsItem, I am having few rectangles ...
0
votes
0
answers
57
views
mousePressEvent() is not called until mouse is released or moved in Qt4.8, Embedded linux
I am writing Ui application for an embedded device running on Embedded Linux. Each widget has QSS styles for "focused" cases. But widget that has focus does not get styled immediately after ...
1
vote
0
answers
470
views
Qt Creator debugger just show local variables
I am using QtCreator5.14.0 MinGW-64bit and I wrote this code :
(do not check the code, it is correct , my problem is another thing)
#include <iostream>
using namespace std;
#define ...
0
votes
0
answers
132
views
Qt UTF-8 characters work as literal but not as code point
So I was trying to use 'ZERO WIDTH SPACE' (U+200B) in my Qt 4.8 compiled with MSVC 9.0 project and encountered a problem:
// This works
QString::fromUtf8("TestString"); // Note the zero ...
0
votes
1
answer
140
views
qt4 the clicked signal in the connect button doesn't trigger the settext in the label
The app runs okay but the clicked() signal doesn't trigger the setText() of the label. Any hint why it doesn't?
#include <QApplication>
#include <QLabel>
#include <QPushButton>
#...
0
votes
0
answers
316
views
RTSP with VLC-QT (Qt4): libvlc: video output creation failed
I wrote a Qt4 widget to stream network video using vlc-qt library. Of course it works on my PC but I get the following errors when I try and run my application on the target machine (Deb 8):
libvlc: ...
0
votes
0
answers
85
views
QT4: how to generate header files from ui
I'm working on a legacy project written in cpp under Visual Studio 2010. This is a desktop application built with QT4.
I'm an absolute beginner in the QT world, so maybe the question I'm going to ask ...
0
votes
1
answer
97
views
Changing the tab design in Qt
How to edit the tabs separately, I want to place the background image on tab 1 different from tab 2.
QWidget::tab {
border-image: url(:/Tabs/tab_notclick.png);
min-width:96px;
min-height:18px;
}
...
-2
votes
1
answer
657
views
"No decoder available for type 'video/x-h264
I am running qt video player I made but every time I load a mp4 file or mp3 it gives me this error.
MP4:
Warning: "No decoder available for type 'video/x-h264, stream-format=(string)avc, ...
0
votes
0
answers
109
views
QODBC driver retrieve wrong bigint value from query while QMYSQL works fine
I've a mysql database with following table:
CREATE TABLE `scenario_configuration`
(
`id` BINARY(16) NOT NULL,
`filename` VARCHAR(512) NOT NULL,
`hash` BIGINT UNSIGNED NOT NULL,
`...
0
votes
1
answer
388
views
Install Qt4 on macOS Big Sur
I want to install qt4 on my mac, but whenever I type in brew install qt@4 I get the error
x86_64cpuid.s:273:7: error: invalid token in expression
cmpq $0,%rax
^
x86_64cpuid.s:273:7: error: ...
0
votes
0
answers
81
views
Qt4 and Qt5 QPlainTextEdit incompatibility
I'm trying to build a program via Qt4, which was written on Qt5. My UI form have QPlainTextEdit and I receive following errors:
'class QPlainTextEdit' has no member named 'setSizeAdjustPolicy'; did ...
0
votes
1
answer
304
views
How to set a custom font size on a widget that adapts accordingly after an application font size change?
I am using Qt4 (I know), and have a custom widget that sets a bold font, with a point size that is 1.5 times the point size of the application font. This works without problems.
The problem now is ...
0
votes
1
answer
363
views
How to trigger a .sh file or a bash command on a Qt4 button click?
Right now, all I have is my QML file, with the button.
/*PlasmaComponents.*/ToolButton {
id: shutdownButton
text: i18n("Shutdown")
iconSource: "system-shutdown"
...
0
votes
1
answer
1k
views
Can't get Qt Creator debug working on Windows 10
I'm starting to work with Qt 4.8.4 on Windows 10, and I've been trying to use the debugger for two days, but I just can't get it to work.
First of all, I've downloaded MinGW 4.4, and that's the ...
0
votes
0
answers
90
views
QGraphicsItem returns impossible pos() value
Qt 4.8 Linux
When move QGraphicsRectItem with mouse and item visualy remains inside the scene:
auto new_bnd_rect = child->sceneBoundingRect();
qDebug()<<new_bnd_rect.topLeft()<<child-&...