Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Concept understanding on model view mechanism

    12
    0 Votes
    12 Posts
    5k Views
    U
    Thanks Andre and all to clearly the concept i guess i understand it fully now
  • Adding a new row with QSqlTableModel and QDataWidgetMapper

    5
    0 Votes
    5 Posts
    6k Views
    S
    opps, I never called QSqlTableModel::setTable(). Added an Q_ASSERT to the macro that gets the column id's so should have that problem again. Don't know why so many folks hate macro's, they sure speed up development when used correctly:) Ok, next issue. How do I get the primary key from this inserted row? In the beforeInsert() slot, the PK column is being set to not be generates so the SQLite's AUTOINCREMENT can do it thing: record.setGenerated(_orderModel->orderIdNo(), false); Here is the little catch, I know for an absolute FACT, in the very near feature the DB will be converted over to Firebird, which does NOT have a AUTOINCREMENT concept like most DB's. So ideally if there is a way to get the PK that will work today for SQLite and tomorrow for Firebird, that would be ideal! Sam
  • QMainWindow::setCentralWidget fails when using my custom QuadSplit widget

    9
    0 Votes
    9 Posts
    6k Views
    A
    bq. If you then call a non-virtual method of a derived class through a base class pointer, the base class’ method is called (and not the derived one). all widgets which should be drawn have to be children of your QWidget-based class. As stated above, this is either done explicitly or implicitly – but never automatically. Ahh, I forgot about this. I suppose I need to be a bit more assertive with Qt's inheritance system... Then again, it's all about learning the library, and I'm a bit rusty in C++ atm. Thanks!
  • QX11EmbedContainer bug with multiple desktops

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Adding 'Next' and 'Previous' functionality to search engine

    7
    0 Votes
    7 Posts
    3k Views
    G
    [quote author="Volker" date="1309441186"]Did you try adding a [[Doc:QAction]] with a shortcut and connect that to a slot?[/quote] This is the solution. Add two new buttons, connect them to slots and to the same as in find, only that you use the current cursor position as start position.
  • Static linking for windows

    24
    0 Votes
    24 Posts
    39k Views
    C
    The solution for me is the following currently: Download Qt SDK 4.7.0 (4.7.1 - 4.7.3 not working): ftp://ftp.qt.nokia.com/qtsdk/qt-sdk-win-opensource-2010.05.exe (from ftp://ftp.qt.nokia.com/qtsdk) Statically build Qt according to instructions: http://doc.trolltech.com/4.7.1/deployment-windows.html#static-linking Statically build your apps according to the above instructions. I hope these will help you.
  • [SOLVED] Reload contents of QTableView from textfile

    8
    0 Votes
    8 Posts
    5k Views
    A
    Thanks all for your help. I was unaware that repainting widget doesnt do anything to the data model. So i created a new slot loadTable() and moved the loading table data to the slot. So now i do @connect(guitimer, SIGNAL(timeout()), this, SLOT(loadTable())); @ Thanks a lot. It works fine.
  • Main window focus problem

    3
    0 Votes
    3 Posts
    3k Views
    C
    If your opened window is a QDialog based widget, you can make it by @setModal(true)@ For QWidget based widget, try @setWindowModality ( Qt::WindowModality windowModality )@ And these 2 are all using/in the event loop
  • [Solved] How to save checkbox/radiobutton states with QSettings?

    22
    0 Votes
    22 Posts
    20k Views
    G
    This works perfectly for me: @ QSettings testSettings; int sliderVal = testSettings.value("slider/value", 6).toInt(); qDebug() << "sliderVal=" << sliderVal; ui->horizontalSlider->setValue(sliderVal); @ Be sure NOT to call or trigger any slot connected to signal valueChanged() before you have set the default value.
  • Qt rmdir function

    11
    0 Votes
    11 Posts
    5k Views
    D
    Good to know :) don't forget to mark thread as [solved], please.
  • [SOLVED] QTableWidget stylesheet not working in QTabWidget

    7
    0 Votes
    7 Posts
    13k Views
    EddyE
    you're welcome bq. To bad this can’t be achieved with the designer Just a little bit of code to have the stylesheet all over your application, or changing it on ever dialog. I know what i prefer. ;)
  • Can i define differnt sort role to each column ?

    5
    0 Votes
    5 Posts
    4k Views
    U
    Thanks allot for answering
  • Help with QFormLayout

    15
    0 Votes
    15 Posts
    9k Views
    E
    I did not ask how to use UI, I just tried to understand the code generated by the UI designer to be able to find the solution to my problem. See my code up there is a class that inherits from QWidget and is displayed in a QMdiArea. @void WindowMain::evoqueSubWindClientes() { QWidget *subwincli = new MdiChildClientes(this); mdiarea->addSubWindow(subwincli); subwincli->resize(800,600); subwincli->show(); }@ But the command resize (800,600) does not have any effect.
  • Getting the Ip address the from active NIC on the local computer

    7
    0 Votes
    7 Posts
    13k Views
    RakettenR
    Hi all, thanks for the help, this code helped me a lot. Does anybody know how to determine, if local IP comes from DHCP or is a static bind? Does anybody know how to assign new binding method (dhcp/static) and if static Does anybody know how to assign ip, mask and standard gateway. portable code is great, but I can be happy with Fedora code.... Thanks in advance.
  • Converting a SQLite julianday to a QDateTime

    8
    0 Votes
    8 Posts
    8k Views
    G
    Thanks, you're welcome. I've added a doc note to [[Doc:QDateTime]] for further reference.
  • How can i update QMenu and sub menu title text 's dynamically

    6
    0 Votes
    6 Posts
    8k Views
    Z
    Yes but why is that a problem for you? Constructing a formatted string is of very minimal cost when compared to actually getting it rendered on-screen. I think you are trying to optimise away a problem that doesn't exist.
  • Right aligned QLineEdit with an input mask: looks weird

    3
    0 Votes
    3 Posts
    4k Views
    M
    Did you try use Qt::AlignAbsolute flag?
  • [Solved] How to make a part of a checkbox's text bold?

    4
    0 Votes
    4 Posts
    9k Views
    L
    Οκ i will put a label.. No problem!
  • Regarding Accessing a single file by two process.

    Locked
    5
    0 Votes
    5 Posts
    2k Views
    T
    ... and moved to general and desktop section as this is definitely not for the guru group.
  • Qt and X

    7
    0 Votes
    7 Posts
    3k Views
    I
    I think this has been solved. Not sure but I think a call to XSync was neccesary. THanks.