Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Disabling QTableView leads to ScrollBar problems

    2
    0 Votes
    2 Posts
    3k Views
    A
    Sounds like something to report as a bug on "Jira":http://bugreports.qt.nokia.com
  • Write a network application (Chatroom)

    4
    0 Votes
    4 Posts
    3k Views
    C
    Of course you can :D. Determine which protocol you want to use, TCP or UDP. For most case, udp is the right one. And you can use Qt to implement both UI and logic part.
  • Table data into XML file format

    5
    0 Votes
    5 Posts
    5k Views
    L
    "QXmlStreamWriter":http://doc.qt.nokia.com/latest/qxmlstreamwriter.html is what you are looking for. No need for a full blown DOM (like QDomDocument) just for data serialization / deserialization (would add processing and memory overhead, would add dependency to QtXml). @ QFile xmlFile("table.xml"); xmlFile.open(QIODevice::WriteOnly | QIODevice::Truncate); QXmlStreamWriter xmlStreamWriter(&file;); xmlStreamWriter.writeStartDocument("1.0"); foreach(RowType row, table.rows) { xmlStreamWriter.writeStartElement("row"); foreach(ColumnType column, row.columns) { xmlStreamWriter.writeTextElement(namespaceUri, column.name, column.value); } xmlStreamWriter.writeEndElement(); } xmlStreamWriter.writeEndDocument(); xmlFile.close(); @ Brain to terminal. Not tested.
  • Trouble using Qt Socket Programming [SOLVED]

    8
    0 Votes
    8 Posts
    9k Views
    M
    No problem! If your problem's solved, please edit your original post and change the thread title to "[SOLVED] Trouble using Qt Socket Programming"
  • Writing QImage data to a XML file using QXmlStreamWriter

    6
    0 Votes
    6 Posts
    5k Views
    D
    ProudChild, you are welcome :) Assistant is not a strange heap of information, it is your friend in Qt development :)
  • [Bug?] QGraphicsWidget, transparent background, stylesheet

    1
    0 Votes
    1 Posts
    3k Views
    No one has replied
  • VS plugin and qmake

    5
    0 Votes
    5 Posts
    4k Views
    M
    The problem is we can not use vs plug-in due to some historical issue. and have to use qmake from command prompt:(
  • [Solved]QModelIndex get data

    3
    0 Votes
    3 Posts
    5k Views
    D
    Thanks peppe, that did the trick.
  • QBoxLayout and "stretching"

    12
    0 Votes
    12 Posts
    14k Views
    R
    Solution: This appears to be a knows Qt problem under OSX. Note the following bug report: http://bugreports.qt.nokia.com/browse/QTBUG-14591 Resolution: by setting the Qt::WA_LayoutUsesWidgetRect attribute for each button.
  • QSystemTrayIcon context menu refuses to loose focus

    4
    0 Votes
    4 Posts
    2k Views
    T
    please it would be very helpful if you could provide as with a relevant part of your code. Without the source code i am not able to debug it and help you more.
  • Error on running Qt Application in Mac machine..

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • With every Build MSVS is mocing all header file

    2
    0 Votes
    2 Posts
    3k Views
    K
    It could well be that you are facing the same problem as described in this "post/solution":http://developer.qt.nokia.com/forums/viewthread/7658/#45053
  • View multiple images in a cell of a QTableView

    3
    0 Votes
    3 Posts
    3k Views
    EddyE
    Hi nico, Can you elaborate a little more about what you want to achieve in detail? Why can't you use one per cell? What is the main purpose of your application? It is possible when you make a delegate for it. The stardelegate example comes to mind.
  • How to speed up QListView?

    7
    0 Votes
    7 Posts
    7k Views
    L
    [quote author="zither" date="1310915639"]You means that, cause of slow performance is QListView.setModel(myModel)?[/quote] This is the cause of your problem. @ while(sql.next()){ item = new QStandardItem(sql.value(0).toString()); QStandardItemModel->appendRow(item); } @ Traversing the whole result set is an expensive operation. Allocating, constructing and copying elements are expensive operations. You do all of them. I don't think that displaying the data is your problem. I did a quick performance test and I see no difference in displaying hundreds, thousands or hundreds of thousands of items. You cannot create a class which is a QAbstractItemModel, QSqlQueryModel and QStandardItemModel. QAbstractItemModel is the base class for all models. It defindes a basic set of operations a class has to provide so it can be used by any of the views. You should start be reading on how models work in Qt (there is plenty of documentation) and then create your own subclass of QAbstractItemModel which then can be used by the view. You will probably end up in a model or proxy model which has a QSqlQueryModel and a QStandardItemModel and does some index mapping from the "outer" indices to the "inner" indices of QSqlQueryModel and QStandardItemModel.
  • Maximizing SubWindow in MdiArea

    2
    0 Votes
    2 Posts
    6k Views
    G
    I think this will not work without schnaging QMdiArea, as it is the normal behavior of an MDI sub window.
  • QCompleter with a QSqlTableModel [Solved]

    6
    0 Votes
    6 Posts
    8k Views
    L
    I found this solution: @ setTableData(QModelIndex index) { .... QModelIndex index_table_model = qobject_cast<QAbstractProxyModel*> (m_Completer->completionModel())->mapToSource(index); int table_model_row; table_model_row = index_table_model.row(); .... } @ and it works...
  • File not found QtGui.framework/Versions/4/QtGui for architecture x86_64

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    13 Posts
    5k Views
    EddyE
    It's not that difficult. Hint : Use the same approach as before. Look for a signal and slot with a bool argument.
  • [Solved] How to read & write binary file from internet?

    2
    0 Votes
    2 Posts
    3k Views
    K
    QNetworkReply inherits from QIODevice "size":http://doc.qt.nokia.com/4.7/qiodevice.html#size That is what you are looking for. If this is not sufficient, you need to handle externally.
  • How to link two data sources with QListView?

    5
    0 Votes
    5 Posts
    4k Views
    L
    [quote author="zither" date="1310885907"]I thought that, bad performance may be during paint event of QListView. Is it correct?[/quote] No. [quote author="zither" date="1310885907"]How can I fix that?[/quote] You can't. See "here":http://developer.qt.nokia.com/forums/viewthread/7835/#46011.