Search Results

Search found 2964 results on 119 pages for 'qt stylesheet'.

Page 21/119 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Qt double click check left button mouse

    - by Alex Ivasyuv
    I need to run slot only on doubleClick with left button mouse, instead of both. connect(this -> myComponent, SIGNAL (doubleClicked (const QModelIndex & )), this, SLOT (performSomeAction(const QModelIndex & ))); With this event, double click works in both cases, but needed only with left button click. How I can do it? this - myComponent = QTableView

    Read the article

  • Qt QTableView and horizontalHeader()->restoreState()

    - by cheez
    I can't narrow down this bug, however I seem to have the following problem: - saveState() of a horizontalHeader() - restart app - Modify model so that it has one less column - restoreState() - Now, for some reason, the state of the headerview is totally messed up. I cannot show or hide any new columns, nor can I ever get a reasonable state back I know, this is not very descriptive but I'm hoping others have had this problem before.

    Read the article

  • Qt - QWebView Problem

    - by user547057
    Hi, I have a PyQt gui script which consists of a QWebView widget. I'm trying to send a GET request, i.e go to a page, fill a form and hit click using the code at the bottom of this question. Since i'm dealing with the documentElement(a QWebElement) of the webview, I need to place all DOM actions in a separate function(which I have named fillForm) and connect the loadFinished() signal into the function. Without connecting the signal, the document will not have loaded and I won't be able to get the elements I want. I'm able to submit the form correctly and get the proper response from the webpage. The problem i'm having is that, the above leads to a sort of infinite loop. This is because the webpage gets reloaded each time a new page is loaded, so the form gets filled each and every single time without stopping. I'd like to know if there's some way of finding out whether the WebView's page has loaded fully, non-asynchronously or maybe pause execution of the script(without freezing the gui) until the whole document has loaded. I'm unable to come up with a satisfactory solution(my idea consisted of keeping a global variable to track clicks) to this problem. I would appreciate it if someone could help me out with a better way to tackle this. Thanks! Here's the code i'm using import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import * from PyQt4 import QtCore app = QApplication(sys.argv) web = QWebView() web.load(QUrl("http://mywebsite.com")) def fillForm(): doc = web.page().mainFrame().documentElement() searchform = doc.findFirst("input[type=text]") searchform.setAttribute("value", "hello") button = doc.findFirst("input[type=submit]") button.evaluateJavaScript("click()") QtCore.QObject.connect(web, QtCore.SIGNAL("loadFinished"), fillForm) web.show() sys.exit(app.exec_())

    Read the article

  • Qt - problem appending to QList of QList

    - by bullettime
    I'm trying to append items to a QList at runtime, but I'm running on a error message. Basically what I'm trying to do is to make a QList of QLists and add a few customClass objects to each of the inner lists. Here's my code: widget.h: class Widget : public QWidget { Q_OBJECT public: Widget(QWidget *parent = 0); ~Widget(); public slots: static QList<QList<customClass> > testlist(){ QList<QList<customClass> > mylist; for(int w=0 ; w<5 ; w++){ mylist.append(QList<customClass>()); } for(int z=0 ; z<mylist.size() ; z++){ for(int x=0 ; x<10 ; x++){ customClass co = customClass(); mylist.at(z).append(co); } } return mylist; } }; customclass.h: class customClass { public: customClass(){ this->varInt = 1; this->varQString = "hello world"; } int varInt; QString varQString; }; main.cpp: int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; QList<QList<customClass> > list; list = w.testlist(); w.show(); return a.exec(); } But when I try to run the application, it gives off this error: error: passing `const QList<customClass>' as `this' argument of `void List<T>::append(const T&) [with T = customClass]' discards qualifiers I also tried inserting the objects using foreach: foreach(QList<customClass> list, mylist){ for(int x=0 ; x<10 ; x++){ list.append(customClass()); } } The error was gone, but the customClass objects weren't appended, I could verify that by using a debugging loop in main that showed the inner QLists sizes as zero. What am I doing wrong?

    Read the article

  • Qt - A login dialog

    - by Narek
    I want to create a login dialog by inheriting QDialog. I put in subclass named LoginDialog 2 QLineEdits: for login for password. I want to be able to warn the user with a message if the caps lock is ON while he will start to fill passwordLineEdit. Suppose I have a function that tells the current state of CapsLock button. So I want to do eventFiltering in LoginDialog class in order to understand that user starts to fill the password field (i.e. user just stepped into the password field) So for that purpose I wrote the following in the LoginDialog class constructor: m_passwordLineEdit->installEventFilter(this); So the only thing is to do is to implement a function which can understand that user is going to fill the password. Seems is should be done with the following function(??): bool LoginDialog::eventFilter(QObject *target, QEvent *event) { if (target == m_passwordLineEdit) { } return QDialog::eventFilter(target, event); } How to implement this function???

    Read the article

  • Capturing mouse events for specific dom/web elements in QT

    - by Red Serpent
    Hi I would like to know if it is possible in QTWebKit to install an event filter or capture events that occur from specific Dom elements. For example, my webview is showing a webpage that has text, images and an edit box, I want to disable the right-clicking and highlighting functionality on the text and images but at the same time when the user right-clicks inside the edit box, I want to display my context menu. I am not sure where should I install my event filter, in QwebView or QwebPage... currently this is what I'm using: MainWindow::MainWindow() { centralWidget = new WebView(this); setCentralWidget(centralWidget); centralWidget->webView->installEventFilter(this); //No mouse events are rising on QWebPage //centralWidget->webView->page()->installEventFilter(this); } As its clear in the code above, when installing an EventFilter on QwebPage, I never receive any QMouseEvents, not by moving clicking or releasing any mouse buttons. While when setting it to filter events from QWebView it works fine. I am really interested with the first part of my question as to how handle Dom elements differently. How can I achieve such goal? Regards

    Read the article

  • Which Qt classes use the disk directly?

    - by Jurily
    I'm trying to write a library to separate all the disk activity out into its own thread, but the documentation doesn't really care about such things. What I want to accomplish is that aside from startup, all disk activity is asynchronous, and for that, I need to wrap every class that accesses the disk. Here's what I found so far: QtCore: QFile QTemporaryFile QDir QFileInfo QFileSystemWatcher QDirIterator QSettings QtGui: QFileDialog QFileSystemModel QDirModel (unsure) QFont (unsure) QFontDialog I'm sure there are more.

    Read the article

  • Qt: Printing pageRect and paperRect issues

    - by Pavels
    I have following printing code: void Print(QPrinter *printer) { QPainter q(printer); q.setRenderHint(QPainter::HighQualityAntialiasing, true); q.setPen(QPen(QColor("red"))); q.drawRect(printer->pageRect()); q.drawLine(printer->pageRect().topRight(), printer->pageRect().bottomLeft()); q.setPen(QPen(QColor("blue"))); q.drawRect(printer->paperRect()); q.drawLine(printer->paperRect().topRight(), printer->paperRect().bottomLeft()); } The result is different with QPrintPreviewDialog, rendered PDF, output to printers (HP LaserJet, PdfFactory, PdfCreator). Most of time the resulting rectangle is out of paper. What to do so the output is similar to all printers?

    Read the article

  • Qt - arguments in signal-slots

    - by bullettime
    I have a QPushButton, QDateEdit and another custom object. I want to connect the button to the date edit object in a way that when I click the button, the date edit object will change its set date to a date defined on the custom object. Kinda like this: connect(pushbutton,SIGNAL(clicked()),dateedit,SLOT(setDate(custom_object.getDate()))); but I can't do that. Apparently, the connect statement doesn't specify what's the information being passed from the signal to the slot, only the type of the information being passed. Is there a way to do this without having to create a new class?

    Read the article

  • QT drawing without erasing widget

    - by faya
    Hello, If I have a derived object of QWidget class and on slot function in it I have an update(). here is some pseudocode: *.h slot: updateNow(); *.cpp constructor() { setPalllete(QPallete(QColor(250,250,200))); setAUtoFillBackground(true); } updateNow() { update(); } paintEvent() { QPainter painter(this); painter.drawRect(1,2,3,4); } So how should I don't get erased my pallete after update() call? P.S. - Sorry for my English and only pseudocode.

    Read the article

  • QT:QString to char conversion

    - by mawia
    hi! all, I was tryin to convert a QSting to char* type but by following methods,but those does'nt seem to work. // QLineEdit *line=new QLineEdit();{just to describe what is line here} QString temp=line->text(); char *str=(char *)malloc(10); QByteArray ba=temp.toLatin1(); strcpy(str,ba.data()); can you elobrate the possible flaw with this method ,or tell alternative method.

    Read the article

  • changing cell background color in qt

    - by Moayyad Yaghi
    hello .. i'm new to pyqt , and i'm still facing some newbie problems :D i have a QTableWidget that is item delegated on a QChoice control ( hope i said it right ) i need to have the cell background color changes whenever a user change the choice control selection briefly: how to change a cell background color in a table widget ?? i use pyqt4 and python 2.6 thanx in advance

    Read the article

  • QT how to select and change all coulmns of QStandardItemModel

    - by user63898
    Hello im trying to programmatic select and change the background color of all the columns of QStandardItemModel i have this that paint me only the first column out of 5 that the row contains // getting the rows QStandardItem* standardItem = m_model->item(i); //set the color i like all the row to be painted standardItem->setBackground(QBrush(QColor(255,0,0)));

    Read the article

  • How to delete the widget from the stack in Qt

    - by Solitaire
    Hi, i am using Qstackedwidget to switch between the views, i will be able to traverse between the views, i am facing problem in some scenario, where i do not require the widgets, i want to remove them completely.. stackedwidget provides the functionality to removewidgets, still the ownership of the widget will be there, i mean widget will be hidden. i dont want this to be happen, when i call remove widget the widget should be deleted. how to handle this?

    Read the article

  • OpenCv QT CvNamedWindow IplImage not working

    - by Shahzaib
    I have problem with displaying Cam on QTLabel using openCV, Every thing is working fine . except one . I have to call function from open === cvNamedWindow() == in order for program to work properly . its displaying the webcam on the QLabel no problem but if i don't call the cvNamedWindow function then the program is just hanging its just keep displaying the camera which are working on the screen but i can't click on any thing else its getting freeze. doest any one has any idea why its happening and what i am doing wrong ?

    Read the article

  • Qt – How to add calculated column in QsqlRelationalTableModel ?

    - by user289175
    I have an table view showed part description, quantity, price And I have a Model/View using this code model = new QSqlRelationalTableModel(this); model->setTable("parts"); model->setRelation(3,QSqlRelation("part_tbl","part_id","part_desc")); model->select(); ui->tableView->setModel(model); I need to add a new column that shows quantity * price in the table view. It's important to know I'm using QsqlRelationalTableModel Help is appreciated, Thanks in advance

    Read the article

  • An "About" message box for a GUI with QT

    - by Narek
    QMessageBox::about( this, "About Application", "<h4>Application is a one-paragraph blurb</h4>\n\n" "Copyright 1991-2003 Such-and-such. " "For technical support, call 1234-56789 or see\n" "<a href=\"http://www.such-and-such.com\">http://www.such-and-such.com</a>" ); This code is creating the About message box which I wanted to have with two excaptions: 1. I would like to change the icon in the message box with an aaa.png file 2. And I would like to have the link clickable. It looks like hyperlink (it is blue and underlined) but mouse click does not work Any ideas?

    Read the article

  • text is exceeding the listview bounds in Qt

    - by Solitaire
    Hi. I need to customize the listview,I am placing an icon and a text at the center of the listview. If the text length is bigger then the list rectangle length.. the text is coming over the icon first letter of the string is not visible.. How to avoid this situation? Is it possible to give marique effect for the string? Thanks in advance.

    Read the article

  • Qt - invalid conversion to child class

    - by David Davidson
    I'm drawing polygons using the Graphics View framework. I added a polygon to the scene with this: QGraphicsPolygonItem *poly = scene->addPolygon(QPolygonF(vector_of_QPointF)); poly->setPos(some_point); But I need to implement some custom behaviour like selection, mouse over indicator, and other similar stuff on the graphics item. So I declared a class that inherits QGraphicsPolygonItem: #include <QGraphicsPolygonItem> class GridHex : public QGraphicsPolygonItem { public: GridHex(QGraphicsItem* parent = 0); }; GridHex::GridHex(QGraphicsItem* parent) : QGraphicsPolygonItem(parent) { } Not doing much with that class so far, as you can see. But shouldn't replacing QGraphicsPolygonItem with my GridHex class? This is throwing a " invalid conversion from 'QGraphicsPolygonItem*' to 'GridHex*' " error: GridHex* poly = scene->addPolygon(QPolygonF(vector_of_QPointF)); What am I doing wrong?

    Read the article

  • Qt - QPushButton text formatting

    - by Narek
    I have a QPushButton and on that I have a text and and icon. I want to make the text on the button to be bold and red. Looked at other forums, googled and lost my hope. Seems there is no way to do that if the button has an icon (of course if you don't creat a new icon wich is text+former icon). Is that the only way? Anyone has a better idea?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >