Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Why code doesnt work?

    5
    0 Votes
    5 Posts
    2k Views
    G
    The code cannot work, as you remov items from the beginning. After processing half of the items your counter exceeds the count of the remaining items. Call remove on item(0), then the code should work. clear() is the more elegant solution, though :-)
  • Plugin won't load [Solved]

    7
    0 Votes
    7 Posts
    7k Views
    G
    I read this all and remembered plugins are only for dynamic linking. But if only QPluginLoader told me error state "Plugins are not supported in static application" - then I'd solve problem much earlier. The bug is in error processing code in QPluginLoader. It returns wrong error state: "Unknown error".
  • Multiple inheritance in qt

    9
    0 Votes
    9 Posts
    4k Views
    G
    [quote author="Neha123" date="1307534413"]can anyone send an example of inheritance( full code ) pleaseeeeee[/quote] Moaning and crying for help is usually leading to no answers at all. Behave like a grown up and you will treated like a such, behave childish and you will be treated like a nasty child. Begging for code is childish. This is a support forum not a do-my-homework-site. If you have a question, write it down in a way such that others can understand it. And/or describe what you want to achieve, also in a way such that others can understand it. You cannot have multiple inheritance with more than one QObject based base class. Although possible, and valuable in some circumstances, multiple inheritance can be very dangerous and error prone.
  • [SOLVED] Installing Qt application on windows

    5
    0 Votes
    5 Posts
    5k Views
    S
    Thanks !
  • Two different path on linux redHat

    5
    0 Votes
    5 Posts
    2k Views
    P
    I will try that, thak you for your help
  • Hard drive sector viewer

    1
    0 Votes
    1 Posts
    3k Views
    No one has replied
  • [SOLVED]problem while resizing a QgraphicsScene

    3
    0 Votes
    3 Posts
    13k Views
    J
    Thanks a lot.The refresh of my scene seems to solve my problem
  • Dragging QDockWidget between two main windows

    2
    0 Votes
    2 Posts
    3k Views
    J
    Here is more info: @ dock->setVisible( false ); dock->setFloating( mCurrentDockWidget->isFloating() ); dock->resize( mCurrentDockWidget->size() ); dock->move( mCurrentDockWidget->pos() ); mCurrentMainWindow->removeDockWidget( mCurrentDockWidget ); mCurrentDockWidget = dock; mCurrentMainWindow = win; dock->setVisible( true ); QMouseEvent *event = new QMouseEvent( QEvent::MouseButtonPress, locPos, globPos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier ); QCoreApplication::postEvent ( dock->titleBarWidget(), event ); //IS NOT WORKING @ I use special title bar for docks, so dock->titleBarWidget() doesn't return NULL. Posting mouse down event to the title bar doesn't get me in the dragging mode again.
  • QSharedPointer Deleter

    6
    0 Votes
    6 Posts
    6k Views
    B
    [quote author="Gerolf" date="1307522156"]Using a QPOinter could help, as it goes to 0 if the object behind is deleted. Then you only have to handle pointer != 0.[/quote] I will look at this class. It is not important that Cipher is inherited from QObject. I can modify class and remove this inheritence. Sorry that I dont describe this. Of course user can remove Cipher with pointer to QObject class. What about this classes: @class Cipher { friend class Factory; public: ... protected: Cipher() {} virtual ~Cipher() {} }; class Factory { public: static QSharedPointer<Cipher> create() { return QSharedPointer<Cipher>(new Cipher); } }; @ What I need add to this definition for guarantee that only QSharedPointer can destroy Cipher object. Without @template <class T> friend class QtSharedPointer::ExternalRefCount;@ I have some places in my project with seems trouble. Really I can kick out this check, but it is very interesting task, and I wand to find solution.
  • Clean constructors

    11
    0 Votes
    11 Posts
    5k Views
    V
    Oh, great! These articles look to be very useful. Thanks a lot!
  • [SOLVED] can QString::contains() be fast?

    3
    0 Votes
    3 Posts
    3k Views
    Y
    thanks! That's what I needed to know.
  • Fast text file downloading. Fast searching in the text file.

    5
    0 Votes
    5 Posts
    5k Views
    H
    Maybe you shouldn't always append to the textEdit, just try out "this":http://doc.qt.nokia.com/4.6/qstring.html#more-efficient-string-construction method, and in the and this way you have to call the setText() function only once.
  • How to read binary file

    2
    0 Votes
    2 Posts
    78k Views
    T
    Why the temp? @ QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) return; QByteArray blob = file.readAll(); @ should get you the contents of the file into your blob. That is what you were doing as well but without the unnecessary char array. Your code fails in line 13 where the blob is constructed from the temp char array. The constructor you are using is meant to "adopt" a char *, so it copies all the data starting at temp[0] up to the first 0 byte found. As you probably know a 0 byte signifies the end of a string with C character arrays.
  • Problem propagating exceptions from QtConcurrent::map()

    2
    0 Votes
    2 Posts
    3k Views
    S
    Further investigation shows that the person who implemented the code did some typedef stuff that was throwing me off in trying to convert this to mapped() rather than map(). However, it still seems like it would be nice to have some functionality where exceptions can be sent to and handled by the main thread rather than either having to used mapped() to arbitrarily access the results or by blocking with waitForFinished().
  • How can i open dir?

    9
    0 Votes
    9 Posts
    4k Views
    R
    pity, thank you for your try to help
  • Dialog to set the project directory and create new folder on Mac?

    2
    0 Votes
    2 Posts
    2k Views
    R
    Your can download ui form from http://www.rapidshare.ru/2657674 (sorry for russian site) Your can find dir with QFileDialog with FileMode = Directory
  • [SOLVED] Testing QAbstractItemModel::data

    3
    0 Votes
    3 Posts
    3k Views
    N
    Perfect, I missed this index()... Thanks!
  • Using SQLite custom functions with Qt

    1
    0 Votes
    1 Posts
    5k Views
    No one has replied
  • Displaying QImage on screen

    7
    0 Votes
    7 Posts
    10k Views
    J
    You know, that's a great idea. We probably need more efficient graphics than can be provided with the native libraries.
  • QProcess redirecting output streams produces empty files!

    3
    0 Votes
    3 Posts
    4k Views
    C
    I don't tested, but try with "readAllStandardOutput":http://doc.qt.nokia.com/latest/qprocess.html#readAllStandardOutput