qt4

Custom QGraphicsItems not compiling and gives "object is private" error

Hi, I am trying to create a Custom QGraphicsItem button as shown by Fred here. The code which he posted can be found here. The problem is when I try and compile the code I get the following two errors: /usr/include/qt4/QtGui/qgraphicsitem.h ‘QGraphicsItem::QGraphicsItem(const QGraphicsItem&)’ is private /usr/include/qt4/QtCore/qobjec...

How to restart Linux from inside a C++ program?

I have a Qt 4 GUI where I need to have a option in a drop-down menu that allows the user to choose to restart the computer. I realize this might seem redunant with the ability to restart the computer in other ways, but the choice needs to stay there. I've tried using system() to call the following: a suid-root shell script a non-suid s...

How to detect missing font characters

Is there a way to detect that all characters are displayed properly with the current font? In some environments and fonts certain characters are replaced with a square symbol. I'd like to automatically verify that all characters used in the GUI are supported by the current font. ...

Execute Slot in different class

Hi, I want to execute a slot in different class. Is it possible UI_CDSK Obj; connect(Obj.penDrive,SIGNAL(clicked()),this,SLOT( Obj.caller())); This code is in different class and from this class i want to execute slot of different class(UI_CDSK ) Here penDrive and caller belongs to function UI_CDSK class and the mentioned code is i...

how do I specify in qmake 4.5's .pro file that i want to ignore a library in msvc8 (2005)

I have a linking problem. It can be solved by specify in msvc8 project properties -> Linker -> Input -> Ignore Specific Library: msvcrtd.lib. That library conflicts with libcpmtd.lib. But can't find how to do the same thing in qmake's .pro file that is used to generate the .vcproj file. Grateful for any hint /LG ...

Call Slot of different class

Hi, I want to execute the slot of different class. When i execute this code its compiling without any error but not getting Output pendrive1::pendrive1() { UI_CDBurn Obj; connect( Obj.penDrive, SIGNAL(clicked()),&Obj , SLOT(caller())); } Here my slot is not working. Slot in UI_CDBurn is public. But when i called with a button in...

qftp mput rawcommand

Hello, I have a doubt regarding multiple file transfer with qftp. There is no direct way to transfer multiple files with qftp class. Well, I tried it using arbitrary ftp command "mput" with "rawCommand" in QFTP. But it doesnt work for me. Please let me know how I could do a multiple file transfer with qftp. Thanks, ...

Auto increment with a Unit Of Work

Context I'm building a persistence layer to abstract different types of databases that I'll be needing. On the relational part I have mySQL, Oracle and PostgreSQL. Let's take the following simplified MySQL tables: CREATE TABLE Contact ( ID varchar(15), NAME varchar(30) ); CREATE TABLE Address ( ID varchar(15), CONTACT_ID va...

Release edit in QTableWidget Cell

Basically I am trying to give the enter key the same functionality as the return key has when editing a cell in a qtablewidget. If editing a cell and enter is pressed I want it to jump out of editing that cell just like return does. It feels like I've literally tried everything. I've even tried passing a return press event to qcoreapplic...

QExplicitlySharedPointer and inheritance

What is the best way to use QExplicitlySharedPointer and inherited classes. I would like when the BaseClass exits on it's own to have a my d pointer be QExplicitlySharedPointer<BaseClassPrivate> and when I have a Derived class on top of this base class I'd like to have d be a QExplicitlySharedPointer<DerivedClassPrivate>. I tried makin...

Creating a QLineEdit search field for items displayed in a QListView

I want to create a search field that filters the items shown in a QListView. Basically the user could type in "foo" and only items with "foo" in the DisplayRole are shown. I already have a few ideas on how to do this, but thought I'd ask those more experienced than I. My idea would be to use some signals and slots to set a filter in t...

How to convert LPTSTR to QString

Hi can anyone help me to convert LPTSTR to QString ...

Remaining time of QTimer

In one of my projects I am working with a QTimer and I wonderer whether it is possible to get the remaining time of a QTimer in order to let the user know "Time until next timeout: 10 secs" or something like that... Is that possible? If not so, has anyone good ideas for how to realize that? Maybe I got to write my own Timer... ...

Get time of execution piece of code

How do I get milliseconds time of execution of a piece of code in Qt/C++? ...

How do I execute QTcpSocket in a different thread?

How do I execute QTcpSocket functions in a different thread? ...

Qt as a true multi-platform dev-env

Inspired by the maturity problems I am facing porting on Mono Mac & Linux. I am investigating the use of Qt as an alternative. I am curious to hear about your favorite Qt experiences, tips or lesser known but useful features you know of. Please, include only one experience per answer. ...

How do I define an Icon in QT with a compile time predefined image?

I have a png file on disk at compile time. I'd like to have it included into the compiled executable. How do I define such an icon in Qt? ...

Displaying (rendering) HTML from a string in QT

I have html in a QString, what widget can I use to display it? (QWebView is not necessary as I dont access Internet) ...

Context Menu Creation with ‪ Qt Designer(Qt Creator IDE)

How can i create a Context menu in Qt Designer (1.3)? Certainly I want to create it with out writing one line code!! ...

QLabel embedding in QStatusBar using Qt Designer

Is there any solution to embed a QLabel in QStatusBar using Qt Designer? ...