Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Let plugins know each other

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [Solved] Unexpected behavior with atEnd()

    3
    0 Votes
    3 Posts
    2k Views
    E
    Good guess. When I query in.atEnd(), it is false.
  • [Resolved] QWidget window flag behavior changed in Qt 4.8?

    10
    0 Votes
    10 Posts
    6k Views
    R
    Volker, you are a mad scientist ;-) I'll give that a try in the next couple of days.
  • QNetworkReply and error 202

    3
    0 Votes
    3 Posts
    4k Views
    A
    you guessed, but analyzing chrome http request with wireshark i didn't notice nothing unusual...my application receive 403 error immediatly after 'get' request...i thought it was a user-agent problem, but i have copied chrome ones... anyway QNAM maintains cookies automatically and represents it when asked by the server, doesn't it?
  • QtCreator using QLCDNumber

    6
    0 Votes
    6 Posts
    5k Views
    A
    [quote author="DominicanTech" date="1328505857"]When I create the UI using form, Qt automatically creates the .ui qml for me[/quote] You are confusing interface paradigms here. The things you create based on widgets will not result in QML at all. That will result in a c++ header file (after processing by the uic tools wich will be run by qmake), which is then included in your application.
  • Where do i get the classes of qt in OSX

    7
    0 Votes
    7 Posts
    2k Views
    A
    [quote author="n00b123" date="1328626354"]Hello Volker no i did not use the macdeployqt tool. I don't saw it in the how to: http://developer.qt.nokia.com/doc/qt-4.8/deployment-mac.html[/quote] Well, searching for it on that page points me right to it...
  • QTreeView: selecting full width of a row without text being truncated

    4
    0 Votes
    4 Posts
    4k Views
    A
    "Here":http://www.google.com/imgres?um=1&hl=en&client=ubuntu&sa=N&channel=fs&gl=uk&biw=1553&bih=798&tbm=isch&tbnid=TU8tJeieQP3JCM:&imgrefurl=http://msdn.microsoft.com/en-us/library/ms996437.aspx&docid=FGb115q9lXjvdM&imgurl=http://i.msdn.microsoft.com/dynimg/IC77718.gif&w=282&h=350&ei=qN0zT4vLDIal0QWqup2-Ag&zoom=1&iact=rc&dur=347&sig=113596841083879039400&page=2&tbnh=134&tbnw=108&start=32&ndsp=39&ved=1t:429,r:12,s:32&tx=64&ty=88 is an image of a tree view, with a wide entry that has necessitated a scroll bar. I would like my tree view to look like this, except I would like the blue selection background the 'Ringer' entry to always fill the whole width of the white area - the way items are highlighted in "this image.":http://www.google.com/imgres?um=1&hl=en&client=ubuntu&hs=zWW&sa=N&channel=fs&gl=uk&biw=1600&bih=827&tbm=isch&tbnid=Q8VVttKbSOONCM:&imgrefurl=http://www.palminfocenter.com/news/7805/splashid-4-for-mac-os-x-released/&docid=noft9BWfGJd_eM&imgurl=http://www.palminfocenter.com/images/splashid-mac-desktop-v4.jpg&w=550&h=310&ei=vd4zT9iGM8rK0QXysI3DAg&zoom=1&iact=rc&dur=431&sig=113596841083879039400&page=1&tbnh=107&tbnw=189&start=0&ndsp=28&ved=1t:429,r:2,s:0&tx=119&ty=72 I would also like the scroll bar to be visible only when there are overly wide items visible in the tree. I hope that has helped to clarify a bit.
  • How to get the bitmap from an Qimage

    5
    0 Votes
    5 Posts
    5k Views
    T
    Hi, If I understand you right, you want to composite images. You can use "QPainter::setCompositionMode":http://developer.qt.nokia.com/doc/qt-4.8/qpainter.html#setCompositionMode
  • Embed editable resources

    4
    0 Votes
    4 Posts
    2k Views
    R
    Ok so this code works well on device : .pro @mydeployment.sources = myfolder/* mydeployment.path = mydeploymentfolder DEPLOYMENT += mydeployment@ .cpp @ QDir d(QApplication::applicationDirPath() + "/mydeploymentfolder"); qDebug() << d.exists() << d.entryList(); @ However, this is not working on Nokia SDK Simulator. Any idea to make it work on Nokia SDK Simulator ?
  • How to parse xml from a http xml response?

    11
    0 Votes
    11 Posts
    8k Views
    L
    I would not say it is a general preference, but in this specific case I would prefer a simple regular expression over QDomDocument, because it is just a waste of resources. QXmlStreamReader might be a viable option, but it still requires me to write a multitude of code just to remove some character padding around a string and an integer value (and I can hardly think of anything more extendable then a nongreedy regular expression match combined with <code>*.**</code>). Yes, regular expressions should not be used as a replacement for XML parsing in general, when it comes to different encodings, a varying document structure, schema validation, optional elements and attributes and all the other gruesomeness of XML, but in this specific case ("... if it is just the two fields ..."), where two basic datatypes are paddad by some well-defined and static characters, a simple regular expression is a readable (subjective, I agree on that to a certain degree), extension-resistant single-line construct. This conclusion will change if the conditions change.
  • [solved]Error while compiling project with "QMake"

    16
    0 Votes
    16 Posts
    47k Views
    G
    No necroposting, please. There's no need to wake the dead - the thread had its last response for more than one year ago and it was resolved already. Thanks.
  • Bug in QReadWriteLock Non Recursive

    11
    0 Votes
    11 Posts
    5k Views
    S
    @Peppe: It took me some hours to find out why my code was not behaving like given in the specs when doing unit testing and trying to trigger the deadlock. A non-recursive lock could be useful if one thread can only acquire the lock once to avoid programming bugs (lock the same lock several times from your code and forget to free it the same number of times). Apart from this, if the flag is utterly useless it should definitely be removed. One thing is for sure freeing a lock should never result in freeing several locks, but as far as I know this has never been the case.
  • Using spacebar as a shortcut

    4
    0 Votes
    4 Posts
    2k Views
    G
    Setting a [[Doc:QShortcut]] on the application and/or main window should work too.
  • How to signal qt application

    4
    0 Votes
    4 Posts
    3k Views
    A
    I checked the return value of write function from dll, it is giving return value correctly. Only thing is in my Qt GUI app, I am not getting readyRead() signal.
  • [Solved]Gateway and QProcess

    4
    0 Votes
    4 Posts
    2k Views
    T
    Exactly what I have found to but I dont see where to get the gateway in the QHost-classes
  • QNetworkReply::setReadBufferSize seems ignored in 4.8.0

    2
    0 Votes
    2 Posts
    3k Views
    A
    Just to clarify my problem I isolated the issue to separate example: readtest.h: @#include <QObject> class QNetworkAccessManager; class QNetworkReply; class ReadTest : public QObject { Q_OBJECT public: ReadTest(const char *url); protected: void timerEvent(QTimerEvent *event); private: QNetworkAccessManager *_nam; QNetworkReply *_nrp; }; @ readtest.cpp: @#include <QCoreApplication> #include <QDebug> #include <QNetworkAccessManager> #include <QNetworkReply> #include "readbuff.h" ReadTest::ReadTest(const char *url) { qDebug() << "ReadTest, reading url: " << url; _nam = new QNetworkAccessManager(this); _nrp = _nam->get(QNetworkRequest(QUrl(url))); _nrp->setReadBufferSize(1048576); startTimer(100); } void ReadTest::timerEvent(QTimerEvent *) { qDebug() << "bytesAvailable: " << _nrp->bytesAvailable(); _nrp->readAll(); } int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); if (argc > 1) { new ReadTest(argv[1]); app.exec(); } } @ You can run it and pass some url as an command line argument. When it compiled with Qt4.7.4. everything works fine and I see each time not more that 1M data available. When it compiled with Qt4.8.0 I see some huge number which depends only on network bandwidth.
  • Editing Images with QML

    2
    0 Votes
    2 Posts
    2k Views
    C
    To answer my own question: "How to create QML Image Element from a QImage":http://developer.qt.nokia.com/forums/viewthread/1659 I just did not see this in my initial round of searching. :)
  • .ico/cur plugin

    11
    0 Votes
    11 Posts
    6k Views
    T
    Faculties tend to have teachers which -- based on my experience -- are happy to help when asked specific questions. How about taking an .ico, converting it to e.g. png using any graphics application. Then you can have Qt read the png and feed that into your write method. If the output is identical to the original .ico file, then you are done. For the read method you can do something similar: You read the orginal file, compare that to the png.
  • [Solved]QProcess and DHCP

    8
    0 Votes
    8 Posts
    5k Views
    T
    Maybe I did this more complex then it realy needs to be. I simple used this code @void GlobalParams::getMyIP() { QNetworkInterface *inter = new QNetworkInterface(); QList<QNetworkInterface> list = inter->allInterfaces(); for (int i = 0; i < list.size(); ++i) { if (list.at(i).name().startsWith("eth0")) { QNetworkInterface iface = QNetworkInterface::interfaceFromName(list.at(i).name()); QList<QNetworkAddressEntry> entries = iface.addressEntries(); if (!entries.isEmpty()) { QNetworkAddressEntry entry = entries.first(); ip = entry.ip(); netMask = entry.netmask(); gateway = entry.broadcast(); } } } @ But as tou could see my gateway is filled up with the broadcastadress. And thats not what I want. Someone who knows how too get this: I have seen some code but it was not so obvious like this so I would like some simple example if there is one around.
  • [solved] QLocale - with atof - why doesn't it convert "3.3"?

    3
    0 Votes
    3 Posts
    3k Views
    A
    Thanks! It worked using setlocale(..)! @ #include <QtCore/QCoreApplication> //#include <QLocale> #include <locale.h> #include <iostream> #include <cmath> #include <cstdlib> using namespace std; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); // QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates)); setlocale(LC_NUMERIC,"en_US"); cout << "arg[1] : " << argv[1] << endl; cout << "atof(arg): " << atof(argv[1])<<endl; return 0; } @