Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • 0 Votes
    2 Posts
    2k Views
    K
    You could, and I recommend you do. :)
  • [Solved] Qt and ANGLE woes

    12
    0 Votes
    12 Posts
    9k Views
    M
    In cmake I have. find_package(Qt5Widgets REQUIRED) find_package(Qt5Gui REQUIRED) find_package(Qt5Core REQUIRED) find_package(Qt5OpenGL REQUIRED) set(EXTERNAL_LIBS ${Qt5Widgets_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5OpenGL_LIBRARIES} Qt5OpenGL_LIBRARIES only appears as Qt5::Opengl I dont know how to link in libEGL or libGLES2. I dont want to do it the dirty way :) they are both in qtbase/lib are the referenced in the cmake modules of qt? EDIT: Actually I'll do the work for this myself. I'll create another issue if I cant solve it because cmake probably isn't your problem to deal with. and I'm basically asking you to hold my hand at this stage lol Thanks again dude I think I will have it built shortly :)
  • [solved] two operators with the same input?

    2
    0 Votes
    2 Posts
    886 Views
    B
    ok, found answer myself: http://stackoverflow.com/questions/5762042/const-overloaded-operator-function-and-its-invocation
  • [SOLVED] How can I make a Class be instantiated only ONCE?

    25
    0 Votes
    25 Posts
    16k Views
    C
    Seems like this thread became interesting :) As far as my goal is concerned (and being just a mid-level dev), the "Singleton implementation":http://www.qtcentre.org/wiki/index.php?title=Singleton_pattern works fine on me. Thank you guys for the help! I will mark this thread [SOLVED] but you may still continue the discussion (and I will spend some time reading your comments since I think it is really interesting).
  • [SOLVED]Download file without main event loop

    3
    0 Votes
    3 Posts
    2k Views
    J
    My plan was, that I'd retrieve current version of the program from the updater, because it already has all functions written for version checking, updating... I'd start it with parameter, -v for example, and in this case program would only retrieve and output latest version. Main program would correctly correspond to received message. But based on your solution ( ugly as you said), I'll probably just copy the code, or create a shared library ( just thought of this solution). Thanks! Regards, Jake
  • [SOLVED] QTreeWidget spacing

    3
    0 Votes
    3 Posts
    4k Views
    B
    [quote author="Krzysztof Kawa" date="1357925838"]This space is there for a reason. It's reserved for the open/close handle icon when you have sub-items in your tree. If you want a flat structure use QListWidget instead. If for some reason you still want to remove it you can use setIndentation(0).[/quote] Thanks.
  • Compiling Qt 5 on Red Hat Enterprise Linux 6.3 fails

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Qt5 with QMediaPlayer and QVideoWidget

    9
    0 Votes
    9 Posts
    24k Views
    K
    i have found another lib that wrap ffmpeg https://github.com/wang-bin/QtAV it seem to work fine. Maybe we can avoid to reinvent the wheel ;).
  • Qt5 and QAssistant

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Function doesn't work properly when called from an object

    4
    0 Votes
    4 Posts
    1k Views
    M
    @connect(this, SIGNAL(startISQImport(string)), this,SLOT(import(string)));@ You did not show use the function/slot "import(string)". How does it look like? (I only see an "ISQImport" function. If you intended to connect to that one, you connect() code is wrong) -- BTW: The toLocal8Bit() function will screw up all characters that happen to not be representable in the computer's local 8-Bit codepage, which can be different on every computer. Instead use toUtf8() and make isq2tif() UTF8-aware. Or even better: Make that function take a const reference to a QString rather than a C string.
  • How to build Qt 5.0.0 with VS2012 in "static" mode?

    1
    0 Votes
    1 Posts
    970 Views
    No one has replied
  • [SOLVED] QList<CustomWidget*> : how to get a handle to its contents

    5
    0 Votes
    5 Posts
    2k Views
    C
    Thanks sierdzio and Lukas Geyer and Zlatomir! It works now. I also got the question in my mind that I know I am doing the right thing, why it isn't working? Apparently, x and y became "negative" so they became invisible. There is just a small problem with computing for the x's and y's of each CustomWidget. I always used QDebug in all my codes, I just missed "x and y" this time. My Bad! Thanks! I appreciate your help.
  • 0 Votes
    7 Posts
    2k Views
    D
    Thank you, all. I finally used a variation of the approach suggested by ChrisW67 namely, adding a marker at the beginning of the path for each image and then replacing them all with the appropriate path just before applying the style.
  • 0 Votes
    1 Posts
    693 Views
    No one has replied
  • [SOLVED] QList question

    6
    0 Votes
    6 Posts
    4k Views
    B
    Solved. THANKS! @QList< QList<QString> > allList;@ Loop: @QList<QString> currLoop; currLoop.append(id); currLoop.append(name); allList.append(currLoop);@ @void MainWindow::MyTreeWidgetSelected(QTreeWidgetItem *item, int index) { qDebug() << allList.at(ui->MyTreeWidget->indexOfTopLevelItem(item)); }@
  • Item view (delegate and editor)

    3
    0 Votes
    3 Posts
    2k Views
    JeroentjehomeJ
    Huh, bq. Obviously I need the pointer of the comboBox shown in each cell. The view keeps track of the pointers for you. You get the index you are, that's it and that's enough. For every instance the view keeps the pointer. In you delegate class reimplement the createEditor and setEditordata function to comply with it. In the createEditor set the elements of the combobox. the setEditorData function is called when the item is changed, so your able to set a different colour. Using the index.model()->data(index....) function you can analyse the data in the model for the corresponding index. So if the colour is dependent of the model data, do it like that. Otherwise, overwrite the paint event. Hope this gets you started
  • [SOLVED]QScrollArea deleting issue

    3
    0 Votes
    3 Posts
    3k Views
    B
    I've finally managed to solve it... In case anyone else encounters this problem... Just be sure to setAttribute(Qt::WA_DeleteOnClose) for each widget you intend to use in the scrollarea and when you need to close the area and create a new one just use the close() method...
  • QGraphicsView and QTreeView synchronous scrolling

    2
    0 Votes
    2 Posts
    3k Views
    S
    " Why not just connect valueChanged() signals of vertical (or horizontal, where appropriate) scrollbars of both widgets to their setValue() counterparts? " -- Tnx, recently connected next way: @connect(ui->treeView->verticalScrollBar(),SIGNAL(valueChanged(int)),this,SLOT(scroll_gv_v(int))); connect(ui->graphicsView->verticalScrollBar(),SIGNAL(valueChanged(int)),this,SLOT(scroll_tv_v(int))); //... void MainWindow::scroll_gv_v(int dy) { qDebug()<<"*** in scroll_gv_v, dy = "<<dy<<endl; ui->graphicsView->verticalScrollBar()->setValue(dy); ui->graphicsView->verticalScrollBar()->setSliderPosition(dy); ui->graphicsView->verticalScrollBar()->update(); ui->graphicsView->verticalScrollBar()->repaint(); ui->graphicsView->update(); ui->graphicsView->repaint(); qDebug()<<"*** in scroll_gv_v, tree view scroll bar value = "<<ui->treeView->verticalScrollBar()->value()<<endl; qDebug()<<"*** in scroll_gv_v, graphics view scroll bar value = "<<ui->graphicsView->verticalScrollBar()->value()<<endl; } void MainWindow::scroll_tv_v(int dy) { qDebug()<<"*** in scroll_tv_v, dy = "<<dy<<endl; ui->treeView->verticalScrollBar()->setValue(dy); ui->treeView->verticalScrollBar()->setSliderPosition(dy); ui->treeView->verticalScrollBar()->update(); ui->treeView->verticalScrollBar()->repaint(); ui->treeView->update(); ui->treeView->repaint(); qDebug()<<"*** in scroll_tv_v, tree view scroll bar value = "<<ui->treeView->verticalScrollBar()->value()<<endl; qDebug()<<"*** in scroll_tv_v, graphics view scroll bar value = "<<ui->graphicsView->verticalScrollBar()->value()<<endl; }@ then qDebug() shows, that the verticalScrollBar() value of the counterparts stays the same after the signals called and finished and counterpart scrollbars of the connected widgets do not move at all then. Why the value of the counterpart verticalScrollBar() wasn't changed then in such implementation ? when I changed @ void MainWindow::scroll_gv(int dx,int dy) { ui->graphicsView->scroll(dx,dy); } void MainWindow::scroll_tv(int dx,int dy) { ui->treeView->scroll(dx,dy); }@ to: [CODE] void MainWindow::scroll_gv(int dx,int dy) { ui->graphicsView->viewport()->scroll(dx,dy); } void MainWindow::scroll_tv(int dx,int dy) { ui->treeView->viewport()->scroll(dx,dy); }[/CODE] then the internal widgets move more close fashion to the desired results, but still scroll bars frozen while moving and internals of the widgets are degraded during scrolling, see video recorded: "https://www.box.com/s/irv4qqgmxmewvydc8ual":[url]https://www.box.com/s/irv4qqgmxmewvydc8ual[/url] The question is how to correct that, what widgets properties to set to what value ? How to code the scrolling ? Thanks.
  • How to custom menu's looking?

    2
    0 Votes
    2 Posts
    825 Views
    sierdzioS
    Either try with QStyle, or implement own drawing method. A lot can also be achieved using Qt Style Sheets. QML is also an option, of course, although probably not in your case.
  • Changing caret color in a QGraphicsTextItem

    3
    0 Votes
    3 Posts
    1k Views
    Z
    I'm sorry, but I don't understand your reply, I think we are talking about different things. I'm asking about the flashing cursor in the text, not the mouse cursor.