Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • 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.
  • [Linux] Some problems with arguments...

    3
    0 Votes
    3 Posts
    2k Views
    K
    My program should do the same with any arguments list. http://www.youtube.com/watch?v=O4an9pp_VPs I've created a little creencast with my attempts of debugging. Maybe it will be useful.
  • Phonon::MediaSource from QBuffer

    4
    0 Votes
    4 Posts
    4k Views
    G
    [quote author="jim_kaiser" date="1308302390"]Okay... from documentation: So, guessing you're missing the isSequential()? [/quote] I'm try to use QFile as MediaSource to access to mp3 files in Qt Resource (qrc). And I have the same problem as MiGryz. Reimplement isSequential() in QFile with a 'false' result have no effect. Mp3 sometimes playing, sometimes not, sometimes breaks in the middle. If I open the same mp3 as local files(not from qrc) - no problem.
  • [Solved] Error in QStandardItemModel.appendRow

    4
    0 Votes
    4 Posts
    6k Views
    L
    Documentation for appendRow() clearly states that it "Appends a row containing items. If necessary, the column count is increased to the size of items." So what you get is one row with three columns. To do what you want to do, use appendColumn() instead.
  • QTreeView: Root node isn't shown

    2
    0 Votes
    2 Posts
    6k Views
    E
    @ model = new QFileSystemModel; QString home_files = QDesktopServices.storageLocation(QDesktopServices.HomeLocation); QModelIndex homeIndex = model->parent(model->index(home_files)); QString home_path = model->filePath(homeIndex); QModelIndex root_index = model->setRootPath(home_path); treeView = new QTreeView; treeView->setModel(model); treeView->setRootIndex(root_index); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(treeView); setLayout(mainLayout); @ You can use treeView->expand(), treeView->scrollTo() functions to expand the directory content and scroll to a specific item.
  • Windows Vista/7 cmd.exe problem

    2
    0 Votes
    2 Posts
    3k Views
    L
    -Pressing CTRL + SHIFT while clicking on a shortcut will run the linked program as Administrator.- -Be aware that a Windows service is more than just a regular application. See "QtService":http://qt.gitorious.org/qt-solutions/qt-solutions/trees/master/qtservice.- Me should read the question first. However, I think that this is "not directly possible":http://bugreports.qt.nokia.com/browse/QTBUG-7645 using QProcess.
  • Enable GUI for one platform, disable it for others

    7
    0 Votes
    7 Posts
    4k Views
    D
    [quote author="lord$now" date="1310807244"] Does the Qt plugin bring it's own compiler or uses the one of VS? Which IDE do you recommend for this project? [/quote] Yeah, VS using its own compiler whether or not you using Qt plugin. If you are looking for an crossplatform IDE, you can choose QtCreator or eclipse. However, you can use Visual Studio under windows, and use another IDE under other platform.
  • 0 Votes
    4 Posts
    2k Views
    G
    Where is the problem? you need start and end coordinates and then some QPropertyAnimation. That should do the trick. But calculating start and end positions is up to you.
  • Qt Layout problem: better explained.

    4
    0 Votes
    4 Posts
    3k Views
    L
    If I were to do the same thing, I would just have added a stretch @this->buttonLayout->addStretch()@ Maybe that's exactly the same thing, just a different way to do it, I'm not sure, but you might give it a try to see if it causes the same problem.
  • Searching for strings within a QTextBrowser?

    9
    0 Votes
    9 Posts
    6k Views
    S
    Hi, also you can use regular expression method : link: http://developer.qt.nokia.com/doc/qt-4.7/qml-regexpvalidator.html bq. Detailed Description This element provides a validator, which counts as valid any string which matches a specified regular expression.
  • Removal of TWM frames

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Wobbling effect in a QLabel

    3
    0 Votes
    3 Posts
    2k Views
    J
    I had this idea in mind but found it a bit dirty :p
  • [Drag&Drop;] QTabWidget

    3
    0 Votes
    3 Posts
    3k Views
    B
    Thx for the answer. I think I'm going to this that way because I haven't found anything better yet. Could anybody say something about my last question?