Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • QMYSQL3 Unable to reset statement

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Kubuntu 10.11 and OpenGL

    6
    0 Votes
    6 Posts
    5k Views
    Q
    Thank you for your replies they was very helpful
  • [solved]Alpha composition in a QGraphicsScene with two overlayed QPixmap

    4
    0 Votes
    4 Posts
    3k Views
    J
    I fixed a few mistakes, but I still have one big issue: pixels with alpha=0 are transparent pixels with alpha=255 show a correct color pixels with alpha€[1-254] have a correct transparency but they are gray!!?? EDIT: fixed by removing the premultiplied flag. If you had not asked for my images, I'm not sure I had searched bugs in this place!
  • Qt dbus for multiple out parameters

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Unexpected behavior when hiding and showing widgets in a layout

    7
    0 Votes
    7 Posts
    3k Views
    J
    I'm now hiding elements like this: @ for( int i=0; i< ui->resultLayout->count(); ++i ) ui->resultLayout->itemAt(i)->widget()->setVisible(false); @ and it works like expected. I will update this thread if I have any new issue.
  • Qtabbar alignment

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Custom-context-QGLWidget causes problems

    2
    0 Votes
    2 Posts
    2k Views
    V
    So no one has an idea about where the problem is? I also tried using a QGraphicsSCene and a QGraphicsView with a viewport set to my QGLWidget, but it fails with a GLContext=null error (probably because in the QGLWidget I create a custom context...).
  • Composite widget + Stylesheets and a weird bug(?)

    9
    0 Votes
    9 Posts
    3k Views
    D
    No reaction from Qt stuff? :|
  • How to read null value from QTableWidget?

    4
    0 Votes
    4 Posts
    3k Views
    G
    @ QTableWidgetItem *item = tableWidget->item(5, 7); if(item) { // the item exists // do something with it // it is safe to call QString t = item->text(); } else { // the item does NOT exist // you have a NULL pointer here // NEVER call item->xxx here, the program will crash // you may call this a NULL item // if you want to do something here, create an item // and put it into the table widget } @
  • Qt best way to invoke methods of QMainWindow from other widget

    3
    0 Votes
    3 Posts
    4k Views
    G
    Or if you always pass a QMainWindow as parent, change the constructor to take only QMainWindow pointers as parent and save the parent in a class attribute.
  • Parse XML file

    10
    0 Votes
    10 Posts
    8k Views
    R
    Hellow again! I modificated my code and all must work right: @void RizekFaster::traverseNode(const QDomNode& node, QModelIndex& index) { int count = 0; QDomNode domNode = node.firstChild(); while(!domNode.isNull()) { if(domNode.isElement()) { QDomElement domElement = domNode.toElement(); if(!domElement.isNull()) { if(domElement.tagName() == "folder") { itemModel->insertRow(count,index); QModelIndex newIndex = itemModel->index(count,0,index); itemModel->setData(newIndex,domElement.attribute("name",tr("New folder"))); count++; traverseNode(domElement,newIndex); } if(domElement.tagName() == "item") { itemModel->insertRow(count,index); QModelIndex newIndex = itemModel->index(count,0,index); itemModel->setData(newIndex,domElement.text()); //This cant work in the folders count++; } } } domNode = domNode.nextSibling(); } }@ But in this @QModelIndex newIndex = itemModel->index(count,0,index);@ When index is valid and count is valid(0 when there is no 0 rows in this index's table, and 1 when there is 1 rows in the index's table) the newIndex is not valid. Why is it happened?
  • QProgressBar with QNetworkReply

    6
    0 Votes
    6 Posts
    6k Views
    L
    Use QProcess::start() and connect to the "QProcess::finished()":http://developer.qt.nokia.com/doc/qt-4.8/qprocess.html#finished signal, which is emitted as soon as the process has finished and passes the exit code to the slot.
  • Print out a txt file to text box

    8
    0 Votes
    8 Posts
    13k Views
    M
    Once again Volker thank you very much for your help!
  • How can i remove a value from a qlist?

    10
    0 Votes
    10 Posts
    7k Views
    S
    @ #include <QMap> #include <QList> #include <QDebug> typedef QMap<QString, QString> Map; void removeKey(QList<Map>& list, const QString& key) { int ret = 0; QList<Map>::iterator i; for ( i = list.begin(); i != list.end() && !ret; i++ ) { ret = (*i).remove(key); // but only find first } } int main() { QList<Map> list; Map aMap; Map bMap; aMap["aKey1"] = "aValue1"; aMap["aKey2"] = "aValue2"; bMap["bKey1"] = "bValue1"; bMap["bKey2"] = "bValue2"; list.append(aMap); list.append(bMap); qDebug() << list; removeKey(list, "aKey1"); qDebug() << list; return 0; } @
  • QPainter::Composition modes in PDF

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • How can i get an unsorted qmap?

    7
    0 Votes
    7 Posts
    14k Views
    K
    thanks. solved
  • QDialog out of a console application

    2
    0 Votes
    2 Posts
    2k Views
    R
    You can change QCoreApplication to QApplication and QT += gui So it starts to be not only cli app.
  • Alternative to a global instance variable

    3
    0 Votes
    3 Posts
    2k Views
    K
    Thank you Volker. Your first suggestion works great. I appreciate your help.
  • QTextBrowser set link , can't make it clickble

    3
    0 Votes
    3 Posts
    4k Views
    G
    QTextBrowser does not load content from the interwebs automatically. "QTextBrowser openExternalLinks property":/doc/qt-4.8/qtextbrowser.html#openExternalLinks-prop bq. Specifies whether QTextBrowser should automatically open links to external sources using QDesktopServices::openUrl() instead of emitting the anchorClicked signal. Links are considered external if their scheme is neither file or qrc. "QTextBrowser source property":/doc/qt-4.8/qtextbrowser.html#source-prop bq. When setting this property QTextBrowser tries to find a document with the specified name in the paths of the searchPaths property and directory of the current source, unless the value is an absolute file path. It also checks for optional anchors and scrolls the document accordingly If you want to load web content, use a [[Doc:QWebView]] instead.
  • QPainter/QPainterPath and svg groups

    2
    0 Votes
    2 Posts
    3k Views
    A
    No ideas? Guess I can drop the use of the QPainter/QPainterPath classes and just manually create the svg file. Bit more work but does give me more control.