Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • [SOLVED] calling a function outside of the dialog class

    20
    0 Votes
    20 Posts
    8k Views
    K
    also, i am starting to understand what can and can't be done inside of a constructor.
  • [solved] Multiple Lines of text in QToolbox buttons

    6
    0 Votes
    6 Posts
    12k Views
    EddyE
    Great you solved it! Could you edit your title and add [solved] in front of it? [done -mariusg]
  • [SOLVED] showing the dialog in a different way

    9
    0 Votes
    9 Posts
    3k Views
    M
    According to this code, you're not declaring it in the .cpp file either. To declare the variable, you need to add (to your mainwindow.h file) @ protected: loginBox * login; @
  • [Solved] How to iterate all widgets in a QWidget window?

    4
    0 Votes
    4 Posts
    25k Views
    L
    Not at all, that was an example. I didn't know how many of those you had so I settled with the easier variant to write down, thinking you would adapt it appropriately (and you did ;) ).
  • Main application window and a dialog interaction

    7
    0 Votes
    7 Posts
    5k Views
    A
    Hmm... why Window Flags Qt example does not have that problem in that case? However not in Mac, need to check other OSs.
  • TableView model proxy problem

    2
    0 Votes
    2 Posts
    3k Views
    P
    Here is the code for the tableView that is in reverse order and not highlighted correctly: dlgprint.cpp @void DlgPrint::createReportTable(QStringList stringList) //strinLlist is used elsewhere { printModel= new QSqlRelationalTableModel (this); printModel-> setEditStrategy(QSqlTableModel::OnManualSubmit); printModel-> setTable (mTableName); //string identified through assessor function printModel-> setRelation (2, QSqlRelation("student", "id", "LName")); printModel-> setRelation (3, QSqlRelation("testNum", "id", "Test")); printModel->setFilter(mFilterString); printModel->select(); proxy = new MyProxyModel(this); proxy->setSourceModel(printModel); ui->printView->setModel(proxy); connect(this,SIGNAL(sendRows(int, int, int, int)), proxy, SLOT(getRows(int, int, int, int))); ui->printView->setItemDelegate(new QSqlRelationalDelegate(this)); ui->printView->setSelectionMode(QAbstractItemView::SingleSelection); ui->printView->setSelectionBehavior(QAbstractItemView::SelectRows); ui->printView->setColumnHidden(0,true);//id ui->printView->resizeColumnsToContents(); printModel->setHeaderData (2, Qt::Horizontal, "Score"); ui->printView->setSortingEnabled(true); ui->printView->resizeColumnsToContents () ; ui->printView->horizontalHeader()->setStretchLastSection(true); highlightCells(); printModel->select(); } void DlgPrint::highlightCells() { float highScore= FLT_MIN; float lowScore= FLT_MAX; float fastReactionTime=FLT_MAX; float slowReactionTime=FLT_MIN; int rowHigh=0; int rowLow=0; int rowFastReact=0; int rowSlowReact=0; float totalTime =0; float totalReactTime=0; float averageScore =0; float averageReact=0; int totalRows = 0; float currentScore; float currentReactTime; QString string; int numRows =proxy->rowCount(); for (int r=0; r<numRows; r++ ) { currentscore = proxy->index(r,2).data(Qt::DisplayRole).toFloat(); currentReactTime = proxy->index(r,3).data(Qt::DisplayRole).toFloat(); //something here to mapToSource?? if (currentScore > highScore) { highScore = currentScore; rowHigh = r; } if (currentScore < lowScore) { lowScore = currentScore; rowLow = r; } totalRows++; totalScore += currentScore; if (currentReactTime < fastReactionTime) { fastReactionTime = currentReactTime; rowFastReact = r; } if (currentReactTime > slowReactionTime) { slowReactionTime = currentReactTime; rowSlowReact = r; } totalReactTime += currentReactTime; } } if (totalRows !=0) { averageScore=totalScore/totalRows; averageReact=totalReactTime/totalRows; } emit sendRows (rowSlow, rowFast,rowSlowReact, rowFastReact); }@ I tried to eliminate the code that was irrelevant to the table creation. Hopefully I didn't forget something. What is wrong here?
  • How to force a Windows mapped drive to refresh

    2
    0 Votes
    2 Posts
    5k Views
    L
    "QProcess":http://doc.qt.nokia.com/4.7/qprocess.html , net.exe and the appropriate "commands":http://www.computerhope.com/nethlp.htm
  • QSplashScreen Example not working

    9
    0 Votes
    9 Posts
    9k Views
    R
    bq. I updated the code. It should work now. Thanks alot loladiro, will try with this.
  • ZWSP bug in QTextBrowser?

    2
    0 Votes
    2 Posts
    2k Views
    M
    I'm not sure of a fix, but be sure to add a bug in "Jira":http://bugreports.qt.nokia.com if there's not one there already.
  • Creating wait screen

    8
    0 Votes
    8 Posts
    5k Views
    M
    Unfortunately, a QProgressBar would suffer from the same shortcomings as a QProgressDialog if the main event loop is blocked by the work in progress. DurgeshK mentioned that his processing is running 3rd-party code, so there's no way to process events during the work being done.
  • [SOLVED]convert const QImage & to QImage *

    10
    0 Votes
    10 Posts
    10k Views
    M
    Be sure and change the title of the thread to add [Solved]. Thanks!
  • QSqlTableModel don't set Dirty Flag..

    4
    0 Votes
    4 Posts
    3k Views
    L
    Not that way [quote] If index is invalid or points to a non-existing row, false is returned. [/quote] You could listen to the dataChanged() signal however.
  • [Solved]Wrong QRegExp

    7
    0 Votes
    7 Posts
    2k Views
    R
    Ok, thank you for help!
  • Some issues in plugin design...

    21
    0 Votes
    21 Posts
    9k Views
    M
    [quote author="Gourmand" date="1313185840"]I did not get qualified answer yet. No regarding to Qt-inside engineers. This all was a "speech about nothing". No one of you all answered to my question. Is this site moderated? Can anybody turn discuss to proper line? [/quote] Hi Gourmand, please check your attitude on these forums. Folks are trying to help you and your replies can be interpreted as rude and ungrateful. This forum has people of many cultures and backgrounds so please be extra thorough when expressing yourself. Yes, this forum is moderated. Read up on what Lukas Geyer and loladiro writes about this forum above, it's good advice. Thanks, -MariusG (admin)
  • [Solved]Context menu

    7
    0 Votes
    7 Posts
    3k Views
    R
    I fogot to call function setContextMenuTabWidget(); and create menu
  • Problems with QstandardItem and setFlags

    3
    0 Votes
    3 Posts
    5k Views
    K
    Is your problem solved now? If so, please mark it with [Solved] in the subject line.
  • Save / load the state of lineEdit widget

    2
    0 Votes
    2 Posts
    2k Views
    G
    In the same way as the "store the state of a variable":http://developer.qt.nokia.com/forums/viewthread/8520/ or "save the result of a check box":http://developer.qt.nokia.com/forums/viewthread/8485/ . Use QSettings and store each property you need to store.
  • Deploying a mac package

    10
    0 Votes
    10 Posts
    6k Views
    AlicemirrorA
    elyness, I think that that the consideration should be out of the Qt packaging question. If the previously installed stuff is a set of components i.e. libraries or commands etc that - to be clear - will be managed / called by the application the problem is how these packages should be installed. To give and example the Inkscape porting on Mac will work as do Gimp and other programs with the "X" component for Mac. This means that you before install the "X" component that is packaged in a way so that the application can start from the aplication menu but also called automatically like any other Mac OS-X command. After installing and running Inkscape or Gimp you see that if it is not running yet "X" component will start before. The legacy stuff that you should have external to your package need to be installed somewhere in the Mac OS so that it can be managed / launched by other applications (i.e. the programs under /bin, or /usr/bin or /usr/sbin and this means as I understand, that: Your application package should be app as you have already done The legacy stuff should be packaged for install separately (i.e. deployed only in the first installation or as a "needed package" Your users should install / update their application in the conditions that the legacy stuff is already present in the computer. What the application should do is to check the presence of these files or libraries when start and - if not - notify it to the user. Can be a method ?
  • Qt::SizeHintRole isn't adjusting the height of a QTableView Row?

    2
    0 Votes
    2 Posts
    12k Views
    S
    There where a number of steps, most of them I got from here: http://developer.qt.nokia.com/faq/answer/how_can_i_change_the_row_height_of_a_qtreeview I had to set QTableView::resizeRowsToContents to true and implement the QItemDelegate::sizeHint. In implementing the sizeHint, I had to get into the model, get the image, and return the size of the image. Once I did that, it sized correctly for me.
  • [Solved] QRubberBand and QGLWidget

    5
    0 Votes
    5 Posts
    5k Views
    R
    Sorry, just test count of points I've get when reply on post. I think I've got 5 points against 2. [Update]: indeed 5 points. Oh here is new Points&Ranks rules.