Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • 0 Votes
    3 Posts
    3k Views
    E
    Thanks for your response. I posted this question on "stackoverflow":http://stackoverflow.com/questions/7650978/qnetworkreply-emits-error-signal-twice-when-contentnotfounderror-occures-when-eve also and got a solution for it. To sum it up: Replace test() with this: @void test() { qRegisterMetaTypeQNetworkReply::NetworkError("QNetworkReply::NetworkError"); mgr = new QNetworkAccessManager(this); reply = mgr->get(QNetworkRequest(QUrl("http://developer.qt.nokia.com/fileNotExisting.txt"))); connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(onError(QNetworkReply::NetworkError)), Qt::QueuedConnection); }@ There is a bug that will be fixed in the release of Qt version 4.8.0 ("link":https://bugreports.qt.nokia.com/browse/QTBUG-16333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel)
  • Multithreaded opengl

    5
    0 Votes
    5 Posts
    8k Views
    A
    bms, thanks for your input. I've browsed the interwebs and one of the better explanations I found was by apple: http://developer.apple.com/library/mac/#documentation/graphicsimaging/conceptual/OpenGL-MacProgGuide/opengl_threading/opengl_threading.html I will try to implement something like the "Worker Task" idea from that link. If anyone has some example code where a (double-buffered?) vertex-array or vertex-buffer-object is updated in a worker task I would be interested. Anders
  • [Solved] specify different context to tr?

    3
    0 Votes
    3 Posts
    3k Views
    D
    Thanks Volker, it worked :)
  • Qt 4.8.0 release timeframe?

    5
    0 Votes
    5 Posts
    3k Views
    H
    We just rolled back from 4.8.0 because the network access manager was not properly handling "Connection: close" in the HTTP header. This resulted in a TCP reset when the next post was made over the connection, and the post sailed off into the ether. There is an official bug # but I have to wait until I get to work to post it here. As of last week it hadn't even been looked into. This is a pretty big problem for us. We rolled back to 4.7.4 on Monday. Edit: here's the bug: "20924":https://bugreports.qt.nokia.com/browse/QTBUG-20924
  • Peer to Peer Connection

    6
    0 Votes
    6 Posts
    10k Views
    A
    A p2p setup is nothing more than a situation where every node in a network can act as both a server and a client. No magic involved there. It depends a bit on what you are after. Is your application limited to two nodes? Do you know the address and port where you expect each of the applications to be listening? A server is nothing more than an application that accepts incomming connections. Once a connection is established, both sides can be equal in functionality: data can flow both ways on a TCP connection. The only challenge you face, is to come up with a system to establish that first connection. I have used UPD broadcast messages for that in the past, but a better solution is of course to use something like Zeroconf for service registration and discovery.
  • Win7 read-only problem

    3
    0 Votes
    3 Posts
    3k Views
    K
    Are you trying to change the attributes of special directories such as program folders? In Win 7 and already Vista this is restricted now. So, that might be a reason for your problems. In some cases you need admin rights.
  • Adding new UI forms to the Application for additional windows

    3
    0 Votes
    3 Posts
    3k Views
    L
    I am familiar with the problem ,you have to instantiate your widget with 'new' statement
  • Newbie Tabpage delete

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • QTestlib: Testing QTreeView rename action

    2
    0 Votes
    2 Posts
    3k Views
    A
    I solved this problem by Mocking my Views/Qt stuff via googlemock
  • QTreeView branch rendering

    3
    0 Votes
    3 Posts
    4k Views
    J
    Indeed. And it wasn't that I wanted to be messing around with style sheets. It was rather the case that style sheets seemed to be the "suggested" way to make the tree view draw its branches. If there is a better/simpler way to get that, I'm all in favor of it!
  • [Solved] Direct3d and Qt Not Working

    3
    0 Votes
    3 Posts
    5k Views
    H
    Solved - thank you, that worked perfectly -H @#ifndef D3DWIDGET_H #define D3DWIDGET_H #include <QWidget> #include <dxgi.h> #include <d3d11.h> class D3DWidget : public QWidget { Q_OBJECT Q_DISABLE_COPY(D3DWidget) public: D3DWidget(QWidget* aParent = NULL, Qt::WindowFlags flags = 0); ~D3DWidget(void); inline QPaintEngine* paintEngine(void) { return NULL; } protected: bool createD3D11(); void paintEvent(QPaintEvent*); void resizeEvent(QResizeEvent*); virtual bool winEvent(MSG * message, long * result ); void render(void); private: ID3D11Device* m_pD3D11Dev; ID3D11DeviceContext* m_pD3D11DevContext; IDXGISwapChain* m_pD3DSwapChain; ID3D11RenderTargetView* m_pRenderView; DXGI_SWAP_CHAIN_DESC m_pSwapChainDesc; ID3D11Texture2D* m_pBackBuffer; D3D11_VIEWPORT m_pViewPort; IDXGIAdapter* m_pAdapter; }; #endif @ -CPP @#include "d3dwidget.h" D3DWidget::D3DWidget(QWidget* aParent, Qt::WindowFlags flags) : QWidget(aParent) { createD3D11(); setAttribute(Qt::WA_PaintOnScreen, true); setUpdatesEnabled(false); } D3DWidget::~D3DWidget(void) { m_pD3D11Dev->Release(); m_pD3DSwapChain->Release(); } bool D3DWidget::createD3D11(void) { ZeroMemory(&this->m_pSwapChainDesc, sizeof(DXGI_SWAP_CHAIN_DESC)); m_pSwapChainDesc.BufferCount = 1; m_pSwapChainDesc.BufferDesc.Width = width(); m_pSwapChainDesc.BufferDesc.Height = height(); m_pSwapChainDesc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; m_pSwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; m_pSwapChainDesc.SampleDesc.Count = 1; m_pSwapChainDesc.SampleDesc.Quality = 0; m_pSwapChainDesc.Windowed = true; m_pSwapChainDesc.OutputWindow = winId(); m_pSwapChainDesc.BufferDesc.RefreshRate.Numerator = 60; m_pSwapChainDesc.BufferDesc.RefreshRate.Denominator = 1; HRESULT hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL , NULL , D3D11_SDK_VERSION, &m_pSwapChainDesc, &m_pD3DSwapChain, &m_pD3D11Dev, NULL, &m_pD3D11DevContext ); if(FAILED(hr)) { MessageBoxA(NULL, "Blah, Blah", "", MB_OK); return false; } ID3D11Texture2D* pBackBuffer; if( FAILED( m_pD3DSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D), (LPVOID*)&pBackBuffer ) ) ) return false; hr = m_pD3D11Dev->CreateRenderTargetView( pBackBuffer, NULL, &m_pRenderView ); pBackBuffer->Release(); if(FAILED(hr)) return false; m_pD3D11DevContext->OMSetRenderTargets( 1, &m_pRenderView, NULL); ZeroMemory(&m_pViewPort, sizeof(D3D11_VIEWPORT)); m_pViewPort.MinDepth = 0.0f; m_pViewPort.MaxDepth = 1.0f; m_pViewPort.TopLeftX = 0; m_pViewPort.TopLeftY = 0; m_pViewPort.Width = width(); m_pViewPort.Height = height(); m_pD3D11DevContext->RSSetViewports(1, &m_pViewPort); return true; } void D3DWidget::paintEvent(QPaintEvent* paint) { } void D3DWidget::resizeEvent(QResizeEvent* event) { } bool D3DWidget::winEvent(MSG * message, long * result ) { bool returnValue = false; switch(message->message) { case WM_PAINT: // PreRender(); render(); //PostRender(); returnValue = true; break; default: returnValue = false; } return returnValue; } void D3DWidget::render() { float ClearColor[4] = { 0.0f, 0.125f, 0.6f, 1.0f }; // RGBA m_pD3D11DevContext->ClearRenderTargetView(this->m_pRenderView,ClearColor); m_pD3DSwapChain->Present(0,0); }@
  • How to insert image in QTextEdit with smart text wrap?

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

    4
    0 Votes
    4 Posts
    3k Views
    EddyE
    You're welcome! Could you please edit your title and add [solved] in front of it?
  • QDeclarativeListProperty add item from qml application

    6
    0 Votes
    6 Posts
    7k Views
    J
    As an alternative solution, this is what I do when a dynamic list is needed: Derive a new class from QAbstractListModel and expose it to QML, or somehow make use of ListModel. When only a static list is needed, QDeclarativeListProperty appears to be a very good choice.
  • [SOLVED] QTableWidget is not getting refreshed automatically..

    5
    0 Votes
    5 Posts
    22k Views
    M
    Wow.....Wounderfull.. :-) Its working now... Thanks for your inputs..
  • Same view 'lay out' for 2 QTableViews

    3
    0 Votes
    3 Posts
    2k Views
    T
    No, just checked. I've got no warnings or special statements from the debugger output.
  • How to avoid displaying QMainWindow

    4
    0 Votes
    4 Posts
    2k Views
    G
    It is trivial: @ int main(int argc, char *argv[]) { QApplication a(argc, argv); // check the condition here if(checkMyStuff()) { MainWindow w; w.show(); return a.exec&#40;&#41;; } return 0; } @
  • Using Qxt Libraries

    3
    0 Votes
    3 Posts
    3k Views
    L
    Yes, I looked at it It's not really what I am looking for I am looking for attachSignal/attachSlot examples
  • Writing and reading from file error

    2
    0 Votes
    2 Posts
    1k Views
    A
    ok i got my mistake..it is @ While(!in.atEnd()) @ :D:D [EDIT: fixed code, no bold or other visual formatting, Volker]
  • Undostack decrement problem

    8
    0 Votes
    8 Posts
    3k Views
    G
    We're not going to do you homework. That's up to you. The docs are pretty clear here. Why don't you just start to program and test the results? That's the usual way to go.