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].

Qt 4.x is a specific series of releases of the Qt GUI library. Use this tag if your question only applies to Qt 4.x, and not to Qt 3.x or Qt 5.x. If your question applies to Qt in general, use the tag .

Trolltech released Qt 4.0 on June 28, 2005 and introduced five new technologies in the framework:

  • Tulip: A set of template container classes.
  • Interview: A model/view architecture for item views.
  • Arthur: A 2D painting framework.
  • Scribe: A Unicode text renderer with a public API for performing low-level text layout.
  • MainWindow: A modern action-based main window, toolbar, menu, and docking architecture.

The latest official 4.x release is 4.8.6 (April 24, 2014). The major version indicates API compatibility.

It has been noted that, Qt 4.8 is officially supported till "19.12.2015", In order to get official support it is better to port to Qt5

A list of the supported platforms for version 4.8 can be found here

5315 questions
24
votes
2 answers

How signal and slots are implemented under the hood?

This question is already asked in this forum but I don't understand the concept. I was reading around and it seems that signal and slots are implemented using function pointers i.e the signal is one big function which inside it calls all connected…
user152508
  • 3,053
  • 8
  • 38
  • 58
23
votes
1 answer

PyQT open a web page with JS alert pop up will get SegFault. How to fix that?

I am learning PyQT programing, and when I try a simple test, I get Segmentation fault, here is my code pop.py: #! /usr/bin/python import sys from PyQt4.QtGui import QApplication from PyQt4.QtCore import QUrl from PyQt4.QtWebKit import QWebView app…
PasteBT
  • 2,128
  • 16
  • 17
23
votes
2 answers

Qt Designer: how to add custom slot and code to a button

I use Qt4 Designer and I want that when I click on the "yes" button, some code will execute. And when I click on the "no", some other code will be execute. How can I do it?
pol
  • 315
  • 2
  • 3
  • 7
23
votes
2 answers

Selecting a row in QTreeView programmatically

I have a QTreeView with QFileSystemModel as model. The QTreeView has SelectionBehavior set to SelectRows. In my code I read a dataset to select and then select them via: idx = treeview->model()->index(search); selection->select(idx,…
the JinX
  • 1,950
  • 1
  • 18
  • 23
23
votes
5 answers

'QObject::QObject' cannot access private member declared in class 'QObject'

class CHIProjectData : public QObject { public: CHIProjectData(); CHIProjectData(QMap aProjectData, CHIAkmMetaData* apAkmMetaData = 0, QObject* parent = 0); private: QMap…
Sulla
  • 7,631
  • 9
  • 45
  • 71
23
votes
8 answers

HowTo restore QTreeView last expanded state?

What I have: QTreeView class with table data And connected QAbstractTableModel model Question: how to save expanded state of items? Is some one have finished solutions? PS: I know, that I can do this code by myself, but I don't have much time,…
mosg
  • 12,041
  • 12
  • 65
  • 87
23
votes
3 answers

HowTo Crypt/Encrypt some string (e.g. Password) on Qt simple

Here what I have got: Qt SDK version 4.6.2 Windows XP Question: how can I simply crypt and encrypt simple QString value? I need this to be able to save some crypted string into the INI file, and after reopening application encrypt string to normal…
mosg
  • 12,041
  • 12
  • 65
  • 87
23
votes
4 answers

Is there a good source for 3rd party QT GUI controls?

I have tried to find them through Google but haven't had much luck. I know the number of 3rd party controls is not as big as .NET or Java, but surely there are some out there better than what comes with the library?
Rhubarb
  • 3,893
  • 6
  • 41
  • 55
23
votes
2 answers

About deleting, removing widgets and layouts in Qt 4

(I use Qt 4.7, Windows 7, 64bit). I created a custom table. Each row is a horizontal layout with widgets. The rows are kept in a QList for easy access, and the children too. The rows are also added inside the parent widget. If I resize the parent…
Darkgaze
  • 2,280
  • 6
  • 36
  • 59
23
votes
4 answers

QString Splitting

I have these url strings file:///home/we/Pictures/neededWord/3193_n.jpg file:///home/smes/Pictures/neededWord/jds_22.png file:///home/seede/kkske/Pictures/neededWord/3193_n.jpg I want to extract the "neededWord" from each of them. As it appears from…
Wazery
  • 15,394
  • 19
  • 63
  • 95
22
votes
4 answers

How do I populate values of a static QMap in C++ Qt?

I have this in my C++ header file: #include #include class LogEvent { public: LogEvent(); enum column_t {TIMESTAMP_COLUMN = 0, TYPE_COLUMN = 1, EVENT_COLUMN = 2, FILE_COLUMN = 3}; static QMap
Di Zou
  • 4,469
  • 13
  • 59
  • 88
22
votes
5 answers

How we can connect the signals and slot with different arguments?

In Qt, signals and slots require matching argument types: QObject::connect: Incompatible sender/receiver arguments QLabel::linkActivated(QString) --> Button::call(int) How can I implement a combination like this?
user896036
  • 469
  • 2
  • 5
  • 15
22
votes
3 answers

QT4: Transparent Window with rounded corners

How can I create a partially transparent window with rounded borders (no standard borders)? (I used Qt::FramelessWindowHint to disable standard borders) I tried stylesheets, but border-radius and opacity doesn't seem to have any effect on the…
smerlin
  • 6,446
  • 3
  • 35
  • 58
22
votes
1 answer

How to add submenu in Qt

How do I add a submenu from the menu below? I need a submenu to open, say, after clicking "A->Setup" I want a submenu to be opened to the side of the main menu. void MyMenu::cppSlot() { QMenu *xmenu = new QMenu; …
kbk
  • 555
  • 2
  • 8
  • 20
22
votes
1 answer

Slot is being called multiple times every time a signal is emitted

I am using one signal and slot connection in a block. My code as follows in a.cpp { QObject::connect(m_ptheFlange2Details,SIGNAL(GetFlang1DimAfterAnalysis()), this,SLOT(GetFlang1DimAftrAnalysis())); m_ptheFlange2Details->get();//…
Viku
  • 2,845
  • 4
  • 35
  • 63