[quote author="Arukas" date="1328130428"]I just want to get the correct item out of the tree. Is the only way to use a
@map<QTreeWidgetItem, int>@
or does the treewidget do something like that already for you?
[/quote]
I posted a solution for that just above...
You could also use "ID-based translations":http://developer.qt.nokia.com/wiki/QtInternationalization#43b304ead4174986c238cb4e0c4d5cb0, too. Although they're not as clean of a solution, IMHO, they are an option.
Thanks for reporting back. We all know that nasty little erros too good. It so often that it's these tiny typos that make you scratch your head for hours :-)
Good luck with your further progress and of course you're very welcome to ask again if needed.
While it would be possible to check for which thread is calling a function in debug builds, it would be too much overhead for release builds IMO. The ground rule is that if a method is not marked as being thread safe, it is not. For setting text, it will work unless the main thread is accessing the text at the same time. It will definitely crash once you ship the program to the client, says Murphy's law :-)
Never mind I figured it out. Took several more tries and reading. My problem is I don't know what I'm even looking for.
I had to set modal to tree. Is QDialog::setModal how would say that? Also, its the exec method i over looked. I was under the impression that's not what you want to do. I thought the Qapplication exec was the only one i needed.
-Thanks
This is for login dialog, but for connecting the socket, to the other dialog? I mean, yea, this looks similar to what I have in the login dialog, but how to connect, the resulting socket, from this, to the second dialog? Thanks alot.
Thank you, unfortunately this will not work, if I find a solution it must work on Mac OS too. In fact Mac OS is my primary development platform.
Thanks anyway.
It helped when I took the .o file away.
The comment was as I mentioned before just a lucky hit when I tried to get what went wrong when I builded my class.
Thank you miroslav. Now It works.
This is the final working code:
@void MainWindow::on_MainWindow_customContextMenuRequested(const QPoint &pos)
{
QMenu *menu = new QMenu();
QAction *setupAction = new QAction("Setup", this);
QAction *monitorAction = new QAction("Monitor", this);
menu->addAction(setupAction);
menu->addAction(monitorAction);
menu->addAction(ui->actionConnection);
menu->exec(QCursor::pos());
}@
You can do the composition in code using QPainters composition methods, but you will need to generate the images for each of the modes this way and set them on QIcon manually from code. QIcon itself cannot automatically create composites like this.