Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • [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
    79k 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
  • Weird toolbar layout on mac os

    7
    0 Votes
    7 Posts
    3k Views
    D
    Problem found ! It is not due to style/stylesheets, but to the fact that you musn't resize/move your windows before show() is called. Someone has the same probleme here: http://www.archivum.info/qt-interest@trolltech.com/2009-07/00423/Re-(Qt-interest)-setUnifiedTitleAndToolBarOnMac-and-Cocoa-Qt-cause-problems.html After I removed resize/move from my window constructor, the layout is fine !
  • Error when running application on windows

    3
    0 Votes
    3 Posts
    3k Views
    S
    I corrected the PATH and it works now. Thanks :-)
  • Pass from parent to child a variable before child's constructor executes?

    10
    0 Votes
    10 Posts
    6k Views
    A
    Ok, solved! Thanks again and sorry that I didn't know that a constructor could take more arguments - _ -
  • 0 Votes
    8 Posts
    4k Views
    L
    NoFocus Fancy QSlider Stylesheet :D Seems good to me !
  • 0 Votes
    3 Posts
    5k Views
    I
    bq. QAbstractEventDispatcher is a internal class, and we should not use it in our application It is not. For example you have to use it for the hot keys handling in Windows. bq. Maybe the QCoreApplication will do some initial work before As I understood it should be vice versa
  • I have problems with QMYSQL Driver!

    40
    0 Votes
    40 Posts
    19k Views
    K
    sigrid I know that now, but that is one of the old errors. Not I have problems with [quote] Yes, now is @ TARGET = qsqlmysql SOURCES = main.cpp include(../../../sql/drivers/mysql/qsql_mysql.pri) include(../qsqldriverbase.pri) INCLUDEPATH = C:/xampp/mysql/include LIBS += -LC:/xampp/mysql/lib @ but again @ cannot find -libmysql @ Where should be that file? in the lib folder of mysql? [/quote]