qt

Singleton class issue in Qt

i created a singleton class and trying to access that class in other class but getting error "cannot access private member" Setupconfig is my singleton class and i am trying to access this class in other class which have QMainWindow Error 'Setupconfig::Setupconfig' : cannot access private member declared in class 'Setupconfig' /////...

How to set input focus to a shown dialog in Qt?

In a button click slot, I create and exec() a dialog with a NULL parent. Inside the dialog's constructor, I have: this->activateWindow(); this->raise(); this->setFocus(); The dialog is application modal and has strong focus. However, it does NOT respond to keyboard events until I click on it. How do I make the dialog get focus without...

How to set QListView Opacity ,setWindowOpacity dosn't work

Hi im trying to set opacity to QListView , that sits on QDialog i mange to set the QDialog transperant with setting the :Qt::WA_TranslucentBackground = true but the QList doesn't become transparent with i set the setWindowOpacity to 1 or 0 ...

Is there a summary of differences in rendering/behavior between QtWebKit and Chrome/Safari WebKit?

I wrote a simple Qt application (Windows+Mac) that uses QtWebKit to render a web site inside a window. But I already saw differences in layout and behavior between our app and Chrome (that uses WebKit as well), e.g.: - different fonts are displayed for the same web page - an html anchor link with "javascript:someFunction()" is not worki...

QGraphicsView ensureVisible() and centerOn()

Hi, I am going to do pan/scale stuff on QGraphicsView. So I read the documentation of QGraphicsView and see some utility functions like ensureVisible() and centerOn(). I think I understand what the documentation says but I can' t manage to write a working example. Could you please write/suggest me an example code to understand the issue....

QT/PyQT best practice for using QT Designer

What is your development approach with QT/PYQT and QT Designer ? Are you doing this: Put all components on the panel (without any layout) and arrange them Put components in layout (Align Vertically/Horizontally/Form/Grid) Generate UI file and start coding how do you manage when you have custom widget ? For example when you have...

Change Qt install path after building ?

Hello, how can I change Qt install path after I building it ? Example : qmake.exe search binaries to original install path, how can I change/redefine it ? Thanks. Edit : I finally found this patch to apply to Qt : http://ftp-developpez.com/qt/binaires/win32/patcher/QtPatcher.7z http://ftp-developpez.com/qt/binaires/win32/patcher/QtP...

QT and custom menu item (QLineEdit)

Hi How can I use QLineEdit as a menu item in QMenu? Is there any solutions to do this? Just to do something like this (look at the edit box under the avatar): ...

QWinWidget's position is always 0 (zero)

I hosted a QWinWidget in a CView and want it to stay at a designated position when resizing. But QWinWidget always moves to (0, 0), i.e. left-top corner of the CView. I tried to debug in this way: QWinWidget* pWidget = new QWinWidget(pCView); pWidget->move(50, 50); QPoint pos = pWidget->pos(); Note that: the pos is always (0, 0). Wh...

one timer per thread using Qt

Hi, I modified Qt's broadcast sender example so that it has ten threads and in each thread it starts a timer, but only timer of the first thread is triggered. How can I have one timer running for each thread? ...

Generating XML Documents from XML Schemas in C++

Is there any easy way to create at least a template XML file using XML Schema? My main interest is bounded by C++, but discussions of other programming languages are also welcome.By the way I also use QT framework. ...

How do I use foreach with QDomNodeList in Qt?

Hi Everyone, I'm new to Qt and I'm learning something new every day. Currently, I'm developing a small application for my Nokia N900 in my free time. Everything is fine, I am able to compile and run Maemo applications on the device. I've just learned about the foreach keyword in Qt. (I know it is not in C++, so I didn't think about it ...

don't show on panel

I am trying to write a simple aplication (a continuously changing label on a window on the upper left side of the screen) and I don't want it to be seen on panel but only on system tray.Because it will run for a long time. How can I do that? Thanks. PS: I am using python and pyqt on Linux. I tried SplashScreen but when I clicked on the ...

Qt Won't Compile (10.5 Intel Mac)

Hi all, I am trying to compile the latest version of Qt for the mac (from Gitorius). When I try to compile this (by doing ./configure and then make), I get the following error while running make: ../../include/QtCore/../../src/corelib/kernel/qvariant.h: In function ‘T qvariant_cast(const QVariant&) [with T = QVariant]’: ../../include/Q...

Is it safe to draw three separate QImages in three separate QThreads?

I have a QMainWindow with three widgets inside that are promoted to a class containing a subclassed QThread. They each draw on a local QImage in their rexpective qthread which is sent with a signal once its drawn and then rendered by calling update (mandlebrot example) from the slot. Is this safe or dangerous? They do not share any data...

Recognition source of event in PyQT

Hi, I`m starting with PyQt4 and right now I have a problem with events. I have one main class let say MainWindow. MainWindow has a list of buttons of type ButtonX (inherence form QPushButton). I would like to achieve one of 2 solutions (depends which is easier). 1) After click one of the button from the list I would like to run a one m...

Obtaining command line arguments in a QT application

The following snippet is from a little app I wrote using the QT framework. The idea is that the app can be run in batch mode (i.e. called by a script) or can be run interactively. It is important therefore, that I am able to parse command line arguments in order to know which mode in which to run etc. [Edit] I am debugging using QTCr...

Qt vs Swing : Similarities and Disimilarities?

Do they have any common concepts like C++ and Java do? So that, anyone who learn either gets the basics of other? Like C++ and Java share some common concepts of OOP. You learn them in Java, you can apply them in C++ too and vice versa. Do, Qt and Swing has such property? ...

Basic QT Event handling / Threading questions ?

Greetings , I am new to QT (4.6) and have some basic questions regarding its event mechanism.I come from Swing background so I am trying to compare it with QT. 1) Does Event-processing-loop run in seperate thread? (like EventDispatch thread in Swing) ? 2) If we open several 'QMainWindow' do they run in several threads? 3) Whats the be...

how to change headers data

hello i have the following class class AssetTableModel(QtCore.QAbstractTableModel): def __init__(self,filename=''): super(AssetTableModel,self).__init__() self.fileName=filename self.dirty = False self.assets = [] self.setHeaderData(0,QtCore.Qt.Horizontal,QtCore.QVariant('moayyad'),QtCore.Qt...