Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.9k Posts
  • Problem in children windows switching

    5
    0 Votes
    5 Posts
    2k Views
    L
    another probelm met: now I use MainWindow to control the child's switch, when child B want switch to child C, it emit a signal to the MainWindow, and the MainWindow does: @b.hide(); c.show(); c.exec();@ and when child C want to switch to child B, the MainWindow does: @c.hide(); b.show(); b.exec();@ After successfully switch from MainWindow to B, and from B to C, now the problem is, when want switch back to C from B, it directly jump to MainWindow, with warning as following: Dialog::exec() recursive call seems that I abused the exec() in my code. What's the way out? thanks.
  • RuntimeClass_Windows_UI_Notifications_ToastNotificationManager

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • QT 4.8 and gif image support

    4
    0 Votes
    4 Posts
    7k Views
    D
    Change into the plugin directory, then run @ qmake nmake @
  • Using ODBC for MySQL Connection -> Error

    3
    0 Votes
    3 Posts
    2k Views
    F
    the error was that the odbc driver on my pc diddn't work yeah on my university i cant use mysql connector!
  • QFileDialog :: getExistingDirectory () run with Error

    9
    0 Votes
    9 Posts
    5k Views
    D
    I couldn't figure out why you using Qt in such a way, can you give us some reasons? [quote author="VladimirPivovar" date="1338551944"]in debug and in release mode: "QWidget: Must construct a QApplication before a QPaintDevice Invalid parameter passed to C runtime function. Invalid parameter passed to C runtime function. " I run code here: [/quote] BTY, the error message is very clear, you can not construct a QWidget or it's subclass before QApplication exists.
  • How to send via tcpip, with signals and slots

    4
    0 Votes
    4 Posts
    4k Views
    S
    Use the readyRead() signal to know when there is data available on the socket for reading. Use the bytesWritten() signal if you need to know when data written to the socket has been sent. Generally there is no need to use flush() or waitForBytesWritten(). Write your code in asynchronous style to keep the program responsive.
  • 0 Votes
    8 Posts
    6k Views
    P
    This is odd: I tried to translate this into Python. The data is loaded just fine and queries work - they return the top 20 results just fine - but no dropdown with the completions is rendered when I type into the QLineEdit. Am I doing something obvious wrong? Do you have any ideas how to put hooks into this thing to see what's going on? (which methods of the QSqlQueryModel does QCompleter call?) @ class TestCompleterModel(QtSql.QSqlQueryModel): def init(self, terms, view_terms = 10, parent = None): super(TestCompleterModel, self).init(parent) self.db = QtSql.QSqlDatabase.addDatabase('QSQLITE') self.db.setDatabaseName(':memory:') if self.db.open(): self.query = QtSql.QSqlQuery() self.query.exec_('create table options(val varchar(100))') self.query.prepare('insert into options values (?)') for term in terms: self.query.bindValue(0, term) self.query.exec_() self.query.exec_('select count(*) from options') print 'rows in SQLITE:' while self.query.next(): print self.query.value(0) self.query.prepare("select val from options where val like ? || '%' order by val limit 20") self.query.bindValue(0, 'aspi') self.query.exec_() print 'top 20 matches:' while self.query.next(): print self.query.value(0) self.view_terms = view_terms self.terms = sorted(terms) self.num_terms = len(terms) self.line_edit = parent self.completion_prefix = '' @QtCore.Slot() def setCompletionPrefix(self, prefix): print 'setCompletionPrefix', prefix self.completion_prefix = prefix self.query.prepare("select val from options where val like ? || '%' order by val limit 20") self.query.bindValue(0, prefix) self.query.exec_() self.setQuery(self.query) class TestLineEdit(QtGui.QLineEdit): def init(self, terms = None, parent = None): super(TestLineEdit, self).init(parent) self.et = initialLoadEmTree() terms = sorted(self.et.all_terms_and_syns()) print 'Number of terms', len(terms) self.completer = QtGui.QCompleter(self) self.completer.setMaxVisibleItems(10) self.completion_model = TestCompleterModel(terms, 10, self) self.completer.setModel(self.completion_model) self.textEdited.connect(self.completion_model.setCompletionPrefix) @ Many thanks Patrick
  • Making a checkbox checked

    16
    0 Votes
    16 Posts
    38k Views
    R
    hi, i think so, because no errors when compiling, and when i do with &st.socket there is an error @C:\Dokumente und Einstellungen\loetrobo\Robbie20-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug..\Robbie20\main.cpp:19: error: no matching function for call to 'QObject::connect(QTcpSocket**, const char*, Robbie20*, const char*)'@ looking like a double pointer so without & it should be normal pointer
  • QProcess, QEventLoop and Bourne Shell

    5
    0 Votes
    5 Posts
    4k Views
    S
    Allright, thx for the help. When I started programming my GUI I started using "Prozess.waitForFinished()", but there where some problems with running the process, for example the following source code was executed while the process was not finished. Since I am now finished and the source code has changed a lot I could try it again. But, because I have no more time and the local loops work really fine I will leave it as it is.
  • [SOLVED] QSqlTableModel refuses to write data in database

    4
    0 Votes
    4 Posts
    2k Views
    S
    I replaced libmysql.dll which I compiled QMYSQL driver against it, with the newer version that I just installed on client's machine. Works fine. Thanks for your response. Note: programming for Windows using Qt makes me mad :-/
  • QFile copy

    4
    0 Votes
    4 Posts
    5k Views
    V
    That is so strange - contradicting all - QFile::copy() returns false, but file is copied to the destination, which doesn't exist before copy call. I understand copy() will return false, if destination is available rather overwriting. This case will not happen in your case, since you check the existence of destination before copy() - very strange.
  • Get a list of subdirectory and file in special path as soon as possible

    5
    0 Votes
    5 Posts
    3k Views
    S
    Use QDirIterator instead of QDir. It uses less memory. If you don't call fileInfo() then you can avoid expensive "stat" operations (assuming you only need the filenames) This is somewhat optimised in Qt 4.8, so if you're using 4.7 you may consider upgrading.
  • Is QTableView using lazy population?

    4
    0 Votes
    4 Posts
    7k Views
    G
    I'm not using the QSqlTableModel or any other existing SQL model because my model queries data from SQL table joins and unions, which are not supported by those models (read only). So i'm going to use a custom model which uses QSqlQuery as its base or subclass QSqlQueryModel to add write methods... Thanks
  • Phonon for Mac

    2
    0 Votes
    2 Posts
    2k Views
    B
    I figured it out, and I'm posting it here for everyone. You need to run "macdepoyqt" in the base directory of your application. (Macdeployqt should either come with qt or can be built.) More specifically, go to the directory where "MyApplication.app" is located, and call "macdeployqt MyApplication.app". This will copy all the necessary Qt frameworks and dylibs into your app folder. This is very important for phonon because the phonon backend needs lots of files and codecs. (Simply copying the phonon.framework and dylibs yourself will not work.)
  • Qt with sqlite

    2
    0 Votes
    2 Posts
    1k Views
    EddyE
    Yes What did you try to do. How did you get/install Qt?
  • QDir::mkpath and QImage::save on msvc2010 Release Build

    4
    0 Votes
    4 Posts
    2k Views
    L
    Be aware that this is true for other debug instructions as well, like Q_ASSERT, Q_ASSERT_X and Q_CHECK_PTR, as they are removed in release builds (or more specifically when QT_NO_DEBUG is defined). Be sure to never place instructions within such macros that could cause any side-effects. @ // WRONG, removed in release build, uninitialized ptr Q_CHECK_PTR(ptr = new char[size]); // RIGHT ptr = new char[size]; Q_CHECK_PTR(ptr); @
  • Document Appending

    8
    0 Votes
    8 Posts
    4k Views
    V
    ok thank u
  • Perlembedd and Qt

    3
    0 Votes
    3 Posts
    2k Views
    J
    Hey, thank you very much. For everybody, that is searching for this: You need to add: @ LIBS += -L/usr/lib/perl/5.12/CORE -lperl @ to the .pro file.
  • [Solved] QXmlStreamReader encoding guess

    5
    0 Votes
    5 Posts
    5k Views
    T
    Thanks for your replies. I think codecForUtfText() should work for my case. I don't know how I missed it :)
  • What does "_IMAGE_MEM_SIZEEXCEED" warning stands for ?

    4
    0 Votes
    4 Posts
    1k Views
    T
    Where did you get that warning? What did you try to do when it happened?