Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.0k Posts
  • Cross desktop

    16
    0 Votes
    16 Posts
    10k Views
    C
    Qt is used extensively inside Boeing for this very purpose. On the systems I work on, we build for multiple platforms concurrently. At anytime we can jump to another OS when the situation warrants it. There is not a single perfect solution, and with increasingly complex applications, ifdefs and different OS specific libraries will be involved. But when it comes to the basic application framework, Qt shines on cross platform solutions.
  • QtHelp documentation

    3
    0 Votes
    3 Posts
    4k Views
    E
    http://doc.trolltech.com/4.4/qthelpproject.html http://doc.trolltech.com/qq/qq28-qthelp.html http://doc.trolltech.com/main-snapshot/qthelp.html http://doc.trolltech.com/main-snapshot/qthelp-framework.html Google rules :)
  • VS2010 problem

    14
    0 Votes
    14 Posts
    14k Views
    B
    Ok, thanks a lot for that link! I fixed the errors in StructureTransitionTable.h x 2, did configure with no switches and nmake in the VS2010 command window at C:\Qt\4.6.3. It took a few hours to build, but now all is working as intended. Problem solved.
  • SOLVED: Need help launching external apps from qtdesktopplugin

    2
    0 Votes
    2 Posts
    3k Views
    G
    I just had a suggestion from a co-worker. He had to use short names in the paths in the make file, or he couldn't get examples to compile properly. So, I put the short name path in for Adobe Reader and it launched! The bottom line: Always use short names when specifying any directory or filenames to Qt.
  • Porting QListView to QTreeWidget

    4
    0 Votes
    4 Posts
    4k Views
    S
    Thanks a lot - the second solution was the one I was looking for. Thank you for your fast help !
  • Combobox in a qtableview

    3
    0 Votes
    3 Posts
    9k Views
    M
    I used delegate. Here is a part of the code, ui is just my user interface in which detailview (a qtableview) is defined. I have an order table and a product table in mysql database. What I am trying to do is when the user inserts a new order which is basically a row in my qtableview and selects one of the products from the combobox then the rest of information such as product unit price, etc. should pops up in the right column. Right now I can do it by @connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(dataChanged(QModelIndex,QModelIndex)));@ but for this signal to work the user need to change the focus which is a bit odd. Thanks a lot for the response! @model = new QSqlRelationalTableModel(this); model->setTable("orderdetail"); model->setEditStrategy(QSqlTableModel::OnManualSubmit); model->setRelation(model->fieldIndex("productId"), QSqlRelation("product", "id", "name")); model->select(); ui->detailView->setModel(model); ui->detailView->setItemDelegate(new QSqlRelationalDelegate(ui->detailView));@ P.S. I can send you the whole code but there are multiple files and a lot of different parts that might make it harder to figure out what's what. But let me know if you need the whole thing. Thanks again!
  • Need help in Qt example

    7
    0 Votes
    7 Posts
    5k Views
    C
    Well, the "C++ GUI Programming with Qt4" book was quite useful for me. It wouldn't give you an information about the most fresh and intresting thing that appeared in Qt in the last two years, but it is definitely a good point to start learning the basics.
  • Create window help

    7
    0 Votes
    7 Posts
    6k Views
    D
    ok i edit all 01 lines and here is my .pro file @ #------------------------------------------------- Project created by QtCreator 2010-07-12T15:54:51 #------------------------------------------------- QT += core gui TARGET = untitled3 TEMPLATE = app SOURCES += main.cpp mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui @
  • Apple Remote and other input devices

    3
    0 Votes
    3 Posts
    5k Views
    M
    I see, sounds like it's not gonna be one of those trivial things i can have done in between coffee breaks. I'll look into it though. Thanks.
  • Deferring signals

    4
    0 Votes
    4 Posts
    5k Views
    M
    Thanks guys! I suspected that the network stuff had some kind of processing in the event loop to accomplish what I want. I did a prototype with Denis's suggestion. QObject has a protected method, "connectNotify":http://doc.qt.nokia.com/4.6/qobject.html#connectNotify (which will be called when someone connects to a signal), which I can override and emit the signal if no connections has been made to the signal before. The prototype seems to work well. This should also be safe to use from thread I believe?! @bradley You're right, the timer is not overly complicated for my mock but I wanted a more solid solution in case I need to do something similar in the future :) The timer will only solve the problem if you add a slot before the timer expires which you can't guarantee, or have an expiration time of >5 seconds.
  • Silly? problem with QString

    10
    0 Votes
    10 Posts
    12k Views
    I
    [quote author="luka.v.pikor" date="1278592314"]Hi! And, as far as I know, when we overload operator in class we can use is "normally". As if it was in built-in type. [/quote] It's not actually right. You have to have global <<(>>) operator when one of the argument is istream\ostream and second is your type. QString doesn't have this operator but feel free to create your own for the convenient using. @std::ostream& operator<<(std::ostream& xOut, const QString& xStr) { xOut << xStr.toStdString(); return xOut; }@ Also, in addition to answers above I see another solution: QString::toStdString would be appropriate function for your purpose
  • What about qt-labs/opencl

    2
    0 Votes
    2 Posts
    4k Views
    A
    Yes, I agree, that would be interesting. I am not sure what kind of future Nokia sees for OpenCl in Qt? I hope it is seen as a serious project that could end up benefitting Qt itself as well as Qt developers (so used internally in Qt and available as a good public API).
  • 0 Votes
    3 Posts
    4k Views
    A
    I fear it may not turn out to be easy. For instance QTableView does not listen at all to the size hint, and QListView only uses changes in the size hint if QListView::isWrapping is true. That does not mean that views, especially QListView, do not query for the size hint. They do, but they don't seem to use the result. I tried to use the QAbstractItemDelegate::sizeHintChanged signal to let the view know about a needed re-layout, but in my tests (by reimplementing QObject::connectNotify in the delegate), I could not see that signal actually being connected to by the views. Sorry to give you such negative experiences only, but I don't want you to get your hopes up too high. It me, it seems that the item views still lack a lot of optimization, documentation and polish.
  • Combining QGraphicsSvgItem with QGraphicsLayoutItem

    4
    0 Votes
    4 Posts
    4k Views
    P
    Ok, when I was having a batch I realized that the reason for that weir behavior if fairly simple... it's because it always draws the painting of size of the bounding rect, which forks fine (when the rotation() % 180 == 0) but otherwise it does not work, since the bounding rect in my implementation is the same for all items in the layout. Now to the solution -- there are at least two ways I can think of to solve this problem Shrink the item when rotated (possibly by tinkering with the paint() reimplemantion) so that the geometry() would be same for all the cells of layout but will not overlap other cells. Expand the bounding rect when rotated (possibly by tinkering with geometry() reimplementation) so that the item will be of the same size as if it would be unrotated but will not overlap other cells. I will probably implement both at some point... Now I just have to figure out the math to calculate the sizes properly. :)
  • QAtomicInt

    11
    0 Votes
    11 Posts
    11k Views
    S
    [quote author="ixSci" date="1278363015"]Could you explain why you count each CPU tick and what the "9 times" would be in the time scale, please? [/quote] 1 second on 1 billion calls std::call_once versus 9 seconds with Qt atomic implementation. [quote author="ixSci" date="1278363015"] Also, I think you deepening in the premature optimization. But if you have such an insistence to have faster atomic operation why don&#39;t you use original C++0x(11 I hope) in your code? It would be uglier a little but you will have all that you want. [/quote] I don't want people to say, what Qt library slower than standard library or BOOST.
  • QListWidget delegate paint problem.

    5
    0 Votes
    5 Posts
    8k Views
    R
    I'm already made workaround, by using overloading method of QPainter, to Draw in QRect, instead of x,y. I have left the sizeHint() in original state, and reimplement paint(). The code now is: @ painter->drawText(option.rect.adjusted(2,0,fmTF.width(timeLeft),0),timeLeft); @
  • Deploying Phonon on Windows problem

    4
    0 Votes
    4 Posts
    6k Views
    M
    Thank you guys for the help! Finally I've found the dependencies using procmon and required ones were directories (with their corresponding contents): phonon_backend, imageformats and sqldrivers and I included them on the same directory as executable, and now it works fine.