Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Syncing content between two qtextedits with undo history

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • How can we create hyper link text in QtGui?

    12
    0 Votes
    12 Posts
    11k Views
    A
    [quote author="cincirin" date="1319184392"]The linkActivated() signal is not emitted if you set "openExternalLinks":http://doc.qt.nokia.com/stable/qlabel.html#openExternalLinks-prop to true[/quote] Good point :-) Also: it might be useful to check the return value of the connect statement and/or the output of the application. If the return value is false, the connect failed. The debug output of the application should tell you what the cause of that failure is.
  • [solved] Fullscreen confirm button

    16
    0 Votes
    16 Posts
    8k Views
    T
    Once more, thanks to everyone that helped me solve this issue! Best regards Richard
  • Designer question - probably obvious

    8
    0 Votes
    8 Posts
    4k Views
    A
    The designer plugin architecture is a bit different than what you seem to think it is. You can make a single-widget plugin, but you can also make multi-widget plugins. The class you are looking for in that case is [[doc:QDesignerCustomWidgetCollectionInterface]].
  • Calling functions from one class to another

    3
    0 Votes
    3 Posts
    3k Views
    L
    [quote author="petergeng" date="1319129803"]However, in the function call it seems that only objects are allowed in this passing process... why this is? is this necessary? how can i bypass this?[/quote] Well - it isn't. The call fails in your case because ModelChangedInfo() is a non-static method. So you either make it a static method (which is what you most probably do not want) or you call ModelChangedInfo() on an object of Dialog. If you do not know what I am talking about you should seriously consider what Andre said. Qt absolutely requires you to have at least a basic understanding of C++. If there are any specific (and Qt-related) questions feel free to come back here.
  • [Solved] QMdiArea simple question

    2
    0 Votes
    2 Posts
    3k Views
    W
    Try subWindow->show().
  • 0 Votes
    2 Posts
    2k Views
    W
    I figured it out. The problem was right in front of me - the Column Count function was constant but my function wasn't - making my function constant fixed all the relevant errors to this post.
  • SetupUi gives troubles with my class

    5
    0 Votes
    5 Posts
    6k Views
    R
    Problem solved, I thank you very much! Note to self: this is what I get for just starting to code without any thorough reading.
  • Building Qt Mobility 1.2.0 on Windows 7 64bit

    3
    0 Votes
    3 Posts
    5k Views
    J
    A bit late, but a workaround is to remove (or comment) the line @include (camera/camera.pri)@ from the file plugins\multimedia\directshow\directshow.pro.
  • Connecting to Database using .ui files.

    4
    0 Votes
    4 Posts
    3k Views
    G
    Using the UI file and connecting variables to the form's variables So far I have found out that: After I have created my UI form "someForm" and If I add the following statement before my class definition: "namespace Ui { class SomeClass; }" And I declare the UI form privately in SomeClass by: private: "Ui::someForm *ui;" This will enable me to access each UI element of the form by passing the values: ui->someWidget; (The following function calculates an hourly wage and puts the calculation into a total QSpinBox) "double SomeClass::updateTotal() { double total = (ui->rateSpinBox->value() * ui->hourSpinBox->value()); ui->totalSpinBox->setValue(total); }" Now I have to figure how to use this in conjunction with a QTableView. Thanks, Jay
  • Unable to influence rendering of selected items using Qt::ItemDataRole

    5
    0 Votes
    5 Posts
    4k Views
    W
    [quote author="Andre" date="1319130593"] admins note Please edit your post if you want to change it, instead of just re-posting the entire thing. I have fixed your image. [/quote] Thank you for the reply. I did try to edit the post. I used Mozilla ff (various versions), and for some reason on posting after the edit it did not work. I could preview and see the image after edit, but could not post. I've not been able to post from Firefox (version 3.6 and thereafter version 5) from windows XP??? I had to change rendering to explorer to post in the first place. Therefore my apology for reposting the whole thing. This I now posted from ff under linux at home and it seems to work better. I agree that allowing roles to render seems wrong if you can't do it consistently for all kinds of rendering. We initially used a delegate for the same thing, but sometimes data exists (can exist) in the model that influences rendering, but does not form part of the actual viewable data e.g: I have 10 parameters, 8 of which is displayed, two which influence the color and font. The column count is then specified as 8, and the delegate typically is not intimate enough with a model (and should not be) to know that non displayed data influences displayed data. Furthermore, what lead me to using the roles for the colour, was initially the fact that my parameters influences the width of table column headers (as well as width of editors...), for this reason it is reasonable to suggest a font size from the model, as the view has no clue. Inorder to give the correct size hint I had to be aware of the font too (and at that stage only the delegate was aware of this). The model cannot request the font used from the delegate (else everything becomes too coupled). My solution would be - keep all data (even rendering data) in the model (I suppose the model can lend from styles). If one wants rendering be different from what was specified/hinted by the model, I would then suggest a proxy model. The delegate then exists solely for the purpose of defining editor type. Scenario: We want columns in table views to autoscale iaw the parameters in conjunction with header text: max( paramWidth, headerWidth). How? By determining the maximum width of a field. Then we require the font. Therefore the model needs to be font aware. Qt::FontRole to the rescue. But font role influences rendering, and with customized delegates the model cannot know the font. Therefore, as with StyledItemDelegate, the model dictates rendering (it has to, otherwise the design will have to change?). Finally, delegates use item indexes, and undisplayed data (in the model) might influence rendering of displayed data. QStyledItemIndex uses model indexes as supplied by QTableView, which is determined by the visible row/col count. A general delegate can therefore not render correctly without being intimate with the model - too coupled. Again - we need roles in the model... I don't know if I'm making sense to you. Kind regards, thanks again for your reply and patience. Werner
  • Running QProcess in Thread to not freeze GUI on waitForFinished()

    7
    0 Votes
    7 Posts
    15k Views
    G
    Maybe using a [[Doc:QProgressDialog]] to inform the user that something's going on.
  • Disable standard button within QDialogButtonBox

    9
    0 Votes
    9 Posts
    26k Views
    D
    if anybody cares the way you can do it with the QDialogButtonBox widget is: (assuming your button box is called "buttonBox"): flag = false self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(flag)
  • 0 Votes
    2 Posts
    3k Views
    C
    This works: QGraphicsProxyWidget *proxyWidget = textEdit->graphicsProxyWidget(); QGraphicsScene *graphicsScene = proxyWidget->scene(); QGraphicsView *graphicsView = graphicsScene->views().first(); cursorRect = graphicsView->mapFromScene(proxyWidget->mapToScene(QRectF(textEdit->cursorRect()))).boundingRect(); cursorRect = QRect(graphicsView->mapToGlobal(cursorRect.topLeft()), cursorRect.size());
  • Z-order of QTab in a QTabWidget

    12
    0 Votes
    12 Posts
    9k Views
    S
    Hey, this looks very nice ;-) Thank you for sharing this.
  • New window -> Where are my buttons?

    4
    0 Votes
    4 Posts
    2k Views
    M
    Thanks! You were right. I should use "NewWindow" instead of QMainWindow. Thanks again, this helps me a lot!!
  • [solved] Access model data in paint function

    3
    0 Votes
    3 Posts
    2k Views
    T
    works, great, thank you! Richard @ QModelIndex typeIndex = index.model()->index(index.row(),1); type = index.model()->data( typeIndex, Qt::DisplayRole).toString(); @
  • How to use QPluginLoader to view methods inside library

    7
    0 Votes
    7 Posts
    3k Views
    L
    Not using pure Qt. Take a look at tools like nm (part of "binutils":http://www.gnu.org/software/binutils/).
  • [Solved]Get value of checkbox in a qtableview

    13
    0 Votes
    13 Posts
    13k Views
    T
    Thanks for the code and its OK No problems after a while.
  • 0 Votes
    5 Posts
    4k Views
    P
    Actually i have tried it taking different approach by using flag in mousepressEvent to detect left or right click and used the same flag in mouse move event and now it is working.