bq. Note: If you do not have a value to return, return an invalid QVariant instead of returning 0.
This note is taken from "the official documentation of QAbstractItemModel which is inherited by QFileSystemModel ":http://doc.qt.nokia.com/4.7-snapshot/qabstractitemmodel.html#data Do you get invalid QVariant in your case?
As Andre and Volker said, the Q{Read|Write|ReadWriter}Lock classes and their (*Locker classes which you should use) allow more fine-grained control over your locks to minimise lock contention and therefore hopefully let you application be more concurrent.
You could use the signal "cellChanged":http://doc.qt.nokia.com/4.7/qtablewidget.html#cellChanged to check the data of a changed cell. This does not imply entering and leaving a cell without editing it.
You could also use "currentCellChanged":http://doc.qt.nokia.com/4.7/qtablewidget.html#currentCellChanged which is used when the focus switches from one cell to another. This does not include moving the cursor out of the table with tab or mouse.
"qInstallMsgHandler() ":http://doc.qt.nokia.com/4.7/qtglobal.html#qInstallMsgHandler is your friend then.
The "Browser for QDebug Log Output":http://developer.qt.nokia.com/wiki/Browser_for_QDebug_output has an example using a separate MainWindow, it can easily be adapted to utilize your regular MainWindow.
@TARGET = rawPlugin
TEMPLATE = lib
CONFIG = qt plugin
VERSION = 1.0.0
HEADERS += argbhandler.h
SOURCES += argbplugin.cpp
argbhandler.cpp
target.path += D:/Software/QT/src-4.7.1/plugins/imageformats/imageformats
INSTALLS += target@
I'm using the example source provided in the link to learn. My project file is as above. I have modified the example source according to my requirement. I understand that I have to do:
bq. qmake file.pro
nmake
nmake install
I get an error saying :
bq. LINK : fatal error LNK1104: cannot open file 'rawPlugin.lib'
Please correct me, if I'm doing any thing wrong.
Thank you very much.
i just solved it with the following code :)
@ QColor test = QColorDialog::getColor (Qt::white, this);
message = message.insert(selectEnd, "</font>");
message = message.insert(selectStart, "<font color="" + test.name()+ "">");@
I've tried a few things and I think if I get the following right, things should work as I want them to.
So what I'm doing is:
I draw a rubberband rectangle on my image. I calculate the center point of that rectangle and save those coordinates.
Then I do a scale transform to the view to fit the rubberband rectangle I selected previously to fit in the whole viewport.
then I use the function:
QGraphicsView::centerON(centerPoint) // centerPoint being the coordinates I saved in #1.
Now my question is, I think the coordinates I saved in #1 through the mouse events (i.e. event->pos()) in press and release events are in View coordinates. So if I map those to scene coordinates with:
QGraphicsView::mapToScene(x, y);
and save that point, then after the scaling transformation doing centerOn(centerPoint) should center the viewport in the exact same point of the scene, just now the scene is scaled but the center point is the same..Is this logic right? For now I don't think its centering the viewport where I want it to so I think somewhere I'm missing something.
Could someone please help me get on the right track??
Split up the class definition into a header file, and don't put definition and implemenation together in the cpp file.
then it should work.
Or include main.moc at the end of the file.