Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • QNetworkAccessManager timeout

    4
    0 Votes
    4 Posts
    6k Views
    M
    You could manually start a QTimer at the same time you make your initial request, which would trigger the "timeout" handling if it is allowed to expire. Then in the slot which handles the finished() signal, you can stop the timer so it never has a chance to expire when things work as expected.
  • Problem drawing a QPixmap on screen with a QPainter

    3
    0 Votes
    3 Posts
    5k Views
    P
    Thanks for the quick response. This is indeed my problem here.
  • Problems using QPixmap's loadFromData to load an image

    9
    0 Votes
    9 Posts
    7k Views
    P
    Figured out that my problem was the folder was in the wrong folder for the code to recognize it. In any case I'm now having the problem where the image wont draw via a qpainter.drawPixmap() function. Going to start a new thread
  • How to connect to Open Office.org database with Qt ?

    2
    0 Votes
    2 Posts
    2k Views
    A
    Have a look at http://www.qtcentre.org/threads/18867-Qt-and-openoffice-org
  • How to disable maximize button in widgets [SOLVED]

    3
    0 Votes
    3 Posts
    7k Views
    A
    O thanks! worked like a charm
  • How to set the size percentage of a QWidget

    10
    0 Votes
    10 Posts
    27k Views
    ZlatomirZ
    You play with values, i don't know exactly what those ints mean, anyway here is a little example: @int main(int argc, char** argv) { QApplication a(argc, argv); QWidget parent(0); QLabel* w0 = new QLabel("red"); w0->setStyleSheet("QLabel { background-color : red; color : blue; }"); QSizePolicy policy0 = w0->sizePolicy(); policy0.setHorizontalStretch(2); w0->setSizePolicy(policy0); QLabel* w1 = new QLabel("green"); w1->setStyleSheet("QLabel { background-color : green; color : blue; }"); QSizePolicy policy1 = w1->sizePolicy(); policy1.setHorizontalStretch(1); w1->setSizePolicy(policy1); QHBoxLayout* layout = new QHBoxLayout(&parent); layout->addWidget(w0); layout->addWidget(w1); parent.show(); return a.exec(); }@
  • Newbie confused with terminologies and need a hand

    3
    0 Votes
    3 Posts
    1k Views
    ZlatomirZ
    I recommend a book, at least that is how i understood C++ - tutorials are good when you want to remember the operator precedence or tricks with stl's functors or other specific issues, but to understand C++ and then Qt framework i think a book is better. You can search for Thinking in C++ there are two volumes written by Bruce Eckel - they are recommended by many programmers and are free to download. And then for Qt you can choose from "here":http://qt-project.org/books - the first edition of C++ GUI Programming with Qt 4 is free for download, if i remember correctly.
  • Get next day QDate

    2
    0 Votes
    2 Posts
    4k Views
    K
    QDate has a method call "addDays":http://qt-project.org/doc/qt-4.8/qdate.html#addDays Also QDateTime has "this method ":http://qt-project.org/doc/qt-4.8/qdatetime.html#addDays
  • QNetworkManager fails to download in some cases [SOLVED]

    13
    0 Votes
    13 Posts
    5k Views
    A
    The problem was wrongly diagnosed. There is no such issue of "percent20". Its something else! Sorry for so much hussle.
  • 0 Votes
    3 Posts
    2k Views
    K
    Did you copy the complete file structure with the source code from one machine to the other? This might be the problem. There also some user/setup-dependent files which will probably create the problem. You should copy only the source code (cpp/h) files, the ui files and the .pro and the eventual includes there to the other machine. Load the .pro file with the qt creator. All auto generated files and everything created during the compilation process shall be freshly generated. I assume that this will clear your problem.
  • Global/System-wide QStylePlugin or QStyleSheets: Tell me how! [Solved]

    3
    0 Votes
    3 Posts
    2k Views
    T
    Thanks. Compiled toxygen, threw it in QTDIR/plugins/styles, and it appears to work alright. Now I need to figure out how to use a global icon theme...
  • Unable to change progress bar background color [SOLVED]

    8
    0 Votes
    8 Posts
    6k Views
    EddyE
    If changing the used style is ok for you then it's solved? AFAIK GTK+ style is like windows style preventing stylesheet changes on some parts. Could you please edit your first post and add [solved] in the title?
  • [SOLVED] problem with QFile in ubuntu

    2
    1 Votes
    2 Posts
    2k Views
    N
    I found it....simple. I was thinking that qt store files in main directory...I found my output file in myProject-build-desktop. Thank`s at all.
  • QT IDE and debug process Windows & Linux

    6
    0 Votes
    6 Posts
    4k Views
    T
    You should see the Qt data types as well as the most important STL types, etc. in "pretty printing". You will get the normal debugger output for everything else.
  • [Solved]How to build 64-bit application

    7
    0 Votes
    7 Posts
    23k Views
    T
    To disable Qt in a qmake project you can do this: @ CONFIG -= qt QT -= core gui @ The first one will suffice with with qmake and a recent Qt Creator (> 2.4.x). Earlier creators need the second line to detect that you do not want Qt.
  • Grainy application icon under Windows/VS2005

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Changing the name of the control and updating the code

    2
    0 Votes
    2 Posts
    1k Views
    K
    No! That would make me nervous when an IDE changes names based on some dubious convention.
  • 0 Votes
    9 Posts
    4k Views
    T
    [quote author="DeVeL-2010" date="1331308421"] I just recommended to have a function which maps your currentIndex into a QModelIndex. If you use QAbstractItemModel instead of MyModel for m_pModel in the class QTableViewComboBox, you get rid of the casting. Of course, in this case you must use signal/slot mechanism. In this case it is better to direct connect currentIndexChanged with the slot(!) comboBoxChanged(). [/quote] Yep! That works - and no nasty casts from const * to * and no connecting of signals and slots on the same object. Thanks for the advice. So the createEditor method in my subclassed combo box now looks like this: @ QWidget ComboBoxDelegate::createEditor(QWidget parent, const QStyleOptionViewItem &/ option/ , const QModelIndex &index) const { const QAbstractItemModel *pModel = index.model(); QTableViewComboBox *editor = new QTableViewComboBox(pModel , index , parent); /*......*/ connect( editor , SIGNAL( currentIndexChanged(QString)),pModel, SLOT(comboBoxChanged(QString))); /...../ return editor; } @ I was not sure I could 'connect()' with the comboBoxChanged using only a pointer to the base class - but obviously I can; it is taking a while for me to get used to this signal/slot mechanism. [quote author="DeVeL-2010" date="1331308421"] On the other hand, it should be possible to overwrite setModelData() of ComboBoxDelegate and call in this function setData(). Advantage: it works also with QSortFilterProxyModel. Calling data() functions in comboBoxChanged() shouldn't be necessary, because the view will do this after receiving the dataChanged signal.[/quote] Again you are correct, the data() methods in the comboxBoxChanged slot were not needed after all. Many thanks - I am more than happy with the code now. John T.
  • Qt under windows: Switch to a new Platform SDK

    3
    0 Votes
    3 Posts
    3k Views
    R
    when building under Qt-Creator and windows, obviously other include paths exist, that are not defined in your *.pro file. If two identically named header files exist, one in an older SDK folder and one in a new SDK folder, and QT by default takes the old one. How do you force it to use the new one? what guarantees that what's specified in the *.pro file INCLUDEPATH statements will be taken into consideration first when looking for headers or library files?
  • Mapping a dom tree to a table and back.

    4
    0 Votes
    4 Posts
    2k Views
    J
    Thanks for your answer. I just read up about the way QDomNode is implemented. It just holds a pointer to a private implementation class [1]! So I just need to keep a copy of a QDomNode. [1] "qdom.h":http://iguana.web.cern.ch/iguana/lxr/source/Qt/qdom.h, line 222