Skip to content

General and Desktop

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

    2
    0 Votes
    2 Posts
    1k Views
    J
    As advised on the #qt freenode channel, this is due to the way in which I was declaring circle widgets when calling it from window.cpp, I had missed off the pointer definition (*) when instantiating it. CircleWidget* circleWidgets = new CircleWidget I then received an error about vtables, so need to work on the Q_OBJECT macro in the header files.
  • [SOLVED] Return value method

    5
    0 Votes
    5 Posts
    2k Views
    B
    Yes, my mistake using * (pointer) like parameter in the signal. I just changed to this: @ SearchRequest::SearchRequest(QObject *parent) : QObject(parent) { QNetworkAccessManager *manager = new QNetworkAccessManager(this); QUrl url("url here..."); QNetworkRequest request(url); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); QUrl params; params.addQueryItem("param1", "..."); params.addQueryItem("param2", "..."); params.addQueryItem("param3", "..."); connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(rfinished(QNetworkReply *))); QNetworkReply *reply = manager->post(request, params.encodedQuery()); } void SearchRequest::rfinished(QNetworkReply *reply) { QByteArray data = reply->readAll(); QString str(data); emit test(data); } signals: void test(QString text); @
  • [SOLVED]QList and QTcpSocket*

    4
    0 Votes
    4 Posts
    3k Views
    M
    Please be sure and edit the title of the original post to add [Solved]. Thanks!
  • QtWebkit link error with MinGW 64

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [Solved] Detecting sort on QTableWidget

    10
    0 Votes
    10 Posts
    17k Views
    D
    [quote author="wssddc" date="1356650243"]I don't extend QTableWidget. The horizontal header is part of it. I just do @ connect(ui->tableWidget->horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(slot_table_clicked(int))); @ and slot_table_clicked gets the column number that was clicked. [/quote] I hadn't realised I could connect signals and slots in this way. That solved my problem perfectly, thanks!
  • How can I debug an application?

    9
    0 Votes
    9 Posts
    7k Views
    K
    I too facing issue with debugging Qt on Windows. Let me tell you workaround [probably this may not fix your problem, but can be alternative to debug your application]: Note: This is valid only if you are compiling Qt application with MSVC2008 (Qt SDK) or MSVC2010 (Qt SDK) in your Qt Creator[i.e basically if you are compiling with nmake] Successfully build your application with Qt creator Open "Visual Studio Command Prompt (2008)" or "Visual Studio Command Prompt (2010)" from start menu > All Programs > Microsoft Visual Studio 20xx > Visual Studio Tools Navigate to location where your exe is built, for example cd c:\MyApp\debug\ in command prompt. run command devenv MyApp.exe This should open Visual Studio 20xx solution explorer Now in Visual Studio 20xx go to File > Open ; and open all your source files (*.cpp and .h files for MyApp) Keep break-points where ever you wish and press F5. You must be able to debug your application now on Visual Studio environment.
  • [SOLVED]Memory usage increase ~20MB after each page loaded in WebView

    3
    0 Votes
    3 Posts
    2k Views
    1
    The leak is caused by @settings.autoLoadImages: false@ setting it to true makes qml work fine
  • QObject::moveToThread() with child objects! [SOLVED]

    20
    0 Votes
    20 Posts
    31k Views
    S
    OK. It is by the way senseless to put a socket into a thread! I am now using the thread-worker approach and it is working perfectly. If a signal is connected to a QObject (the worker) which is in another thread (one can use QObject::moveToThread()) the signal will be appended to a queue. The thread worker will receive the signals when the previos signal has been proceeded completely!
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • How to paint unicode surrogate pairs using QPainter?

    2
    0 Votes
    2 Posts
    1k Views
    B
    I tested this problem with a QTextEdit control, QTextEdit have the same problem - it can't display the complex Chinese character.
  • 0 Votes
    3 Posts
    5k Views
    S
    Thank you Lukas for the help. As mentioned above, QT3 compatible members will not be working in QT5. We should try to modify the usage of deprecated members as much as possible. If in case there is no choice left then only we can use the define in project (.pro) file (first statement possible) as @DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x000000@
  • Need an example for proecessing unicode input and input method

    3
    0 Votes
    3 Posts
    2k Views
    W
    The post is very good.
  • Search, multithread, Internet

    1
    0 Votes
    1 Posts
    556 Views
    No one has replied
  • Getting rid of OpenGL warnings on machines without HW acceleration

    3
    0 Votes
    3 Posts
    6k Views
    A
    HW acceleration is disabled. That is, the option "3D acceleration" under "Display" - "Extended features" is disabled. It was enabled at first, and I got a ton more errors. Edit: Here are the errors I get with HW acceleration enabled: @OpenGL Warning: XGetVisualInfo returned 0 visuals for 0xa21e2a0 OpenGL Warning: Retry with 0x8002 returned 0 visuals OpenGL Warning: XGetVisualInfo returned 0 visuals for 0xa21e2a0 OpenGL Warning: Retry with 0x8002 returned 0 visuals OpenGL Warning: XGetVisualInfo returned 0 visuals for 0xa21e2a0 OpenGL Warning: Retry with 0x8002 returned 0 visuals OpenGL Warning: glXGetFBConfigAttrib for 0xa21e2a0, failed to get XVisualInfo OpenGL Warning: XGetVisualInfo returned 0 visuals for 0xa21e2a0 OpenGL Warning: Retry with 0x8002 returned 0 visuals OpenGL Warning: glXGetFBConfigAttrib for 0xa21e2a0, failed to get XVisualInfo OpenGL Warning: XGetVisualInfo returned 0 visuals for 0xa21e2a0 OpenGL Warning: Retry with 0x8002 returned 0 visuals OpenGL Warning: glXGetFBConfigAttrib for 0xa21e2a0, failed to get XVisualInfo OpenGL Warning: XGetVisualInfo returned 0 visuals for 0xa21e2a0 OpenGL Warning: Retry with 0x8002 returned 0 visuals OpenGL Warning: glXGetFBConfigAttrib for 0xa21e2a0, failed to get XVisualInfo OpenGL Warning: XGetVisualInfo returned 0 visuals for 0xa21e2a0 OpenGL Warning: Retry with 0x8002 returned 0 visuals OpenGL Warning: glXGetFBConfigAttrib for 0xa21e2a0, failed to get XVisualInfo OpenGL Warning: XGetVisualInfo returned 0 visuals for 0xa21e2a0 OpenGL Warning: Retry with 0x8002 returned 0 visuals OpenGL Warning: glXGetFBConfigAttrib for 0xa21e2a0, failed to get XVisualInfo OpenGL Warning: XGetVisualInfo returned 0 visuals for 0xa21e2a0 OpenGL Warning: Retry with 0x8002 returned 0 visuals OpenGL Warning: glXGetFBConfigAttrib for 0xa21e2a0, failed to get XVisualInfo OpenGL Warning: XGetVisualInfo returned 0 visuals for 0xa21e2a0 OpenGL Warning: Retry with 0x8002 returned 0 visuals OpenGL Warning: glXGetFBConfigAttrib for 0xa21e2a0, failed to get XVisualInfo@ Edit 2: I should stress that the program paints correctly either way - with HW acceleration enabled or disabled. Also, the Linux in the VirtualBox runs pretty slowly (especially new windows are real slow to appear) - maybe there's a configuration problem. Edit 3: I tried the same VirtualBox on a better computer, it runs smoothly there, but the error messages are the same.
  • [SOLVED] Problems capturing QGraphicsView in QImage

    3
    0 Votes
    3 Posts
    4k Views
    S
    It turns out the line @ _mapView = new MapView(_parent); @ was clipping the view. By setting the parent to NULL in my test cases, I got the whole view saved in the QImage.
  • QSvgRenderer draw text incorrect after QDomDocument.

    3
    0 Votes
    3 Posts
    3k Views
    R
    Fixed by: @doc.toString(0).replace(">\n<tspan", "><tspan")@ QDomDocument by default write each tag on new line, but by "SVG spec":http://www.w3.org/TR/SVGTiny12/text.html#TSpanElement <tspan> on new line equated to space.
  • Noob at librarys

    4
    0 Votes
    4 Posts
    2k Views
    sierdzioS
    I'm happy to hear that. Please add [Solved] to the beginning of this topic's subject. Happy coding!
  • Inheriting from QObjectPrivate

    4
    0 Votes
    4 Posts
    8k Views
    sierdzioS
    Headers are private for a reason. If you choose to use them, you are doing it on your responsibility. There is no promise of any compatibility for private APIs, even between patch releases. Of course, in real life, most of the code will stay the same for long periods of time. There is nothing inherently wrong about it, you just need to recompile your project every time you update the libraries, and be very careful to use right version with your application, including user machines.
  • Problem opening a .pro file in Qt creator: Program stops responding

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Qt 5: Unknown iconengines and jpeg modules

    1
    0 Votes
    1 Posts
    914 Views
    No one has replied