Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • QWizards

    16
    0 Votes
    16 Posts
    5k Views
    G
    [quote author="manaila" date="1316080444"]So, it means that QWizards do not offer the property that I wanted since your suggestions couldn't solve my problem. Thank you, anyway.[/quote] That is not correct. The program has unexpectedly finished. This means, you have a programming bug. But without the whole code, it is a bit difficult, to check, what is wrong. I had a mistake in my last post, sorry for that. What does wizard() return? You see there are many relevant things, that come together and you always show 3 lines of code, where no one else then you know, what is behind. You could create a small example, that shows your problem and post it to pastebin or similar, so we can see the whole code.
  • Resize QGraphicsSvgItem by dragging corner

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Makecurrent

    7
    0 Votes
    7 Posts
    3k Views
    S
    That i also know.. And more over im not doing anything related to GUI operation in worker thread.Its there in main thread only. But still
  • [Moved] Is anyone tried gSoap on qt.

    6
    0 Votes
    6 Posts
    4k Views
    D
    Yes, it definitely supports SSL, both on the client side and on the server side.
  • [SOLVED] supportedDropActions() in QAbstractItemModel

    7
    0 Votes
    7 Posts
    10k Views
    A
    Eureka ! Only one thing that I need to do just change dragDropMode in QTreeView from InternalMove to DragDrop. And Modified version of dropMimeData now looks like this : @bool GroupsModel::dropMimeData( const QMimeData * data, Qt::DropAction action, int row, int col, const QModelIndex & parent ) { QByteArray encodedData = data->data("text/plain"); QDataStream stream(&encodedData, QIODevice::ReadOnly); int takedGpIndex, takedSubIndex; QModelIndexList deleteList; while (!stream.atEnd()) { stream >> takedGpIndex >> takedSubIndex; if (takedGpIndex < 0 || takedSubIndex < 0) continue; // ********************************* take item calculations ***********************// // get place in structure Group * takedGp = m_groups.getGroupByIndex(takedGpIndex); if (takedGp == NULL) continue; GroupSubscriber * sub = takedGp->getSubscriberByIndex(takedSubIndex); if(sub == NULL) continue; // ********************************* drop place calculations ***********************// // get place in structure int putGpNdx = -1; if (parent.isValid() && parent.internalId() <= 0) putGpNdx = parent.row(); else putGpNdx = row; Group * putGp = m_groups.getGroupByIndex(putGpNdx); if(putGp == NULL) continue; // put data QModelIndex putParent = index(putGpNdx,eID,m_null); if(takedGp == putGp) { if(row == -1) continue; if(row >= putGp->count()) { int pRow = putGp->count(); beginInsertRows(putParent,pRow,pRow); GroupSubscriber * newSub = new GroupSubscriber(*sub); putGp->addSubscriber(newSub); endInsertRows(); } else { beginInsertRows(putParent,row,row); takedGp->copySubscriber(takedSubIndex,row); endInsertRows(); if(takedSubIndex>row) takedSubIndex++; } } else { if(row == -1) { int pRow = putGp->count(); beginInsertRows(putParent,pRow,pRow); GroupSubscriber * newSub = new GroupSubscriber(*sub); putGp->addSubscriber(newSub); endInsertRows(); } else { beginInsertRows(putParent,row,row); GroupSubscriber * newSub = new GroupSubscriber(*sub); putGp->insertSubscriber(newSub,row); endInsertRows(); } } m_bChanged = true; QModelIndex takeParent = index(takedGpIndex,eID,m_null); deleteList.append(takeParent.child(takedSubIndex,eID)); } if(action == Qt::MoveAction) removeItems(deleteList,false); return true; }@
  • 0 Votes
    2 Posts
    2k Views
    T
    Please discuss bugs in the bug tracker! It really helps all parties involved to keep related information in one place.
  • The UI display problem in the thread

    4
    0 Votes
    4 Posts
    2k Views
    A
    Considder throttleing your update frequency. That is: do not update more than 30 times per second at most. Anything faster is not going to be visible by the user anyway. That means that you can buffer updates for that time at least. Best to do this already in the thread providing the updates, as it lightens the load on the UI thread and its eventqueue. It is easy to flood the evenqueue, making the application slow to respond.
  • How to access a member of a QButtonGroup by number?

    17
    0 Votes
    17 Posts
    7k Views
    A
    Off-topic: The point of helping for many people here (ok, at least for me, let me not pretend to speak for others here) is that it is a learning experience for everyone involved. Feeding you complete answers, also on non-Qt issues, does not qualify as such. That is why Gerolf and I suggest you learn C++ before trying your hand at Qt. I am sorry you have a deadline in a language and toolkit you know very little about, but that is your problem, not ours. Personally, I would have invested in a paid consultant for a situation like that. That would get you straight answers and timely responses, and ready-to-use pieces of code. On-topic then: Make Tag a property on the class: a private variable to keep the value (you could perhaps use your button group itself for that), a getter method to retreive the value, and a setter method to set it. The getter method will return the value of your private variable, while the setter one will manipulate its value (and its representation, if that is separate from each other). Optionally, you can add a changed signal for the value, to let other objects know that the value has been changed.
  • Creating menu options

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • QFileDialog does not honor QCoreApplication settings

    4
    0 Votes
    4 Posts
    2k Views
    G
    Thank's - I voted for it, may it raise the priority a bit :-)
  • Standard selection

    3
    0 Votes
    3 Posts
    1k Views
    M
    Looks like that is just what I need, I'll give it a shot. Thanks.
  • [Resolved] Close Widget Window if mouse clicked outside of it

    2
    0 Votes
    2 Posts
    6k Views
    R
    Okay, I am using @setWindowFlags(Qt::FramelessWindowHint | Qt::Popup);@ Now my window receives the "focusOutEvent" event correctly and the focus isn't "stolen" from my main window thanks to the Qt::Popup.
  • Extra window or ui in existing gui

    17
    0 Votes
    17 Posts
    7k Views
    A
    works now! thank you :)
  • QString and BSTR

    26
    0 Votes
    26 Posts
    19k Views
    K
    because when i send a persian text it doesn't show it correctly on the lcd or when i want to get information from it via this dll it does'nt show me anything i think qStrong can't work well here i don't know why
  • 0 Votes
    3 Posts
    3k Views
    S
    Andre, Thanks, you are correct. I also asked there, and got this reply... (I'll include for anyone else looking for this response) [quote] Hi, I think that you need to update the data model so that the new placemark appears on the mapwidget. A call to @ marblewidget->model()->treeModel()->update() @ (working with the latest code on git) should do it, but it maybe slow if you need to add many placemarks. I am working on adding a function "addFeature" to GeoDataTreeModel which will work the same way as addDocument, updating only the data you replaced, which should work better if you have a large number of placemarks to add. It works fine in single-threaded mode (see attached file for a patch). If you want to give it a try, you will have to create your kml tree, something like: @ Marble::GeoDataDocument *mydoc=new Marble::GeoDataDocument(); mydoc->setFileName("mydocument.kml"); //Will identify the document internally, must be unique mydoc->setName("My_GeoDataDocument"); //Name for visualisation in MarbleWidget Marble::GeoDataFolder *myfolder=new Marble::GeoDataFolder; myfolder->setName("My first folder"); //(setName from base class GeoDataFeature, inherited from GeoDataContainer) Marble::GeoDataPlacemark *myplacemark=new Marble::GeoDataPlacemark; myplacemark->setName("A placemark in a folder"); marblewidget->model()->treeModel()->addDocument(mydoc); marblewidget->model()->treeModel()->addFeature(mydoc, myfolder); marblewidget->model()->treeModel()->addFeature(myfolder, myplacemark); @ You can also retrieve an existing element GeoData... structure from its QModelIndex (for instance, if you loaded an existing document with a call to MarbleWidget::addDocument(QString) ): @ GeoDataObject* geoobject = static_cast<GeoDataObject*>( modelindex.internalPointer() @ I have added GeoDataTreeModel::index(GeoDataFeature*) function to recover the QModelIndex of a feature already present in the treemodel, I am not sure if there is an easier way to get the model (I go through up the tree upto top-level node m_rootDocument, and then build the index downwards, any ideas?). The attached code is work in progress. My plan is to include: Implement a removeFeature function Reimplement calls to addDocument and removeDocument with calls to new functions addFeature and removeFeature (so that all the code to do the update is centered in a single function). Add protection for multithreaded operation. With code on svn (and my patch as it is) a single call to addDocument from a thread different of the main thread causes the application to crash. I am having some trouble with multithreading, I will send a message to the list asking for help on this later. I will be glad to hear any feedback you may have on the patch, I will submit it to reviewboard when it is complete. Hth Javier[/quote] Edit: added a bit of markup. Especially on code sections, could you please use @ tags to properly format them?; Andre
  • QVariant.canConvert inconsistencies

    5
    0 Votes
    5 Posts
    4k Views
    G
    AFAIK, QVariant does not offer them. You have to do them on your own. But it will be tricky, becaus: Is a date convertable to a long? yes --> seconds since..., or no ? is a double convertable to an int, if it contains no int values, like 2.567 ?
  • QUrl and special characters(#)

    5
    0 Votes
    5 Posts
    4k Views
    A
    That's right: QUrl will be overhauled in Qt5.
  • GUI Rendering from Text

    14
    0 Votes
    14 Posts
    5k Views
    A
    I have merged your topics on the same issue. Please use a single topic for a single issue.
  • Set row highlighted when application start in QTableWidget

    9
    1 Votes
    9 Posts
    10k Views
    M
    Oh god... I'm sorry for my ignorance. I answer my own question in my previous post. Sorry.
  • Dockwidgets exclusive selection

    2
    0 Votes
    2 Posts
    2k Views
    A
    Please rephrase your question. It does not make a lot of sense to me. What do you want to achieve exactly?