Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • [SOLVED] QRegExp Help

    3
    0 Votes
    3 Posts
    2k Views
    J
    Aww that was it! thanks :D <3
  • Mapping a ScrollArea to the ScrollBars of a QGraphicsView

    6
    0 Votes
    6 Posts
    6k Views
    S
    Here is almost everything needed for this post: http://developer.qt.nokia.com/faq/answer/how_can_i_use_one_horizontal_scrollbar_to_scroll_several_qgraphicsviews
  • What names of Qt to use and not to use

    9
    0 Votes
    9 Posts
    3k Views
    S
    Yup, thanks for making this clear to us :)
  • Calling a function with activeqt

    2
    0 Votes
    2 Posts
    2k Views
    G
    Hi kitten, did you read the docs? You should call "setControl":http://doc.qt.nokia.com/4.7/qaxbase.html#control-prop with a valid COM GUID or similar (look at the link) not with a dll name. QAxObject is for wrapping COM objects, not C# stuff. If the C# stuff implements a COM object, you can use it with QAxObject like "described here":http://doc.qt.nokia.com/4.7/qaxbase.html#details
  • QDataWidgetMapper and QLineEdit with validator

    2
    0 Votes
    2 Posts
    2k Views
    G
    Hi Jaroslav I assume from your post that you want to actually match ANY four characters. If this is correct, then your expression should be "[A-Z | a-z]{4}" or else you'll only match CAPITALS. To solve your problem regarding the validation, you should implement something along the lines of: @myLineEdit->setValidator(validator) if(myLineEdit->hasAcceptableInput()) { //capture data }@ Hope that helps!
  • [SOLVED] Displaying progress messages with QTextEdit

    14
    0 Votes
    14 Posts
    23k Views
    M
    Glad to see it's working!
  • Using /clr on qt

    6
    0 Votes
    6 Posts
    5k Views
    R
    [quote author="kitten" date="1315398134"]can i use active qt?how?[/quote] I think, activeqt does not help you... Tell me, what distinguishes library c# from other library? Are you written this library? Does open source code this lib?
  • Method raise() of class QWidget does not work as expected

    15
    0 Votes
    15 Posts
    11k Views
    G
    [quote author="Ruu_Rinki" date="1315400091"]Gerolf, Thank you for such a detailed response. But it is necessary for me.[/quote] We had the same problems in our project (but on windows) ;-) We have a singleton application which should üpop up if someone starts a second instance... What we did is, we forced our window to the top (set top level falg, remove it, via windows API), the only thing that does not work is setting the focus .... Not nice but better than nothing ...
  • Resized QTreeWidget headers hiding items

    4
    0 Votes
    4 Posts
    8k Views
    R
    Thanks Alex, that's perfect :)
  • [SOLVED] Changing QTableWidget's horizontal headers' order

    5
    0 Votes
    5 Posts
    4k Views
    D
    Hi Andre, thanks! I will try to look into the QTableView, I'm still not so familiarized with it. My application is also quite simple, maybe so much abstraction is not necessary. Best regards
  • Regarding context menu

    4
    0 Votes
    4 Posts
    2k Views
    O
    If your context menu is based on QAction, you just can set the contextMenuPolicy to Qt::ActionsContextMenu. Then, all you need to do is insering your actions with "QWidget::addAction":http://doc.qt.nokia.com/latest/qwidget.html#addAction
  • What happened in 4.7.4 ? Many things is not work!?!?

    9
    0 Votes
    9 Posts
    4k Views
    C
    Already done. https://bugreports.qt.nokia.com/browse/QTSDK-880
  • 0 Votes
    6 Posts
    10k Views
    S
    Here is a piece of code which displays 2 graphs at a time Which is called by 2 threads simultaneously. @ QPainter *Dys_ecgpainter; QPainter *Dys_Balpainter; @ in init function i declare those 2 painters @ { Dys_ecgpainter= new QPainter; ansiscopeMainWindow->ui->DysAutonomia_Test_ECG_frame->setAttribute(Qt::WA_PaintOutsidePaintEvent,true); Dys_ecgpainter->begin((QWidget*)ansiscopeMainWindow->ui->DysAutonomia_Test_ECG_frame); Dys_ecgpainter->drawRect(0,0,235,80); Dys_Balpainter = new QPainter; ansiscopeMainWindow->ui->DysAutonomia_Test_balANS_frame->setAttribute(Qt::WA_PaintOutsidePaintEvent,true); Dys_Balpainter->begin( (QWidget*)ansiscopeMainWindow->ui->DysAutonomia_Test_balANS_frame); Dys_Balpainter->drawRect(0,0,235,80); } @ Dys_DrawECG function is called from ECG thread which plots ecg on a qframe @ void Dys_DrawECG(int data) { Dys_ecgpainter->drawLine(Dys_ECGgraph.lastplot.X,Dys_ECGgraph.lastplot.Y,Dys_ECGgraph.currentplot.X,Dys_ECGgraph.currentplot.Y); if(Dys_ECGgraph.currentplot.X >= Dys_ECGgraph.rightbottom.X) { Dys_ECGgraph.currentplot.X = 0; Dys_ecgpainter->fillRect(0,0,235,80,Qt::white); //qWarning("\nAfter reaching end of frame 200\n"); } Dys_ECGgraph.lastplot.X=Dys_ECGgraph.currentplot.X; Dys_ECGgraph.lastplot.Y=Dys_ECGgraph.currentplot.Y; } @ Dys_DrawbalANS function is called from BalANS thread which plots balANS on a qframe @ void Dys_DrawbalANS(POINT *Dys_points) { int i; int firsttime=1; float x,y; int Xvalue ,Yvalue ; int Xpos, Ypos; int balCurrentPlotX, balCurrentPlotY, balLastPlotX, balLastPlotY; balCurrentPlotX = 0; balCurrentPlotY = 0; balLastPlotX = 0; balLastPlotY = 0; Dys_Balpainter->fillRect(0,0,235,80,Qt::white); Dys_Balpainter->drawLine(117,0,117,20); Dys_Balpainter->drawLine(60,0,60,10); Dys_Balpainter->drawLine(174,0,174,10); Dys_Balpainter->drawLine(0,40,20,40); Dys_Balpainter->drawLine(0,20,10,20); Dys_Balpainter->drawLine(0,60,10,60); firsttime =1; for(i = 0; i< 312; i++) { if(firsttime) { firsttime=0; // Balpainter->moveTo(Xpos,Ypos); //Pen Position Dys_Balpainter->drawPoint(balCurrentPlotX,balCurrentPlotX); } else { Dys_Balpainter->drawLine(balCurrentPlotX, balCurrentPlotY, balLastPlotX, balLastPlotY); } balLastPlotX = balCurrentPlotX; balLastPlotY = balCurrentPlotY; } } @ EDIT: please use @-tags for code highlighting, Gerolf
  • Drag & Drop to external application

    9
    0 Votes
    9 Posts
    5k Views
    G
    Typically, applications check the mime type when a drop enter occures. If the mime type does not fit, the drop is rejected. So if you change the mime type later, it might be that it is too late.
  • QGraphicsItem::setOpacity and QGraphicsOpacityEffect

    3
    0 Votes
    3 Posts
    3k Views
    J
    hm what is the best way then to use other effects like blur or shadow on your items?
  • Strange things with QSslSocket (Qt 4.7.4)

    2
    0 Votes
    2 Posts
    3k Views
    P
    Just did some hack. Got relevant code from QxtSignalWaiter and added there @socket_->peek( 1 );@ Works well but i hate such boilerplate. Still waiting for better solutions and explanations about peek().
  • Centered zoom in a qgraphicswebview

    5
    0 Votes
    5 Posts
    2k Views
    M
    I simply do : @void MyWebView::centeredZoom(qreal delta) { webview->setTransformOriginPoint(webview->boundingRect().center()); webview->setScale(webview->scale() + delta); }@ It zooms centered but if I try to pan after a zoom I'm not able to reach the upper-left part of the webpage. Moreover the lower-right part is something out of the page.
  • Right To left alignment in Qaction

    11
    0 Votes
    11 Posts
    6k Views
    S
    Persian translation is added is added at July 19th, 2011. So it should be published with Qt 4.7.4 I think... Also if you have Qt source code from gitorious, you can easily merge the code to your repository with git.
  • [ RESOLVED ] New in 4.7.4: QDir::homePath() gives out empty string

    5
    0 Votes
    5 Posts
    3k Views
    G
    [quote author="ronM71" date="1315349947"]So, the "Clear system Environment" in Qt-Creator, causes those environment parameters to be "invisible" at runtime, for my system? If I deployed that same app on another machine, it would have been able to figure out the HOME string, right?[/quote] Yes, so it is. Instead of "Clear system Environment" you could just override it and reset or adjust the settings of some of the variables. Or just set the HOME variable to its original value (usually /Users/username on the Mac, with username being the short name, not the full name).
  • Defining the executable

    6
    0 Votes
    6 Posts
    2k Views
    R
    [quote author="sheehan1234" date="1315342002"] I started this new project through "Other project> C++ library". [/quote] So you are creating a library ,this way . Why dont you start with a console applicaiton ? EDIT : oops, bit late :( Didnt refresh the window for a while :(