Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • [Solved] Threads, timers and moveToThread()

    5
    0 Votes
    5 Posts
    13k Views
    A
    [quote author="astodolski" date="1355750978"] I was looking at an article which a "tutorial":http://qt-project.org/forums/viewthread/14806 was created on this forum and an important point was "NEVER allocate heap objects (using new) in the constructor of the QObject class as this allocation is then performed on the main thread and not on the new QThread instance, meaning that the newly created object is then owned by the main thread and not the QThread instance"__ [/quote]"never" is a bit strong, and other tutorials don't give that limitation. Children objects are moved automatically to the new thread wherever they are allocated from, so if there is a crash as the tutorial author says there is a problem somewhere else. [quote]Can you elaborate what you mean by removing the explicit connection type from the connect call?[/quote]I mean to remove the Qt::QueuedConnection parameter from the QObject::connect call: if you don't specify that parameter, it defaults to "Qt::AutomaticConnection":http://qt-project.org/doc/qt-4.8/qt.html#ConnectionType-enum which will automatically be queued if the signal and the slot belongs to different threads. So most of the time, you can omit it. I think that Qt::QueuedConnection is mostly useful within a single thread, when you don't want the slot execution to be "inlined" into the emitting function.
  • Forum issue - Registration with NoScript

    2
    0 Votes
    2 Posts
    1k Views
    sierdzioS
    Issues like this should be posted to "Beta Testing":https://qt-project.org/forums/viewforum/5/ subforum, and/ or reported on JIRA.
  • Convert Yuv420 to rgb and show on qt pixmap

    4
    0 Votes
    4 Posts
    15k Views
    I
    In may case frame is AVFrame from ffmpeg. But in general video frame can has some planes of data - @data[0], data[1], data[2]@ and linesize for each data plane @linesize[0], linesize[1], linesize[2].@ Linesize is width (in pixel) multiplied by bytes per pixel. You can also check wiki page on yuv420 and read in more details on fourcc.org.
  • Qt: How to display only Image and hide text in a QCombobox

    4
    0 Votes
    4 Posts
    5k Views
    A
    If you want some extra/custom functionality, you should do it yourself... or use it as is....
  • 0 Votes
    3 Posts
    1k Views
    A
    The problem was with my code. QtConcurrent::run() always calls the function, once thread is available.
  • [SOLVED] QTCPSocket receives only 0 byte long packet

    3
    0 Votes
    3 Posts
    1k Views
    J
    Ok thanks for your reply, it works now. Because of your comment I have searched for an alternative and I have changed the code of the method to this. And now it works also with a tcp server which is written in standard C/C++. @ void MainWindow::readFromSocket(){ qint64 iSize=4096; QByteArray sInput; sInput=m_Socket.read(iSize); qDebug()<<"Read bytes >>"<<sInput.size()<<"<< and the message >>"<<sInput<<"<<\n"; } @ Regards Jan
  • [SOLVED] QFile open in text mode error.

    3
    0 Votes
    3 Posts
    2k Views
    A
    Thanks, AcerExtensa. Now it works.
  • [solved] Problem with Qt 5.0 rc2 - Compiler path not found.

    5
    0 Votes
    5 Posts
    4k Views
    M
    billouparis, My mistake, I meant build with* Qt 5 ... not to compile Qt 5 sources. It seems that you can't use MinGW with Qt 5.0 rc2. But I guess I should wait the final version to ask...
  • QSslSocket and unresolved functions

    3
    0 Votes
    3 Posts
    7k Views
    A
    Yes you are right! Uninstalling the 64 bit version and installing the 32 bit version solved the problem! Thanks for suggestion!
  • Running the project in different QT Creator verison

    3
    0 Votes
    3 Posts
    838 Views
    T
    Thanks, it works.
  • [Solved]How to close the application from child dialog box

    5
    0 Votes
    5 Posts
    2k Views
    Z
    Hello All Thanks for replies, I got solution for it. I used MyDialog.show() instead of MyDialog.exec();//it worked Thanks once again :)
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • QPropertyAnimation for sliding menu [Solved]

    7
    0 Votes
    7 Posts
    9k Views
    S
    [quote author="callum.chalmers" date="1355813045"]Thanks for that! Worked like a charm[/quote] Glad to be of some help, Kindly Edit your first post and prepend [Solved] to the title.
  • [SOLVED]How to make the Widget transparent with styleSheet

    5
    0 Votes
    5 Posts
    5k Views
    S
    [quote author="sirnodin" date="1355812795"]Well, i add a @ setAttribute(Qt::WA_TranslucentBackground, true); @ int the cpp file. it seems to work fine.... Maybe my problem is solved.[/quote] Yeah i forgot to add that one. For reference there are some other topics "here":http://doc.qt.digia.com/qq/qq16-background.html and "here":http://qt-project.org/forums/viewthread/1107 Regards Soumitra.
  • Display image in Qlabel

    6
    0 Votes
    6 Posts
    13k Views
    T
    Hi, Now I found that my thread implementation doesn't work well. I followed the idea discussed in the link http://mayaposch.wordpress.com/2011/11/01/how-to-really-truly-use-qthreads-the-full-explanation/ But somehow, it didn't work well. When the worker thread runs, my main thread is frozen, the whole UI is also frozen. That threading idea doesn't work. Now I changed to timer, whenever the timer timeout, it calls the MainWindow's slot method. Now I can display the image. Thanks
  • Open unicode file name in Qt4.7

    11
    0 Votes
    11 Posts
    7k Views
    M
    Passing Unicode strings into command-line tools does work fine, as long as that tool uses wmain() or retrieves the command-line args via GetCommandlineW(). If the tool uses main(), it will get the command-line args converted to the local ANSI codepage, and the we have the mess again... Printing Unicode strings to the console is a problem of its own. You can change the codepage of the Windows console to UTF-8 via SetConsoleOutputCP(), but then you still need to get your UTF-8 string into the console without the CRT messing up your string! printf() or cout<< don't work in my experience, because they are not UTF-8 aware and will mangle your UTF-8 strings. wprintf() or wcout<< will take UTF-16 (wchar_t) strings as input, but then convert them to the local ANSI codepage before passing them to console! My solution is using the Win32 API directly, i.e. print your string via GetStdHandle() and WriteFile(), bypassing the CRT. Either that or using "setmode(fileno(stdout), O_BINARY)" to change the stdout to binary mode, so printf() won't mangle your UTF-8 strings anymore. The latter has the drawback that, after that, using wprintf() or wcout<< will crash the CRT...
  • Inheritance classes draw errors: cannot allocate objects of abstract type

    3
    0 Votes
    3 Posts
    5k Views
    A
    Thank you Lukas ... I have been able to proceed with it now.
  • Ignore pushbutton when using focusWidget()

    5
    0 Votes
    5 Posts
    2k Views
    M
    You might also look into maybe some magic with setFocusProxy(). Haven't really thought it through, but there might be something that could be made to work.
  • QtCreator fails with Segmentation Fault.

    6
    0 Votes
    6 Posts
    3k Views
    T
    ujwala: Please do not hijack other peoples threads with unrelated issues.
  • Qt5 Multimedia Problem

    13
    0 Votes
    13 Posts
    10k Views
    O
    Hi ! I just want to know if the issue has been corrected in the RC2 release for Windows OS... I still have the problem but my dev env is properly configurated : bq. Démarrer C:\Qt\Qt5.0.0-rc2\5.0.0-rc2\msvc2010\bin\qmlscene.exe "D:/Documents and Settings/T0119276/Mes Documents/QML_APP/TEST_QML_5/TEST_QML_5.qml" QQmlImportDatabase::addImportPath: "C:\Qt\Qt5.0.0-rc2\5.0.0-rc2\msvc2010\qml" QQmlImportDatabase::addImportPath: "C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/bin" QQmlImports(file:///D:/Documents and Settings/T0119276/Mes Documents/QML_APP/TEST_QML_5/TEST_QML_5.qml)::addImplicitImport QQmlImports(file:///D:/Documents and Settings/T0119276/Mes Documents/QML_APP/TEST_QML_5/TEST_QML_5.qml)::addLibraryImport: "QtQuick" 2.0 as "" QQmlImports(file:///D:/Documents and Settings/T0119276/Mes Documents/QML_APP/TEST_QML_5/TEST_QML_5.qml)::importExtension: loaded "C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtQuick.2/qmldir" QQmlImportDatabase::importPlugin: "QtQuick" from "C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtQuick.2/qtquick2plugin.dll" QQmlImports(file:///D:/Documents and Settings/T0119276/Mes Documents/QML_APP/TEST_QML_5/TEST_QML_5.qml)::addLibraryImport: "QtMultimedia" 5.0 as "" QQmlImports(file:///D:/Documents and Settings/T0119276/Mes Documents/QML_APP/TEST_QML_5/TEST_QML_5.qml)::importExtension: loaded "C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/qmldir" QQmlImportDatabase::importPlugin: "QtMultimedia" from "C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/declarative_multimedia.dll" Module 'QtMultimedia' does not contain a module identifier directive - it cannot be protected from external registrations. QQmlImports(file:///D:/Documents and Settings/T0119276/Mes Documents/QML_APP/TEST_QML_5/TEST_QML_5.qml)::resolveType: "Video" => "file:///C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/Video.qml" URL QQmlImports(file:///C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/Video.qml)::addImplicitImport QQmlImports(file:///C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/Video.qml)::importExtension: loaded "C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/qmldir" QQmlImports(file:///C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/Video.qml)::addLibraryImport: "QtQuick" 2.0 as "" QQmlImports(file:///C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/Video.qml)::importExtension: loaded "C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtQuick.2/qmldir" QQmlImports(file:///C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/Video.qml)::addLibraryImport: "QtMultimedia" 5.0 as "" QQmlImports(file:///C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/Video.qml)::importExtension: loaded "C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/qmldir" QQmlImports(file:///C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/Video.qml)::resolveType: "Item" => "QQuickItem" TYPE QQmlImports(file:///C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/Video.qml)::resolveType: "VideoOutput" => "QDeclarativeVideoOutput" TYPE QQmlImports(file:///C:/Qt/Qt5.0.0-rc2/5.0.0-rc2/msvc2010/qml/QtMultimedia/Video.qml)::resolveType: "MediaPlayer" => "QDeclarativeAudio" TYPE defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer" C:\Qt\Qt5.0.0-rc2\5.0.0-rc2\msvc2010\bin\qmlscene.exe a quitté avec le code 0